From b98668decb9712f26118de57623fd15d7d28646d Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Fri, 26 Dec 2014 16:10:47 -0700 Subject: Go through normal `where` logic when preloading associations This will allow eager type casting to take place as needed. There doesn't seem to be any particular reason that the `in` statement was forced for single values, and the commit message where it was introduced gives no context. See https://github.com/rails/rails/commit/d90b4e2615e8048fdeffc6dffe3246704adee01f --- activerecord/test/cases/adapters/mysql2/explain_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/cases/adapters/mysql2/explain_test.rb') diff --git a/activerecord/test/cases/adapters/mysql2/explain_test.rb b/activerecord/test/cases/adapters/mysql2/explain_test.rb index f67f21fab1..2b01d941b8 100644 --- a/activerecord/test/cases/adapters/mysql2/explain_test.rb +++ b/activerecord/test/cases/adapters/mysql2/explain_test.rb @@ -18,7 +18,7 @@ module ActiveRecord explain = Developer.where(:id => 1).includes(:audit_logs).explain assert_match %(EXPLAIN for: SELECT `developers`.* FROM `developers` WHERE `developers`.`id` = 1), explain assert_match %r(developers |.* const), explain - assert_match %(EXPLAIN for: SELECT `audit_logs`.* FROM `audit_logs` WHERE `audit_logs`.`developer_id` IN (1)), explain + assert_match %(EXPLAIN for: SELECT `audit_logs`.* FROM `audit_logs` WHERE `audit_logs`.`developer_id` = 1), explain assert_match %r(audit_logs |.* ALL), explain end end -- cgit v1.2.3