Skip to content

Commit

Permalink
Verify post visibility when finding last visible post
Browse files Browse the repository at this point in the history
  • Loading branch information
louiecaulfield committed Sep 12, 2014
1 parent 6929197 commit 1145333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/forem/forum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def last_post_for(forem_user)
end

def last_visible_post(forem_user)
posts.approved_or_pending_review_for(forem_user).last
posts.visible.approved_or_pending_review_for(forem_user).last

This comment has been minimized.

Copy link
@radar

radar Oct 19, 2014

Collaborator

Could you please write a regression test for this so we can be sure that it doesn't happen again?

This comment has been minimized.

Copy link
@louiecaulfield

louiecaulfield Oct 20, 2014

Author

I'll give it a go when I got some time. I haven't worked with tests and rails yet, so I'm facing a bit of a learning curve ;-)

end

def moderator?(user)
Expand Down

0 comments on commit 1145333

Please sign in to comment.