class ActiveModel::Serializer
def self.attribute(attr, options = {}, &block)
object.edits.last(5)
def recent_edits
end
"#{object.first_name} #{object.last_name}"
attribute :full_name do
attribute :name, key: :title
attributes :id, :recent_edits
class AdminAuthorSerializer < ActiveModel::Serializer
@example
def self.attribute(attr, options = {}, &block) key = options.fetch(:key, attr) _attributes_data[key] = Attribute.new(attr, options, block) end