instance method
around_save_collection_association
Ruby on Rails 8.0.4
Since v6.0.6 PrivateSignature
around_save_collection_association()
Is used as an around_save callback to check while saving a collection association whether or not the parent was a new record before saving.
Source
# File activerecord/lib/active_record/autosave_association.rb, line 402
def around_save_collection_association
previously_new_record_before_save = (@new_record_before_save ||= false)
@new_record_before_save = !previously_new_record_before_save && new_record?
yield
ensure
@new_record_before_save = previously_new_record_before_save
end
Defined in activerecord/lib/active_record/autosave_association.rb line 402
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AutosaveAssociation