From cdc3c246c62e65f32724d20ca7d6a29f1d08b59a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 8 Oct 2007 23:39:28 +0000 Subject: belongs_to infers the foreign key from the association name instead of from the class name. Fulfills the 1.2.4 deprecation. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 6a2887e528..2a0c4db82d 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1617,7 +1617,7 @@ module ActiveRecord klass.quote_value(reflection.options[:source_type]) ] else - second_key = source_reflection.options[:foreign_key] || klass.to_s.foreign_key + second_key = source_reflection.primary_key_name end end -- cgit v1.2.3