MS DG; only select the ids for soup query

This commit is contained in:
Maxwell Salzberg 2011-10-14 11:08:47 -07:00
parent 0ce7f0c4bf
commit 14c5f1c564
2 changed files with 5 additions and 5 deletions

View file

@ -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