Skip to content

Commit

Permalink
Merge pull request #27680 from kamipo/fix_scope_for_create
Browse files Browse the repository at this point in the history
`type_condition` should be overwritten by `create_with_value` in `scope_for_create`
  • Loading branch information
kaspth committed Jan 14, 2017
2 parents 07307a7 + 57c44f0 commit c0c331b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/core.rb
Expand Up @@ -308,7 +308,7 @@ def relation
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
Expand Down

0 comments on commit c0c331b

Please sign in to comment.