Class: ActiveModel::AttributeRegistration::ClassMethods::PendingDecorator

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_model/attribute_registration.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#apply_to(attribute_set) ⇒ Object



68
69
70
71
72
73
74
# File 'lib/active_model/attribute_registration.rb', line 68

def apply_to(attribute_set)
  (names || attribute_set.keys).each do |name|
    attribute = attribute_set[name]
    type = decorator.call(name, attribute.type)
    attribute_set[name] = attribute.with_type(type) if type
  end
end