aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/row.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/algebra/relations/row.rb')
-rw-r--r--lib/arel/algebra/relations/row.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/arel/algebra/relations/row.rb b/lib/arel/algebra/relations/row.rb
index 3158557448..f5fe364b83 100644
--- a/lib/arel/algebra/relations/row.rb
+++ b/lib/arel/algebra/relations/row.rb
@@ -1,7 +1,18 @@
module Arel
class Row
- attributes :relation, :tuple
- deriving :==, :initialize
+ attr_reader :tuple, :relation
+
+ def initialize relation, tuple
+ @relation = relation
+ @tuple = tuple
+ end
+
+ def == other
+ super ||
+ Row === other &&
+ relation == other.relation &&
+ tuple == other.tuple
+ end
def [](attribute)
attribute.type_cast(tuple[relation.position_of(attribute)])