Sha256: 0d17697d1dfd66f0114dd329252b5fadbd69e10af8e51d87c2b9d2860021f624

Contents?: true

Size: 1006 Bytes

Versions: 2

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Nodes
    class DeleteStatement < Arel::Nodes::Node
      attr_accessor :relation, :wheres, :orders, :limit, :offset, :key

      def initialize(relation = nil, wheres = [])
        super()
        @relation = relation
        @wheres = wheres
        @orders = []
        @limit = nil
        @offset = nil
        @key = nil
      end

      def initialize_copy(other)
        super
        @relation = @relation.clone if @relation
        @wheres = @wheres.clone if @wheres
      end

      def hash
        [self.class, @relation, @wheres, @orders, @limit, @offset, @key].hash
      end

      def eql?(other)
        self.class == other.class &&
          self.relation == other.relation &&
          self.wheres == other.wheres &&
          self.orders == other.orders &&
          self.limit == other.limit &&
          self.offset == other.offset &&
          self.key == other.key
      end
      alias :== :eql?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-7.0.0.alpha2 lib/arel/nodes/delete_statement.rb
activerecord-7.0.0.alpha1 lib/arel/nodes/delete_statement.rb