Skip to content

Commit

Permalink
Fix habtm associations when using multiple databases
Browse files Browse the repository at this point in the history
[#3128]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
sdsykes authored and jeremy committed Sep 12, 2009
1 parent 3f59a73 commit d48d3d0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def reset_column_information

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
Expand Down

0 comments on commit d48d3d0

Please sign in to comment.