don't join the tags table here, it makes the query slower

This commit is contained in:
Fabián Rodríguez 2013-01-27 13:12:11 -02:00
parent 74613b0b15
commit 4fa04e88ac

View file

@ -173,7 +173,7 @@ class StatusMessage < Post
private private
def self.tag_stream(tag_ids) def self.tag_stream(tag_ids)
joins(:tags).where(:tags => {:id => tag_ids}) joins(:taggings).where('taggings.tag_id IN (?)', tag_ids)
end end
end end