Permalink
Browse files

match against bind values

  • Loading branch information...
1 parent 9c290db commit b6c7275e0cb2e58ac35f4c9fecd5236dd6ab6d81 @tenderlove tenderlove committed Jan 14, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/test/cases/adapters/postgresql/explain_test.rb
@@ -9,15 +9,15 @@ class ExplainTest < ActiveRecord::TestCase
def test_explain_for_one_query
explain = Developer.where(:id => 1).explain
- assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = 1), explain
+ assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = $1), explain
assert_match %(QUERY PLAN), explain
assert_match %(Index Scan using developers_pkey on developers), explain
end
def test_explain_with_eager_loading
explain = Developer.where(:id => 1).includes(:audit_logs).explain
assert_match %(QUERY PLAN), explain
- assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = 1), explain
+ assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = $1), explain
assert_match %(Index Scan using developers_pkey on developers), explain
assert_match %(EXPLAIN for: SELECT "audit_logs".* FROM "audit_logs" WHERE "audit_logs"."developer_id" IN (1)), explain
assert_match %(Seq Scan on audit_logs), explain

0 comments on commit b6c7275

Please sign in to comment.