Module: Alchemy::JsonApi::IngredientSerializer

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/alchemy/json_api/ingredient_serializer.rb', line 6

def self.included(klass)
  klass.has_one :element, record_type: :element, serializer: ::Alchemy::JsonApi::ElementSerializer

  klass.attributes(
    :role,
    :value,
    :created_at,
    :updated_at
  )

  klass.attribute :deprecated, &:deprecated?
end