Sha256: d7c6296d239378edd2e06a7370acb7ca65bfa7adc0536feb325a2f410d9afdf3
Contents?: true
Size: 669 Bytes
Versions: 8
Compression:
Stored size: 669 Bytes
Contents
# frozen_string_literal: true require 'active_model/serializer/field' module ActiveModel class Serializer # Holds all the meta-data about an attribute as it was specified in the # ActiveModel::Serializer class. # # @example # class PostSerializer < ActiveModel::Serializer # attribute :content # attribute :name, key: :title # attribute :email, key: :author_email, if: :user_logged_in? # attribute :preview do # truncate(object.content) # end # # def user_logged_in? # current_user.logged_in? # end # end # class Attribute < Field end end end
Version data entries
8 entries across 8 versions & 2 rubygems