diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-01 21:23:55 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-01 21:23:55 -0700 |
commit | 6c61ebb4d677f9bc5e1a669e7351c1226cbc9582 (patch) | |
tree | e55074078699abbf4cb3d9ecb6259702749ed1d5 /spec/arel | |
parent | 3c52d91b5dc8b582e03d9ad84e3b97a85273110e (diff) | |
download | rails-6c61ebb4d677f9bc5e1a669e7351c1226cbc9582.tar.gz rails-6c61ebb4d677f9bc5e1a669e7351c1226cbc9582.tar.bz2 rails-6c61ebb4d677f9bc5e1a669e7351c1226cbc9582.zip |
naming of aliased relations seemed to be solved; now aggregate relations are still broken
Diffstat (limited to 'spec/arel')
-rw-r--r-- | spec/arel/unit/relations/join_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/arel/unit/relations/join_spec.rb b/spec/arel/unit/relations/join_spec.rb index f74bd32ef8..c08ff68f36 100644 --- a/spec/arel/unit/relations/join_spec.rb +++ b/spec/arel/unit/relations/join_spec.rb @@ -146,16 +146,18 @@ module Arel describe 'when joining the same relation to itself' do describe '#to_sql' do it '' do + relation2 = @relation1.alias + relation3 = @relation1.alias @relation1 \ - .join(@relation1.alias.join(@relation1.alias).on(@relation1[:id].eq(1))) \ - .on(@relation1[:id].eq(1)) \ + .join(relation2.join(relation3).on(relation2[:id].eq(relation3[:id]))) \ + .on(@relation1[:id].eq(relation2[:id])) \ .to_sql.should be_like(" SELECT `users`.`id`, `users`.`name`, `users_2`.`id`, `users_2`.`name`, `users_3`.`id`, `users_3`.`name` FROM `users` INNER JOIN `users` AS `users_2` - ON `users`.`id` = 1 + ON `users_2`.`id` = `users_3`.`id` INNER JOIN `users` AS `users_3` - ON `users`.`id` = 1 + ON `users_2`.`id` = `users_3`.`id` ") end |