aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-01-15 01:02:40 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-01-15 01:09:51 +0900
commit57c44f0d09f256c7ebbbf54761ce8f70ce7c93db (patch)
tree1aeb5d5e4f5727e92ef44d51d4e06872c3b6afaf /activerecord
parent07307a7b9d14b752fc5aef474f3c29585676c9fa (diff)
downloadrails-57c44f0d09f256c7ebbbf54761ce8f70ce7c93db.tar.gz
rails-57c44f0d09f256c7ebbbf54761ce8f70ce7c93db.tar.bz2
rails-57c44f0d09f256c7ebbbf54761ce8f70ce7c93db.zip
`type_condition` should be overwritten by `create_with_value` in `scope_for_create`
`type_condition` should be overwritten by `create_with_value`. So `type` in `create_with_value` should be a string because `where_values_hash` keys are converted to string. Fixes #27600.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/core.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index 4d30bdf196..0028dc0edb 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -308,7 +308,7 @@ module ActiveRecord
relation = Relation.create(self, arel_table, predicate_builder)
if finder_needs_type_condition? && !ignore_default_scope?
- relation.where(type_condition).create_with(inheritance_column.to_sym => sti_name)
+ relation.where(type_condition).create_with(inheritance_column.to_s => sti_name)
else
relation
end