diff --git a/app/models/user/querying.rb b/app/models/user/querying.rb index d4c7da6c3fbbcfe1eb34d27b225f024da240f561..6db46cac6154c92014746e797f7d06d9d9aba5ab 100644 --- a/app/models/user/querying.rb +++ b/app/models/user/querying.rb @@ -31,7 +31,7 @@ module User::Querying opts[:by_members_of] ||= self.aspect_ids post_ids = klass.connection.select_values(visible_shareable_sql(klass, opts)).map { |id| id.to_i } - post_ids += klass.connection.select_values(construct_public_followings_sql(opts).to_sql).map {|id| id.to_i } + post_ids += klass.connection.select_values("#{construct_public_followings_sql(opts).to_sql} LIMIT #{opts[:limit]}").map {|id| id.to_i } end def visible_shareable_sql(klass, opts={})