aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/association_scope.rb
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2014-12-16 14:26:45 -0500
committereileencodes <eileencodes@gmail.com>2015-01-02 17:15:31 -0500
commit0408e212ca224bb25159f3e6db2a9c64cdea1200 (patch)
treebb8f8d8e8ffe8afb9f164398e4556f849f270560 /activerecord/lib/active_record/associations/association_scope.rb
parent16fafd658805407e2bda4f4bb06a70157c21f78a (diff)
downloadrails-0408e212ca224bb25159f3e6db2a9c64cdea1200.tar.gz
rails-0408e212ca224bb25159f3e6db2a9c64cdea1200.tar.bz2
rails-0408e212ca224bb25159f3e6db2a9c64cdea1200.zip
Initialze `#alias_tracker` with base table name
Instead of initializing an empty connection use the base table name instead. Split up and refactor `#create` to be 2 methods `#create` and `#create_with_joins`. Removes the need to update the count by 1 on initialzing a JoinDependency.
Diffstat (limited to 'activerecord/lib/active_record/associations/association_scope.rb')
-rw-r--r--activerecord/lib/active_record/associations/association_scope.rb1
1 files changed, 0 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb
index 9d94822fc5..1f77a083aa 100644
--- a/activerecord/lib/active_record/associations/association_scope.rb
+++ b/activerecord/lib/active_record/associations/association_scope.rb
@@ -126,7 +126,6 @@ module ActiveRecord
def get_chain(refl, association, tracker)
name = refl.name
runtime_reflection = ActiveRecord::Reflection::RuntimeReflection.new(refl, association)
- alias_name = tracker.aliased_table_for(runtime_reflection.table_name, runtime_reflection.alias_candidate(name))
prev = runtime_reflection
refl.chain.drop(1).each { |reflection|
alias_name = tracker.aliased_table_for(reflection.table_name, reflection.alias_candidate(name))