diff options
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 62184eeff2..3d76ffe776 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -207,7 +207,7 @@ module ActiveRecord def derive_primary_key_name if macro == :belongs_to - class_name.foreign_key + "#{name}_id" elsif options[:as] "#{options[:as]}_id" else |