class ActiveModel::Serializer::Attribute
end
end
current_user.logged_in?
def user_logged_in?
end
truncate(object.content)
attribute :preview do
attribute :email, key: :author_email, if: :user_logged_in?
attribute :name, key: :title
attribute :content
class PostSerializer < ActiveModel::Serializer
@example
ActiveModel::Serializer class.
Holds all the meta-data about an attribute as it was specified in the