MS DG; only select the ids for soup query
This commit is contained in:
parent
0ce7f0c4bf
commit
14c5f1c564
2 changed files with 5 additions and 5 deletions
|
|
@ -3,7 +3,7 @@ require File.join(Rails.root, 'lib', 'stream', 'soup')
|
|||
class SoupsController < ApplicationController
|
||||
before_filter :redirect_unless_admin
|
||||
|
||||
def index
|
||||
def index
|
||||
default_stream_action(Stream::Soup)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Stream::Soup < Stream::Base
|
|||
end
|
||||
|
||||
def followed_tag_ids
|
||||
StatusMessage.tag_stream(user, tag_array, max_time, order).map{|x| x.id}
|
||||
ids(StatusMessage.tag_stream(user, tag_array, max_time, order))
|
||||
end
|
||||
|
||||
def mentioned_post_ids
|
||||
|
|
@ -37,14 +37,14 @@ class Stream::Soup < Stream::Base
|
|||
|
||||
#worthless helpers
|
||||
def featured_user_ids
|
||||
ids(Person.featured_users)
|
||||
Person.featured_users.select('id').map{|x| x.id}
|
||||
end
|
||||
|
||||
def tag_array
|
||||
user.followed_tags.map{|x| x.name}
|
||||
user.followed_tags.select('name').map{|x| x.name}
|
||||
end
|
||||
|
||||
def ids(enumerable)
|
||||
enumerable.map{|x| x.id}
|
||||
Post.connection.select_values(enumerable.select('posts.id').to_sql)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue