diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-03-01 12:51:44 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-03-01 12:51:44 -0300 |
commit | 1994d3e61dd841ad1367922c5c608c9f5f277161 (patch) | |
tree | bd99d1f86aba5094871507fb20b4beefdcf5e741 /spec | |
parent | 52b9eb1d8dea2615a8ff6182278dc53e1cf33c1d (diff) | |
download | rails-1994d3e61dd841ad1367922c5c608c9f5f277161.tar.gz rails-1994d3e61dd841ad1367922c5c608c9f5f277161.tar.bz2 rails-1994d3e61dd841ad1367922c5c608c9f5f277161.zip |
Remove " AS " keyword from table aliasing.
Diffstat (limited to 'spec')
4 files changed, 36 insertions, 36 deletions
diff --git a/spec/arel/engines/sql/integration/joins/with_adjacency_spec.rb b/spec/arel/engines/sql/integration/joins/with_adjacency_spec.rb index 47d37415ae..1a0e28838d 100644 --- a/spec/arel/engines/sql/integration/joins/with_adjacency_spec.rb +++ b/spec/arel/engines/sql/integration/joins/with_adjacency_spec.rb @@ -17,7 +17,7 @@ module Arel sql.should be_like(%Q{ SELECT `users`.`id`, `users`.`name`, `users_2`.`id`, `users_2`.`name` FROM `users` - INNER JOIN `users` AS `users_2` + INNER JOIN `users` `users_2` ON `users`.`id` = `users_2`.`id` }) end @@ -35,7 +35,7 @@ module Arel sql.should be_like(%Q{ SELECT "users"."id", "users"."name", "users_2"."id", "users_2"."name" FROM "users" - INNER JOIN "users" AS "users_2" + INNER JOIN "users" "users_2" ON "users"."id" = "users_2"."id" }) end @@ -52,7 +52,7 @@ module Arel sql.should be_like(%Q{ SELECT `users`.`id`, `users`.`name`, `users_2`.`id`, `users_2`.`name` FROM `users` - INNER JOIN `users` AS `users_2` + INNER JOIN `users` `users_2` ON `users`.`id` = `users_2`.`id` AND `users_2`.`id` = 1 }) end @@ -70,7 +70,7 @@ module Arel sql.should be_like(%Q{ SELECT "users"."id", "users"."name", "users_2"."id", "users_2"."name" FROM "users" - INNER JOIN "users" AS "users_2" + INNER JOIN "users" "users_2" ON "users"."id" = "users_2"."id" AND "users_2"."id" = 1 }) end @@ -89,7 +89,7 @@ module Arel sql.should be_like(%Q{ SELECT `users`.`id`, `users`.`name`, `users_2`.`id`, `users_2`.`name` FROM `users` - INNER JOIN `users` AS `users_2` + INNER JOIN `users` `users_2` ON `users_2`.`id` = `users`.`id` AND `users_2`.`id` = 1 }) end @@ -107,7 +107,7 @@ module Arel sql.should be_like(%Q{ SELECT "users"."id", "users"."name", "users_2"."id", "users_2"."name" FROM "users" - INNER JOIN "users" AS "users_2" + INNER JOIN "users" "users_2" ON "users_2"."id" = "users"."id" AND "users_2"."id" = 1 }) end @@ -133,9 +133,9 @@ module Arel sql.should be_like(%Q{ 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` + INNER JOIN `users` `users_2` ON `users`.`id` = `users_2`.`id` - INNER JOIN `users` AS `users_3` + INNER JOIN `users` `users_3` ON `users_2`.`id` = `users_3`.`id` }) end @@ -155,9 +155,9 @@ module Arel sql.should be_like(%Q{ 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" + INNER JOIN "users" "users_2" ON "users"."id" = "users_2"."id" - INNER JOIN "users" AS "users_3" + INNER JOIN "users" "users_3" ON "users_2"."id" = "users_3"."id" }) end @@ -175,9 +175,9 @@ module Arel sql.should be_like(%Q{ 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` + INNER JOIN `users` `users_2` ON `users`.`id` = `users_2`.`id` - INNER JOIN `users` AS `users_3` + INNER JOIN `users` `users_3` ON `users_2`.`id` = `users_3`.`id` }) end @@ -197,9 +197,9 @@ module Arel sql.should be_like(%Q{ 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" + INNER JOIN "users" "users_2" ON "users"."id" = "users_2"."id" - INNER JOIN "users" AS "users_3" + INNER JOIN "users" "users_3" ON "users_2"."id" = "users_3"."id" }) end diff --git a/spec/arel/engines/sql/integration/joins/with_aggregations_spec.rb b/spec/arel/engines/sql/integration/joins/with_aggregations_spec.rb index 1ed056ca59..62e1b8baea 100644 --- a/spec/arel/engines/sql/integration/joins/with_aggregations_spec.rb +++ b/spec/arel/engines/sql/integration/joins/with_aggregations_spec.rb @@ -24,7 +24,7 @@ module Arel sql.should be_like(%Q{ SELECT `users`.`id`, `users`.`name`, `photos_external`.`id`, `photos_external`.`user_id`, `photos_external`.`camera_id` FROM `users` - INNER JOIN (SELECT `photos`.`id`, `photos`.`user_id`, `photos`.`camera_id` FROM `photos` LIMIT 3) AS `photos_external` + INNER JOIN (SELECT `photos`.`id`, `photos`.`user_id`, `photos`.`camera_id` FROM `photos` LIMIT 3) `photos_external` ON `users`.`id` = `photos_external`.`user_id` }) end @@ -42,7 +42,7 @@ module Arel sql.should be_like(%Q{ SELECT "users"."id", "users"."name", "photos_external"."id", "photos_external"."user_id", "photos_external"."camera_id" FROM "users" - INNER JOIN (SELECT "photos"."id", "photos"."user_id", "photos"."camera_id" FROM "photos" LIMIT 3) AS "photos_external" + INNER JOIN (SELECT "photos"."id", "photos"."user_id", "photos"."camera_id" FROM "photos" LIMIT 3) "photos_external" ON "users"."id" = "photos_external"."user_id" }) end @@ -56,7 +56,7 @@ module Arel sql.should be_like(%Q{ SELECT `users`.`id`, `users`.`name`, `photos_external`.`user_id`, `photos_external`.`cnt` FROM `users` - INNER JOIN (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) AS `photos_external` + INNER JOIN (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) `photos_external` ON `users`.`id` = `photos_external`.`user_id` }) end @@ -74,7 +74,7 @@ module Arel sql.should be_like(%Q{ SELECT "users"."id", "users"."name", "photos_external"."user_id", "photos_external"."cnt" FROM "users" - INNER JOIN (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") AS "photos_external" + INNER JOIN (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") "photos_external" ON "users"."id" = "photos_external"."user_id" }) end @@ -88,7 +88,7 @@ module Arel adapter_is :mysql do sql.should be_like(%Q{ SELECT `photos_external`.`user_id`, `photos_external`.`cnt`, `users`.`id`, `users`.`name` - FROM (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) AS `photos_external` + FROM (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) `photos_external` INNER JOIN `users` ON `users`.`id` = `photos_external`.`user_id` }) @@ -106,7 +106,7 @@ module Arel adapter_is_not :mysql, :oracle do sql.should be_like(%Q{ SELECT "photos_external"."user_id", "photos_external"."cnt", "users"."id", "users"."name" - FROM (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") AS "photos_external" + FROM (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") "photos_external" INNER JOIN "users" ON "users"."id" = "photos_external"."user_id" }) @@ -122,8 +122,8 @@ module Arel adapter_is :mysql do sql.should be_like(%Q{ SELECT `photos_external`.`user_id`, `photos_external`.`cnt`, `photos_external_2`.`user_id`, `photos_external_2`.`cnt` - FROM (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) AS `photos_external` - INNER JOIN (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) AS `photos_external_2` + FROM (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) `photos_external` + INNER JOIN (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` GROUP BY `photos`.`user_id`) `photos_external_2` ON `photos_external_2`.`user_id` = `photos_external`.`user_id` }) end @@ -140,8 +140,8 @@ module Arel adapter_is_not :mysql, :oracle do sql.should be_like(%Q{ SELECT "photos_external"."user_id", "photos_external"."cnt", "photos_external_2"."user_id", "photos_external_2"."cnt" - FROM (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") AS "photos_external" - INNER JOIN (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") AS "photos_external_2" + FROM (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") "photos_external" + INNER JOIN (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" GROUP BY "photos"."user_id") "photos_external_2" ON "photos_external_2"."user_id" = "photos_external"."user_id" }) end @@ -157,7 +157,7 @@ module Arel sql.should be_like(%Q{ SELECT `users`.`id`, `users`.`name`, `photos_external`.`user_id`, `photos_external`.`cnt` FROM `users` - INNER JOIN (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` WHERE `photos`.`user_id` = 1 GROUP BY `photos`.`user_id`) AS `photos_external` + INNER JOIN (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` WHERE `photos`.`user_id` = 1 GROUP BY `photos`.`user_id`) `photos_external` ON `users`.`id` = `photos_external`.`user_id` }) end @@ -175,7 +175,7 @@ module Arel sql.should be_like(%Q{ SELECT "users"."id", "users"."name", "photos_external"."user_id", "photos_external"."cnt" FROM "users" - INNER JOIN (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" WHERE "photos"."user_id" = 1 GROUP BY "photos"."user_id") AS "photos_external" + INNER JOIN (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" WHERE "photos"."user_id" = 1 GROUP BY "photos"."user_id") "photos_external" ON "users"."id" = "photos_external"."user_id" }) end @@ -189,7 +189,7 @@ module Arel adapter_is :mysql do sql.should be_like(%Q{ SELECT `photos_external`.`user_id`, `photos_external`.`cnt`, `users`.`id`, `users`.`name` - FROM (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` WHERE `photos`.`user_id` = 1 GROUP BY `photos`.`user_id`) AS `photos_external` + FROM (SELECT `photos`.`user_id`, COUNT(`photos`.`id`) AS `cnt` FROM `photos` WHERE `photos`.`user_id` = 1 GROUP BY `photos`.`user_id`) `photos_external` INNER JOIN `users` ON `users`.`id` = `photos_external`.`user_id` }) @@ -207,7 +207,7 @@ module Arel adapter_is_not :mysql, :oracle do sql.should be_like(%Q{ SELECT "photos_external"."user_id", "photos_external"."cnt", "users"."id", "users"."name" - FROM (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" WHERE "photos"."user_id" = 1 GROUP BY "photos"."user_id") AS "photos_external" + FROM (SELECT "photos"."user_id", COUNT("photos"."id") AS "cnt" FROM "photos" WHERE "photos"."user_id" = 1 GROUP BY "photos"."user_id") "photos_external" INNER JOIN "users" ON "users"."id" = "photos_external"."user_id" }) diff --git a/spec/arel/engines/sql/unit/relations/join_spec.rb b/spec/arel/engines/sql/unit/relations/join_spec.rb index 2d23a06397..cbbcb18244 100644 --- a/spec/arel/engines/sql/unit/relations/join_spec.rb +++ b/spec/arel/engines/sql/unit/relations/join_spec.rb @@ -52,7 +52,7 @@ module Arel adapter_is :mysql do sql.should be_like(%Q{ SELECT `super_users`.`id`, `super_users`.`name`, `photos`.`id`, `photos`.`user_id`, `photos`.`camera_id` - FROM `users` AS `super_users` + FROM `users` `super_users` INNER JOIN `photos` ON `super_users`.`id` = `photos`.`user_id` }) end @@ -68,7 +68,7 @@ module Arel adapter_is_not :mysql, :oracle do sql.should be_like(%Q{ SELECT "super_users"."id", "super_users"."name", "photos"."id", "photos"."user_id", "photos"."camera_id" - FROM "users" AS "super_users" + FROM "users" "super_users" INNER JOIN "photos" ON "super_users"."id" = "photos"."user_id" }) end @@ -82,8 +82,8 @@ module Arel adapter_is :mysql do sql.should be_like(%Q{ SELECT `super_users`.`id`, `super_users`.`name`, `super_photos`.`id`, `super_photos`.`user_id`, `super_photos`.`camera_id` - FROM `users` AS `super_users` - INNER JOIN `photos` AS `super_photos` ON `super_users`.`id` = `super_photos`.`user_id` + FROM `users` `super_users` + INNER JOIN `photos` `super_photos` ON `super_users`.`id` = `super_photos`.`user_id` }) end @@ -98,8 +98,8 @@ module Arel adapter_is_not :mysql, :oracle do sql.should be_like(%Q{ SELECT "super_users"."id", "super_users"."name", "super_photos"."id", "super_photos"."user_id", "super_photos"."camera_id" - FROM "users" AS "super_users" - INNER JOIN "photos" AS "super_photos" ON "super_users"."id" = "super_photos"."user_id" + FROM "users" "super_users" + INNER JOIN "photos" "super_photos" ON "super_users"."id" = "super_photos"."user_id" }) end end diff --git a/spec/arel/engines/sql/unit/relations/table_spec.rb b/spec/arel/engines/sql/unit/relations/table_spec.rb index e497e1b6c2..6afd9964a4 100644 --- a/spec/arel/engines/sql/unit/relations/table_spec.rb +++ b/spec/arel/engines/sql/unit/relations/table_spec.rb @@ -40,7 +40,7 @@ module Arel adapter_is :mysql do sql.should be_like(%Q{ SELECT `super_users`.`id`, `super_users`.`name` - FROM `users` AS `super_users` + FROM `users` `super_users` }) end @@ -54,7 +54,7 @@ module Arel adapter_is_not :mysql, :oracle do sql.should be_like(%Q{ SELECT "super_users"."id", "super_users"."name" - FROM "users" AS "super_users" + FROM "users" "super_users" }) end end |