Thanks Ben. I do store timestamps in the table. Would you suggest I should check for older/newer timestamps inside this loop?
#defines if a post of a user exists in db > def post_in_db > posts_of_user.each do |post| > if post.slug == params[:post_slug] > @post_slug ||= post.slug > @post_title ||= post.title > @post_body ||= post.body > @post_date ||= post.created_on > end > end > if @post_body == nil > redirect ('/' + params[:nickname]) > end > end or I should store the @post_date and create a new helper with a new loop to find the immediate older/newer timestamp before/after the @post_date? I’m thinking in terms of performance the first method would be better. -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To view this discussion on the web visit https://groups.google.com/d/msg/datamapper/-/BIZtrNOZgyMJ. To post to this group, send email to datamapper@googlegroups.com. To unsubscribe from this group, send email to datamapper+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.