about summary refs log tree commit diff
path: root/app/presenters/tag_relationships_presenter.rb
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2023-04-14 19:22:47 -0500
committerStarfall <us@starfall.systems>2023-04-14 19:22:47 -0500
commit4fe1689de43f4404eb9530fcfbcbfb26d6c1c13a (patch)
tree6811b845bb7f4966b10dcefa3dea404246f161c7 /app/presenters/tag_relationships_presenter.rb
parent65c1e53a32cabcdbb7bca57002bb0f6acdebe07e (diff)
parentbed63f6dae0879ac840066b031229e0d139089cd (diff)
Merge remote-tracking branch 'glitch/main' HEAD main
Diffstat (limited to 'app/presenters/tag_relationships_presenter.rb')
-rw-r--r--app/presenters/tag_relationships_presenter.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/presenters/tag_relationships_presenter.rb b/app/presenters/tag_relationships_presenter.rb
index c3bdbaf07..52e24314b 100644
--- a/app/presenters/tag_relationships_presenter.rb
+++ b/app/presenters/tag_relationships_presenter.rb
@@ -4,12 +4,10 @@ class TagRelationshipsPresenter
   attr_reader :following_map
 
   def initialize(tags, current_account_id = nil, **options)
-    @following_map = begin
-      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
+    @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