aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/reflection.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index bc5824104e..937efe395f 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/class/attribute'
+require 'active_support/core_ext/module/deprecation'
module ActiveRecord
# = Active Record Reflection
@@ -200,6 +201,11 @@ module ActiveRecord
@foreign_key ||= options[:foreign_key] || derive_foreign_key
end
+ def primary_key_name
+ foreign_key
+ end
+ deprecate :primary_key_name => :foreign_key
+
def foreign_type
@foreign_type ||= options[:foreign_type] || "#{name}_type"
end