Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/models/nested_attributes.rb
Class Method Summary collapse
- .accepts_nested_attributes_for_with_inheritance_management(*attr_names) ⇒ Object
- .alert_subclasses_of_new_nested_attributes ⇒ Object
- .superclass_received_nested_attributes(super_nested_attr_options) ⇒ Object
Class Method Details
.accepts_nested_attributes_for_with_inheritance_management(*attr_names) ⇒ Object
7 8 9 10 |
# File 'lib/models/nested_attributes.rb', line 7 def accepts_nested_attributes_for_with_inheritance_management(*attr_names) accepts_nested_attributes_for_without_inheritance_management(*attr_names) alert_subclasses_of_new_nested_attributes end |
.alert_subclasses_of_new_nested_attributes ⇒ Object
13 14 15 16 17 |
# File 'lib/models/nested_attributes.rb', line 13 def alert_subclasses_of_new_nested_attributes subclasses.each do |subclass| subclass.superclass_received_nested_attributes() end end |
.superclass_received_nested_attributes(super_nested_attr_options) ⇒ Object
19 20 21 22 23 |
# File 'lib/models/nested_attributes.rb', line 19 def superclass_received_nested_attributes() .update() do |hash, oldval, newval| oldval.nil? ? newval : oldval end end |