diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 11:50:16 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 11:50:16 -0800 |
commit | b8d57a0400f95abe1b87634e9cada8868ff0a22e (patch) | |
tree | 7d3b700b4cdc5dac0c58078a055bec07c7ef46e2 /activerecord/lib/active_record/associations/class_methods/join_dependency.rb | |
parent | f4223cc7abeeae5f4849eab27951faa55f3c6996 (diff) | |
download | rails-b8d57a0400f95abe1b87634e9cada8868ff0a22e.tar.gz rails-b8d57a0400f95abe1b87634e9cada8868ff0a22e.tar.bz2 rails-b8d57a0400f95abe1b87634e9cada8868ff0a22e.zip |
have table_aliases call count_aliases to set the default value
Diffstat (limited to 'activerecord/lib/active_record/associations/class_methods/join_dependency.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/class_methods/join_dependency.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency.rb index d508c3b7aa..13576e1aec 100644 --- a/activerecord/lib/active_record/associations/class_methods/join_dependency.rb +++ b/activerecord/lib/active_record/associations/class_methods/join_dependency.rb @@ -14,7 +14,9 @@ module ActiveRecord @join_parts = [JoinBase.new(base)] @associations = {} @reflections = [] - @table_aliases = Hash.new(0) + @table_aliases = Hash.new do |h,name| + h[name] = count_aliases_from_table_joins(name) + end @table_aliases[base.table_name] = 1 build(associations) end |