File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
lib/active_record/connection_adapters
test/cases/adapters/postgresql Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1006,7 +1006,7 @@ def drop_schema schema_name
1006
1006
# This should be not be called manually but set in database.yml.
1007
1007
def schema_search_path = ( schema_csv )
1008
1008
if schema_csv
1009
- execute "SET search_path TO #{ schema_csv } "
1009
+ execute ( "SET search_path TO #{ schema_csv } " , 'SCHEMA' )
1010
1010
@schema_search_path = schema_csv
1011
1011
end
1012
1012
end
Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ def test_explain_with_eager_loading
22
22
assert_match %(EXPLAIN for: SELECT "audit_logs".* FROM "audit_logs" WHERE "audit_logs"."developer_id" IN (1)) , explain
23
23
assert_match %(Seq Scan on audit_logs) , explain
24
24
end
25
+
26
+ def test_dont_explain_for_set_search_path
27
+ queries = Thread . current [ :available_queries_for_explain ] = [ ]
28
+ ActiveRecord ::Base . connection . schema_search_path = "public"
29
+ assert queries . empty?
30
+ end
31
+
25
32
end
26
33
end
27
34
end
You can’t perform that action at this time.
0 commit comments