mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use placeholder for type_condition
predicate
Before: ``` SELECT "comments".* FROM "comments" WHERE "comments"."type" IN ('VerySpecialComment') AND "comments"."post_id" = ? LIMIT ? [["post_id", 4], ["LIMIT", 1]] ``` After: ``` SELECT "comments".* FROM "comments" WHERE "comments"."type" = ? AND "comments"."post_id" = ? LIMIT ? [["type", "VerySpecialComment"], ["post_id", 4], ["LIMIT", 1]] ```
This commit is contained in:
parent
49bcb008cb
commit
6a1a1e66ea
1 changed files with 1 additions and 1 deletions
|
@ -249,7 +249,7 @@ module ActiveRecord
|
||||||
sti_column = arel_attribute(inheritance_column, table)
|
sti_column = arel_attribute(inheritance_column, table)
|
||||||
sti_names = ([self] + descendants).map(&:sti_name)
|
sti_names = ([self] + descendants).map(&:sti_name)
|
||||||
|
|
||||||
sti_column.in(sti_names)
|
predicate_builder.build(sti_column, sti_names)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Detect the subclass from the inheritance column of attrs. If the inheritance column value
|
# Detect the subclass from the inheritance column of attrs. If the inheritance column value
|
||||||
|
|
Loading…
Reference in a new issue