Module: ActiveForm::Form::ClassMethods
- Defined in:
- lib/activeform-rails/form.rb
Instance Attribute Summary collapse
-
#main_class ⇒ Object
Returns the value of attribute main_class.
-
#main_model ⇒ Object
Returns the value of attribute main_model.
-
#reflected_class ⇒ Object
Returns the value of attribute reflected_class.
Instance Method Summary collapse
- #alias_property(new_method, old_method) ⇒ Object
- #i18n_scope ⇒ Object
- #models ⇒ Object
- #properties(*attributes, prefix: false, on: nil) ⇒ Object
Instance Attribute Details
#main_class ⇒ Object
Returns the value of attribute main_class.
13 14 15 |
# File 'lib/activeform-rails/form.rb', line 13 def main_class @main_class end |
#main_model ⇒ Object
Returns the value of attribute main_model.
13 14 15 |
# File 'lib/activeform-rails/form.rb', line 13 def main_model @main_model end |
#reflected_class ⇒ Object
Returns the value of attribute reflected_class.
13 14 15 |
# File 'lib/activeform-rails/form.rb', line 13 def reflected_class @reflected_class end |
Instance Method Details
#alias_property(new_method, old_method) ⇒ Object
43 44 45 46 |
# File 'lib/activeform-rails/form.rb', line 43 def alias_property(new_method, old_method) alias_method new_method.to_sym, old_method.to_sym alias_method "#{new_method}=".to_sym, "#{old_method}=".to_sym end |
#i18n_scope ⇒ Object
23 24 25 |
# File 'lib/activeform-rails/form.rb', line 23 def i18n_scope :activerecord end |
#models ⇒ Object
27 28 29 |
# File 'lib/activeform-rails/form.rb', line 27 def models @models ||= [] end |
#properties(*attributes, prefix: false, on: nil) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/activeform-rails/form.rb', line 15 def properties(*attributes, prefix: false, on: nil) if on.nil? attr_accessor *attributes else delegate_to_model(attributes, on, prefix) end end |