From 229c0f4367be3c766886d75b51e3c15ee8916fc2 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Sat, 18 Mar 2006 07:31:01 +0000 Subject: Rework table aliasing to account for truncated table aliases. Add smarter table aliasing when doing eager loading of STI associations. This allows you to use the association name in the order/where clause. [Jonathan Viney / Rick Olson] closes #4108 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3921 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../connection_adapters/abstract/schema_statements.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index d0b8a1ba1c..8c94f07db9 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -14,12 +14,8 @@ module ActiveRecord end # Truncates a table alias according to the limits of the current adapter. - def table_alias_for(table_name, index = 1) - if index > 1 - "#{table_name[0..table_alias_length-3]}_#{index}" - else - table_name[0..table_alias_length-1] - end + def table_alias_for(table_name) + table_name[0..table_alias_length-1] end # def tables(name = nil) end -- cgit v1.2.3