use select distinct as opposed to group by

This commit is contained in:
danielgrippi 2011-11-28 15:09:20 -08:00
parent 161d9d527c
commit 805346c70c

View file

@ -38,7 +38,7 @@ class StatusMessage < Post
} }
scope :commented_by, lambda { |person| scope :commented_by, lambda { |person|
joins(:comments).where(:comments => {:author_id => person.id}).group("posts.id") joins(:comments).where(:comments => {:author_id => person.id}).select("DISTINCT posts.id")
} }
def self.user_tag_stream(user, tag_ids) def self.user_tag_stream(user, tag_ids)