Merge remote-tracking branch 'parent/main' into kbtopic-remove-quote

This commit is contained in:
KMY 2025-04-26 08:30:17 +09:00
commit 80542ea172
76 changed files with 658 additions and 390 deletions

View file

@ -6,6 +6,7 @@ class REST::TagSerializer < ActiveModel::Serializer
attributes :id, :name, :url, :history
attribute :following, if: :current_user?
attribute :featuring, if: :current_user?
def id
object.id.to_s
@ -27,6 +28,14 @@ class REST::TagSerializer < ActiveModel::Serializer
end
end
def featuring
if instance_options && instance_options[:relationships]
instance_options[:relationships].featuring_map[object.id] || false
else
FeaturedTag.exists?(tag_id: object.id, account_id: current_user.account_id)
end
end
def current_user?
!current_user.nil?
end