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.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/arel/algebra/relations/row.rb b/lib/arel/algebra/relations/row.rb
index 3731dd9696..e8484944bd 100644
--- a/lib/arel/algebra/relations/row.rb
+++ b/lib/arel/algebra/relations/row.rb
@@ -4,12 +4,13 @@ module Arel
deriving :==, :initialize
def [](attribute)
- tuple[relation.position_of(attribute)]
+ attribute.type_cast(tuple[relation.position_of(attribute)])
end
def slice(*attributes)
Row.new(relation, attributes.inject([]) do |cheese, attribute|
- cheese << self[attribute]
+ # FIXME TESTME method chaining
+ cheese << tuple[relation.relation.position_of(attribute)]
cheese
end)
end