method

_delete_record

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: ClassMethods
_delete_record(constraints) 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/persistence.rb, line 517
      def _delete_record(constraints) # :nodoc:
        constraints = constraints.map { |name, value| predicate_builder[name, value] }

        default_constraint = build_default_constraint
        constraints << default_constraint if default_constraint

        if current_scope = self.global_current_scope
          constraints << current_scope.where_clause.ast
        end

        dm = Arel::DeleteManager.new(arel_table)
        dm.wheres = constraints

        connection.delete(dm, "#{self} Destroy")
      end
Register or log in to add new notes.