Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added option :schema_order to the PostgreSQL adapter to support the u…

…se of multiple schemas per database #697 [YuriSchimke]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@755 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit c699a3e98596df2d41d7cda77ae28f7c534a80fe 1 parent df99b68
@dhh dhh authored
View
8 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -24,15 +24,21 @@ def self.postgresql_connection(config) # :nodoc:
username = config[:username].to_s
password = config[:password].to_s
+ schema_order = config[:schema_order]
+
if config.has_key?(:database)
database = config[:database]
else
raise ArgumentError, "No database specified. Missing argument: database."
end
- ConnectionAdapters::PostgreSQLAdapter.new(
+ pga = ConnectionAdapters::PostgreSQLAdapter.new(
PGconn.connect(host, port, "", "", database, username, password), logger
)
+
+ pga.execute("SET search_path TO #{schema_order}") if schema_order
+
+ pga
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.