Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @taggings = Tagging.paginate :all,
- :select => 'taggings.*',
- :joins => 'inner join tags on tags.id = taggings.tag_id
- left outer join topics on topics.id = taggings.id and taggings.taggable_type = "Topic"
- left outer join replies on replies.id = taggings.id and taggings.taggable_type = "Reply"
- left outer join comments on comments.id = taggings.id and taggings.taggable_type = "Comment"',
- :conditions => ['tag_id = ? and (topics.moderated_as_hidden = ? or topics.moderated_as_hidden is null) and
- (replies.moderated_as_hidden = ? or replies.moderated_as_hidden is null) and
- (comments.moderated_as_hidden = ? or comments.moderated_as_hidden is null)', @tag.id, false, false, false],
- :order => 'created_on desc',
- :page => params[:page],
- :per_page => 10
Add Comment
Please, Sign In to add comment