aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2009-05-17 16:02:10 -0400
committerBryan Helmkamp <bryan@brynary.com>2009-05-17 16:12:06 -0400
commit7a51983efc50c8f9092785b1b586f8884dedc01a (patch)
tree5b915ee48c7aa454207312ba20bb13c4dadfdf70 /lib/arel/algebra
parent07833d39c2885a5cddf38eeb860d79353c0f447b (diff)
downloadrails-7a51983efc50c8f9092785b1b586f8884dedc01a.tar.gz
rails-7a51983efc50c8f9092785b1b586f8884dedc01a.tar.bz2
rails-7a51983efc50c8f9092785b1b586f8884dedc01a.zip
initial implementation of cross-engine join
Conflicts: lib/arel/engines/memory/relations/array.rb lib/arel/engines/sql/primitives.rb
Diffstat (limited to 'lib/arel/algebra')
-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