diff options
Diffstat (limited to 'lib/arel/nodes/bind_param.rb')
-rw-r--r-- | lib/arel/nodes/bind_param.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/arel/nodes/bind_param.rb b/lib/arel/nodes/bind_param.rb index 9e297831cd..efa4f452d4 100644 --- a/lib/arel/nodes/bind_param.rb +++ b/lib/arel/nodes/bind_param.rb @@ -2,8 +2,25 @@ module Arel module Nodes class BindParam < Node - def ==(other) - other.is_a?(BindParam) + attr_accessor :value + + def initialize(value) + @value = value + super() + end + + def hash + [self.class, self.value].hash + end + + def eql?(other) + other.is_a?(BindParam) && + value == other.value + end + alias :== :eql? + + def nil? + value.nil? end end end |