Module: Reform::Form::ActiveModel

Defined in:
lib/reform/form/active_model.rb,
lib/reform/form/active_model/model_validations.rb

Defined Under Namespace

Modules: ClassMethods, FormBuilderMethods, ModelValidations

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/reform/form/active_model.rb', line 50

def self.included(base)
  base.class_eval do
    extend ClassMethods
    register_feature ActiveModel

    delegates :model, *[:persisted?, :to_key, :to_param, :id] # Uber::Delegates

    def to_model # this is called somewhere in FormBuilder and ActionController.
      self
    end
  end
end