mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-15 08:48:15 +00:00
Use private methods
This commit is contained in:
parent
bfdaa9789a
commit
6fb6b9fa4b
|
@ -8,8 +8,24 @@ class TagRelationshipsPresenter
|
|||
@following_map = {}
|
||||
@featuring_map = {}
|
||||
else
|
||||
@following_map = TagFollow.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).each_with_object({}) { |f, h| h[f.tag_id] = true }
|
||||
@featuring_map = FeaturedTag.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).each_with_object({}) { |f, h| h[f.tag_id] = true }
|
||||
@following_map = mapped_tag_follows(tags, current_account_id)
|
||||
@featuring_map = mapped_featured_tags(tags, current_account_id)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def mapped_tag_follows(tags, account_id)
|
||||
TagFollow
|
||||
.where(tag_id: tags.map(&:id), account_id: account_id)
|
||||
.pluck(:tag_id)
|
||||
.index_with(true)
|
||||
end
|
||||
|
||||
def mapped_featured_tags(tags, account_id)
|
||||
FeaturedTag
|
||||
.where(tag_id: tags.map(&:id), account_id: account_id)
|
||||
.pluck(:tag_id)
|
||||
.index_with(true)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user