Module: Reform::Form::ActiveRecord
- Defined in:
- lib/reform/form/active_record.rb
Defined Under Namespace
Modules: ClassMethods Classes: UniquenessValidator
Class Method Summary collapse
Instance Method Summary collapse
-
#model_for_property(name) ⇒ Object
TODO: this is no AR thing.
Class Method Details
.included(base) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/reform/form/active_record.rb', line 2 def self.included(base) base.class_eval do register_feature Reform::Form::ActiveRecord include Reform::Form::ActiveModel extend ClassMethods end end |
Instance Method Details
#model_for_property(name) ⇒ Object
TODO: this is no AR thing.
39 40 41 42 43 44 |
# File 'lib/reform/form/active_record.rb', line 39 def model_for_property(name) return model unless is_a?(Reform::Form::Composition) # i am too lazy for proper inheritance. there should be a ActiveRecord::Composition that handles this. model_name = mapper.representable_attrs.get(name)[:on] model[model_name] end |