Skip to content

Commit

Permalink
fix the query to only cycle thru the current authors posts
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell authored and danielgrippi committed Feb 21, 2012
1 parent 0ab8ef1 commit 653e93f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/presenters/post_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ def previous_post
protected

def post_base
if current_user
scope = if current_user
Post.owned_or_visible_by_user(current_user)
else
Post.all_public
end
scope.where(:author_id => post.author_id)
end
end

0 comments on commit 653e93f

Please sign in to comment.