method
delete
v6.0.0 -
Show latest stable
- Class:
ActiveRecord::Associations::HasOneAssociation
delete(method = options[:dependent])public
No documentation available.
# File activerecord/lib/active_record/associations/has_one_association.rb, line 26
def delete(method = options[:dependent])
if load_target
case method
when :delete
target.delete
when :destroy
target.destroyed_by_association = reflection
target.destroy
throw(:abort) unless target.destroyed?
when :nullify
target.update_columns(nullified_owner_attributes) if target.persisted?
end
end
end