aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2018-04-02 16:29:03 +0200
committerGitHub <noreply@github.com>2018-04-02 16:29:03 +0200
commitc9ad88fed18070fea1215e718c526c73b9a1cae2 (patch)
tree1e3b0b8d8553e61f40a9d436fb87d0d6f784a274 /activerecord/lib/active_record/attribute_methods
parent0ec23effa74e8e9da6ebb14afbd335bea470ab3e (diff)
parent0d9f45ff99c092cce6b7642f653b8fdf9f930f0c (diff)
downloadrails-c9ad88fed18070fea1215e718c526c73b9a1cae2.tar.gz
rails-c9ad88fed18070fea1215e718c526c73b9a1cae2.tar.bz2
rails-c9ad88fed18070fea1215e718c526c73b9a1cae2.zip
Merge pull request #32417 from bogdan/base-class
Add AR::Base.base_class? predicate
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r--activerecord/lib/active_record/attribute_methods/primary_key.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb
index 2907547634..9b267bb7c0 100644
--- a/activerecord/lib/active_record/attribute_methods/primary_key.rb
+++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb
@@ -83,7 +83,7 @@ module ActiveRecord
end
def reset_primary_key #:nodoc:
- if self == base_class
+ if base_class?
self.primary_key = get_primary_key(base_class.name)
else
self.primary_key = base_class.primary_key