From 7286f0f4c8117e2210834070d30378ffb12dba23 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 12 Jan 2010 21:40:38 +0530 Subject: Make sure not to use alias if it's same as the table name --- lib/arel/engines/sql/relations/table.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/arel/engines/sql/relations/table.rb b/lib/arel/engines/sql/relations/table.rb index 6ad294dc6c..0634436280 100644 --- a/lib/arel/engines/sql/relations/table.rb +++ b/lib/arel/engines/sql/relations/table.rb @@ -11,7 +11,7 @@ module Arel if options.is_a?(Hash) @options = options @engine = options[:engine] || Table.engine - @table_alias = options[:as].to_s if options[:as].present? + @table_alias = options[:as].to_s if options[:as].present? && options[:as].to_s != @name else @engine = options # Table.new('foo', engine) end -- cgit v1.2.3