Method: Contentful::Management::Resource::ClassMethods#update_coercions!

Defined in:
lib/contentful/management/resource.rb

#update_coercions!Object

Ensure inherited classes pick up coercions



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/contentful/management/resource.rb', line 141

def update_coercions!
  return if @coercions_updated

  if superclass.respond_to? :property_coercions
    @property_coercions = superclass.property_coercions.dup.merge(@property_coercions || {})
  end

  if superclass.respond_to? :sys_coercions
    @sys_coercions = superclass.sys_coercions.dup.merge(@sys_coercions || {})
  end

  if superclass.respond_to? :fields_coercions
    @fields_coercions = superclass.fields_coercions.dup.merge(@fields_coercions || {})
  end

  @coercions_updated = true
end