diff options
author | sdsykes <sdsykes@gmail.com> | 2009-09-11 12:53:57 +0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-09-12 02:57:29 -0700 |
commit | 3180619c0d228812c119e9704ac5956cbcad8614 (patch) | |
tree | 7433f0ca9f81131f27aa82bf236834bf539022bb /activerecord/lib | |
parent | 8682d76cc988715fdea11e2c88fa2b56ae2b4709 (diff) | |
download | rails-3180619c0d228812c119e9704ac5956cbcad8614.tar.gz rails-3180619c0d228812c119e9704ac5956cbcad8614.tar.bz2 rails-3180619c0d228812c119e9704ac5956cbcad8614.zip |
Fix habtm associations when using multiple databases
[#3128]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb index d91c555dad..417e2fdc0f 100644 --- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb @@ -24,8 +24,8 @@ module ActiveRecord def has_primary_key? return @has_primary_key unless @has_primary_key.nil? - @has_primary_key = (ActiveRecord::Base.connection.supports_primary_key? && - ActiveRecord::Base.connection.primary_key(@reflection.options[:join_table])) + @has_primary_key = (@owner.connection.supports_primary_key? && + @owner.connection.primary_key(@reflection.options[:join_table])) end protected |