diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-18 01:39:06 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-18 01:39:06 +0900 |
commit | 6a1a1e66ea7a917942bd8369fa8dbfedce391dab (patch) | |
tree | e3bca9f404a5a0d1dc5e3c13a49c9d4faf3ff444 /activerecord/lib/active_record | |
parent | 49bcb008cbaf0fa2db727ae58e7e27015a7ae02c (diff) | |
download | rails-6a1a1e66ea7a917942bd8369fa8dbfedce391dab.tar.gz rails-6a1a1e66ea7a917942bd8369fa8dbfedce391dab.tar.bz2 rails-6a1a1e66ea7a917942bd8369fa8dbfedce391dab.zip |
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]]
```
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/inheritance.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb index 138fd1cf53..9570bc6f86 100644 --- a/activerecord/lib/active_record/inheritance.rb +++ b/activerecord/lib/active_record/inheritance.rb @@ -249,7 +249,7 @@ module ActiveRecord sti_column = arel_attribute(inheritance_column, table) sti_names = ([self] + descendants).map(&:sti_name) - sti_column.in(sti_names) + predicate_builder.build(sti_column, sti_names) end # Detect the subclass from the inheritance column of attrs. If the inheritance column value |