Module: ActiveRecord::AutosaveAssociation::AssociationBuilderExtension

Defined in:
activerecord/lib/active_record/autosave_association.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



122
123
124
# File 'activerecord/lib/active_record/autosave_association.rb', line 122

def self.included(base)
  base.valid_options << :autosave
end

Instance Method Details

#buildObject



126
127
128
129
130
# File 'activerecord/lib/active_record/autosave_association.rb', line 126

def build
  reflection = super
  model.send(:add_autosave_association_callbacks, reflection)
  reflection
end