aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-03-18 07:31:01 +0000
committerRick Olson <technoweenie@gmail.com>2006-03-18 07:31:01 +0000
commit229c0f4367be3c766886d75b51e3c15ee8916fc2 (patch)
tree47bcb766fefb4f808406f1ec8a1b52eb345b06b6 /activerecord/lib/active_record/connection_adapters/abstract
parentf1a350a05c97d6e54e6dde26c101e8035d55e40c (diff)
downloadrails-229c0f4367be3c766886d75b51e3c15ee8916fc2.tar.gz
rails-229c0f4367be3c766886d75b51e3c15ee8916fc2.tar.bz2
rails-229c0f4367be3c766886d75b51e3c15ee8916fc2.zip
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
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb8
1 files changed, 2 insertions, 6 deletions
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