Module: ActiveData::Model::Associations::NestedAttributes::NestedAttributesMethodsExtension

Defined in:
lib/active_data/model/associations/nested_attributes.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ensure_extended!(klass) ⇒ Object



196
197
198
199
# File 'lib/active_data/model/associations/nested_attributes.rb', line 196

def self.ensure_extended!(klass)
  return if klass.singleton_class.ancestors.include?(self)
  klass.extend(self)
end

Instance Method Details

#nested_attributes_methods_moduleObject



201
202
203
204
205
206
207
# File 'lib/active_data/model/associations/nested_attributes.rb', line 201

def nested_attributes_methods_module
  @nested_attributes_methods_module ||= begin
    mod = const_set(:NestedAttributesMethods, Module.new)
    include(mod)
    mod
  end
end