aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-02-28 03:07:56 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-03-04 02:34:00 +0900
commitd35875b7a3f559155a9378cbe9203b0b8ea580f9 (patch)
treee8d8c225cf2309976327a94370f09f901023a9b1 /activerecord/lib/active_record/reflection.rb
parent75a24602edacd3e66b5c38c2b5efe885dfdd14ab (diff)
downloadrails-d35875b7a3f559155a9378cbe9203b0b8ea580f9.tar.gz
rails-d35875b7a3f559155a9378cbe9203b0b8ea580f9.tar.bz2
rails-d35875b7a3f559155a9378cbe9203b0b8ea580f9.zip
Extract all `base_class.name` as `polymorphic_name`
This is an alternative of #29722, and follow up of #32048. This does not change the current behavior, but makes it easier to modify all polymorphic names consistently.
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 42b451241d..2f43d005f3 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -193,7 +193,7 @@ module ActiveRecord
klass_scope = klass_join_scope(table, predicate_builder)
if type
- klass_scope.where!(type => foreign_klass.base_class.name)
+ klass_scope.where!(type => foreign_klass.polymorphic_name)
end
scope_chain_items.inject(klass_scope, &:merge!)