Module: Reform::Form::ActiveModel

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

Defined Under Namespace

Modules: ClassMethods, FormBuilderMethods, ModelReflections, ModelValidations

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/reform/form/active_model.rb', line 4

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

    extend Uber::Delegates
    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

Instance Method Details

#model_name(*args) ⇒ Object



97
98
99
# File 'lib/reform/form/active_model.rb', line 97

def model_name(*args)
  self.class.model_name(*args)
end