Flowdock
method

delete

Importance_0
Ruby on Rails latest stable (v5.2.3) - 0 notes - Class: ActiveRecord::Associations::HasOneAssociation
delete(method = options[:dependent]) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/has_one_association.rb, line 55
      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(reflection.foreign_key => nil) if target.persisted?
          end
        end
      end
Register or log in to add new notes.