Source code for the custom Mastodon (Glitchsoc) instance on berserker.town. https://berserker.town/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
487 B

# frozen_string_literal: true
class TagRelationshipsPresenter
attr_reader :following_map
def initialize(tags, current_account_id = nil, **options)
@following_map = if current_account_id.nil?
{}
else
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 }.merge(options[:following_map] || {})
end
end
end