diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-05 11:22:48 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-05 11:22:48 -0700 |
commit | b9e90e4e55290172d7c5918319fd5fe35aa6a10e (patch) | |
tree | ef63a7974dd97012fc72dc3d33ec25f0884620e7 /spec/arel/unit/relations | |
parent | cd428ee66498146d3dc14f58c6534d79ab124b45 (diff) | |
download | rails-b9e90e4e55290172d7c5918319fd5fe35aa6a10e.tar.gz rails-b9e90e4e55290172d7c5918319fd5fe35aa6a10e.tar.bz2 rails-b9e90e4e55290172d7c5918319fd5fe35aa6a10e.zip |
better column disambiguation
Diffstat (limited to 'spec/arel/unit/relations')
-rw-r--r-- | spec/arel/unit/relations/join_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/arel/unit/relations/join_spec.rb b/spec/arel/unit/relations/join_spec.rb index d517da8c1f..a538c8af68 100644 --- a/spec/arel/unit/relations/join_spec.rb +++ b/spec/arel/unit/relations/join_spec.rb @@ -203,6 +203,23 @@ module Arel end end end + + describe 'something really really complex' do + it '' do + users = @relation1 + photos = @relation2 + users_2 = users.alias + photos_2 = photos.alias + r = users \ + .join(photos) \ + .on(photos[:user_id].eq users[:id]) \ + .join(users_2) \ + .on(users_2[:id].eq photos[:user_id]) \ + .join(photos_2) \ + .on(users_2[:id].eq photos_2[:user_id]) + r.relation_for(photos[:user_id]).should == photos + end + end describe '[]' do describe 'when given an attribute belonging to both sub-relations' do |