aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/join_dependency.rb
diff options
context:
space:
mode:
authorLars Kanis <kanis@comcard.de>2011-11-22 10:43:03 +0100
committerPiotr Sarnacki <drogus@gmail.com>2012-03-04 16:16:07 +0100
commitf6d478adcd3d2b28760e6e8b7ca5c1fd8abbc8a0 (patch)
treea034339e2099c1ae99ef5128b144c5bf19e30236 /activerecord/lib/active_record/associations/join_dependency.rb
parent23ca13a8774ca01ae702f6175508533f4e9dd924 (diff)
downloadrails-f6d478adcd3d2b28760e6e8b7ca5c1fd8abbc8a0.tar.gz
rails-f6d478adcd3d2b28760e6e8b7ca5c1fd8abbc8a0.tar.bz2
rails-f6d478adcd3d2b28760e6e8b7ca5c1fd8abbc8a0.zip
fix associations when using per class databases
would get ConnectionNotEstablished error because it always tried to use ActiveRecord::Base's connection, even though it should be using the connection of the model whose context we're operating in
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency.rb')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index 827b01c5ac..cd366ac8b7 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -13,7 +13,7 @@ module ActiveRecord
@join_parts = [JoinBase.new(base)]
@associations = {}
@reflections = []
- @alias_tracker = AliasTracker.new(joins)
+ @alias_tracker = AliasTracker.new(base.connection, joins)
@alias_tracker.aliased_name_for(base.table_name) # Updates the count for base.table_name to 1
build(associations)
end