dk iz querying by id in status message tag_stream

This commit is contained in:
Ilya Zhitomirskiy
2011-11-03 22:19:39 -07:00
parent f9a9654c86
commit ce199e770d
3 changed files with 8 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ class Stream::FollowedTag < Stream::Base
# @return [ActiveRecord::Association<Post>] AR association of posts
def posts
return [] if tag_string.empty?
@posts ||= StatusMessage.tag_stream(user, tag_array, max_time, order)
@posts ||= StatusMessage.tag_stream(user, tag_ids, max_time, order)
end
def contacts_title
@@ -28,8 +28,8 @@ class Stream::FollowedTag < Stream::Base
@tag_string ||= tags.join(', '){|tag| tag.name}.to_s
end
def tag_array
tags.map{|x| x.name}
def tag_ids
tags.map{|x| x.id}
end
def tags

View File

@@ -94,7 +94,7 @@ class Stream::Multi < Stream::Base
end
def followed_tags_post_ids
@followed_tags_ids ||= ids(StatusMessage.tag_stream(user, tag_array, max_time, order))
@followed_tags_ids ||= ids(StatusMessage.tag_stream(user, tag_ids, max_time, order))
end
def mentioned_post_ids
@@ -110,8 +110,8 @@ class Stream::Multi < Stream::Base
@community_spotlight_person_ids ||= Person.community_spotlight.select('id').map{|x| x.id}
end
def tag_array
user.followed_tags.select('name').map{|x| x.name}
def tag_ids
user.followed_tags.map{|x| x.id}
end
def ids(enumerable)