Module: MultipleTableInheritance::Child::Base::AttributeMethods
- Defined in:
- lib/multiple_table_inheritance/child/base.rb
Instance Method Summary collapse
- #define_attribute_methods ⇒ Object
- #inherit_parent_accessible_attributes ⇒ Object
- #inherit_parent_attributes ⇒ Object
- #inherited_attribute_methods_generated! ⇒ Object
- #inherited_attribute_methods_generated? ⇒ Boolean
Instance Method Details
#define_attribute_methods ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/multiple_table_inheritance/child/base.rb', line 69 def define_attribute_methods super @inherited_attribute_methods_mutex.synchronize do return if inherited_attribute_methods_generated? inherit_parent_attributes inherit_parent_accessible_attributes inherited_attribute_methods_generated! end end |
#inherit_parent_accessible_attributes ⇒ Object
86 87 88 89 90 |
# File 'lib/multiple_table_inheritance/child/base.rb', line 86 def inherit_parent_accessible_attributes parent_association_class.accessible_attributes.each do |attr| attr_accessible attr.to_sym end end |
#inherit_parent_attributes ⇒ Object
80 81 82 83 84 |
# File 'lib/multiple_table_inheritance/child/base.rb', line 80 def inherit_parent_attributes inherited_columns_and_associations.each do |name| delegate name, "#{name}=", :to => parent_association_name end end |
#inherited_attribute_methods_generated! ⇒ Object
96 97 98 |
# File 'lib/multiple_table_inheritance/child/base.rb', line 96 def inherited_attribute_methods_generated! @inherited_attribute_methods_generated = true end |
#inherited_attribute_methods_generated? ⇒ Boolean
92 93 94 |
# File 'lib/multiple_table_inheritance/child/base.rb', line 92 def inherited_attribute_methods_generated? @inherited_attribute_methods_generated ||= false end |