lib/arel/nodes/select_statement.rb in arel-3.0.3 vs lib/arel/nodes/select_statement.rb in arel-4.0.0.beta1

- old
+ new

@@ -3,11 +3,10 @@ class SelectStatement < Arel::Nodes::Node attr_reader :cores attr_accessor :limit, :orders, :lock, :offset, :with def initialize cores = [SelectCore.new] - #puts caller @cores = cores @orders = [] @limit = nil @lock = nil @offset = nil @@ -17,8 +16,23 @@ def initialize_copy other super @cores = @cores.map { |x| x.clone } @orders = @orders.map { |x| x.clone } end + + def hash + [@cores, @orders, @limit, @lock, @offset, @with].hash + end + + def eql? other + self.class == other.class && + self.cores == other.cores && + self.orders == other.orders && + self.limit == other.limit && + self.lock == other.lock && + self.offset == other.offset && + self.with == other.with + end + alias :== :eql? end end end