Module: Reform::Form::ActiveModel::ModelReflections::ClassMethods

Defined in:
lib/reform/form/active_model/model_reflections.rb

Instance Method Summary collapse

Instance Method Details

#reflect_on_association(*args) ⇒ Object

Delegate reflect_on_association to the model class to support simple_form’s association input.



16
17
18
# File 'lib/reform/form/active_model/model_reflections.rb', line 16

def reflect_on_association(*args)
  model_name.to_s.constantize.reflect_on_association(*args)
end

#validators_on(*args) ⇒ Object

this is needed in simpleform to infer required fields.



21
22
23
# File 'lib/reform/form/active_model/model_reflections.rb', line 21

def validators_on(*args)
  validation_groups.collect { |k, group| group.instance_variable_get(:@validations).validators_on(*args) }.flatten
end