eBooru/app/serializers/post_event_serializer.rb
Earlopain fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00

10 lines
248 B
Ruby

# frozen_string_literal: true
class PostEventSerializer < ActiveModel::Serializer
def creator_id
object.is_creator_visible?(CurrentUser.user) ? object.creator_id : nil
end
attributes :id, :creator_id, :post_id, :action, :created_at
end