From 752813016ed227ecfbe0bf69c92de2e2c3e7a988 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Fri, 1 Jan 2010 22:54:23 +0530 Subject: Add support for table aliasing Example : users = Table(:users, :as => :accounts) users.to_sql => SELECT `accounts`.`id`, `accounts`.`name` FROM `users` AS `accounts` --- lib/arel/algebra/relations/utilities/compound.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/arel/algebra') 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| -- cgit v1.2.3