Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5437 from kennyj/fix_5430

Fix GH #5430. A Payload name for schema_search_path should be SCHEMA.
  • Loading branch information...
commit f961ec41d2813ebbd26b9021f3cf64038e15991d 2 parents 8f5f92c + 2d787f8
@tenderlove tenderlove authored
View
2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -1006,7 +1006,7 @@ def drop_schema schema_name
# This should be not be called manually but set in database.yml.
def schema_search_path=(schema_csv)
if schema_csv
- execute "SET search_path TO #{schema_csv}"
+ execute("SET search_path TO #{schema_csv}", 'SCHEMA')
@schema_search_path = schema_csv
end
end
View
7 activerecord/test/cases/adapters/postgresql/explain_test.rb
@@ -22,6 +22,13 @@ def test_explain_with_eager_loading
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
end
+
+ def test_dont_explain_for_set_search_path
+ queries = Thread.current[:available_queries_for_explain] = []
+ ActiveRecord::Base.connection.schema_search_path = "public"
+ assert queries.empty?
+ end
+
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.