aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/arel/algebra/value.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/arel/algebra/value.rb b/lib/arel/algebra/value.rb
index e363805140..d9fc2e061c 100644
--- a/lib/arel/algebra/value.rb
+++ b/lib/arel/algebra/value.rb
@@ -1,7 +1,18 @@
module Arel
class Value
- attributes :value, :relation
- deriving :initialize, :==
+ attr_reader :value, :relation
+
+ def initialize value, relation
+ @value = value
+ @relation = relation
+ end
+
+ def == other
+ super ||
+ Value === other &&
+ value == other.value &&
+ relation == other.relation
+ end
def bind(relation)
Value.new(value, relation)