mirror of
https://github.com/diaspora/diaspora.git
synced 2026-04-29 03:01:03 -04:00
dk iz querying by id in status message tag_stream
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user