Guest User

Untitled

a guest
Apr 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. @taggings = Tagging.paginate :all,
  2. :select => 'taggings.*',
  3. :joins => 'inner join tags on tags.id = taggings.tag_id
  4. left outer join topics on topics.id = taggings.id and taggings.taggable_type = "Topic"
  5. left outer join replies on replies.id = taggings.id and taggings.taggable_type = "Reply"
  6. left outer join comments on comments.id = taggings.id and taggings.taggable_type = "Comment"',
  7. :conditions => ['tag_id = ? and (topics.moderated_as_hidden = ? or topics.moderated_as_hidden is null) and
  8. (replies.moderated_as_hidden = ? or replies.moderated_as_hidden is null) and
  9. (comments.moderated_as_hidden = ? or comments.moderated_as_hidden is null)', @tag.id, false, false, false],
  10. :order => 'created_on desc',
  11. :page => params[:page],
  12. :per_page => 10
Add Comment
Please, Sign In to add comment