diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-01 22:54:23 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-01 22:54:26 +0530 |
commit | 752813016ed227ecfbe0bf69c92de2e2c3e7a988 (patch) | |
tree | 8253ea85ddd044bfdd3107257308bfd486aa89f8 /lib/arel/algebra | |
parent | c836c3ed10110d0446c4fce87d36c3f6c39b3cda (diff) | |
download | rails-752813016ed227ecfbe0bf69c92de2e2c3e7a988.tar.gz rails-752813016ed227ecfbe0bf69c92de2e2c3e7a988.tar.bz2 rails-752813016ed227ecfbe0bf69c92de2e2c3e7a988.zip |
Add support for table aliasing
Example :
users = Table(:users, :as => :accounts)
users.to_sql
=> SELECT `accounts`.`id`, `accounts`.`name` FROM `users` AS `accounts`
Diffstat (limited to 'lib/arel/algebra')
-rw-r--r-- | lib/arel/algebra/relations/utilities/compound.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/arel/algebra/relations/utilities/compound.rb b/lib/arel/algebra/relations/utilities/compound.rb index 1acf92fef8..9eca02c8c4 100644 --- a/lib/arel/algebra/relations/utilities/compound.rb +++ b/lib/arel/algebra/relations/utilities/compound.rb @@ -2,7 +2,7 @@ module Arel class Compound < Relation attr_reader :relation delegate :joins, :join?, :inserts, :taken, :skipped, :name, :externalizable?, - :column_for, :engine, :sources, :locked, + :column_for, :engine, :sources, :locked, :table_alias, :to => :relation [:attributes, :wheres, :groupings, :orders, :havings].each do |operation_name| |