diff options
author | Ruxton <ruxton@thefrontiergroup.com.au> | 2014-02-07 10:23:19 +0400 |
---|---|---|
committer | Ruxton <ruxton@thefrontiergroup.com.au> | 2014-02-07 10:23:19 +0400 |
commit | c8a0c81b6acf206db4826707b39ef22402601255 (patch) | |
tree | 7463c4aac2575ff7ece101de0879fc44e947712a /app/models/user | |
parent | b5e6c2a149d0e7f84193ac08cd7b9d10af5662de (diff) |
Updating queries for the stream to be faster
Diffstat (limited to 'app/models/user')
-rw-r--r-- | app/models/user/querying.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/user/querying.rb b/app/models/user/querying.rb index c849b13a7..4f53e0351 100644 --- a/app/models/user/querying.rb +++ b/app/models/user/querying.rb @@ -68,10 +68,8 @@ module User::Querying end def construct_public_followings_sql(opts) - aspects = Aspect.where(:id => opts[:by_members_of]) - person_ids = Person.connection.select_values(people_in_aspects(aspects).select("people.id").to_sql) - - query = opts[:klass].where(:author_id => person_ids, :public => true, :pending => false) + Rails.logger.debug("[EVIL-QUERY] user.construct_public_followings_sql") + query = opts[:klass].where(:author_id => Person.in_aspects(opts[:by_members_of]).select("people.id"), :public => true, :pending => false) unless(opts[:klass] == Photo) query = query.where(:type => opts[:type]) |