1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Ryuta Kamizono 2017-01-15 01:02:40 +09:00
parent 07307a7b9d
commit 57c44f0d09

View file

@ -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