From 4fa04e88ac6142dfc7cd46a6d5d08f474688cb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Rodr=C3=ADguez?= Date: Sun, 27 Jan 2013 13:12:11 -0200 Subject: [PATCH] don't join the tags table here, it makes the query slower --- app/models/status_message.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/status_message.rb b/app/models/status_message.rb index e4adc4f0a..e6c46cd4d 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -173,7 +173,7 @@ class StatusMessage < Post private def self.tag_stream(tag_ids) - joins(:tags).where(:tags => {:id => tag_ids}) + joins(:taggings).where('taggings.tag_id IN (?)', tag_ids) end end