Permalink
Browse files

setting search path instead of forcing prefix

  • Loading branch information...
1 parent a72b561 commit ec45da2004cd1484b30e30c3791297d103dd6afb @dceballos committed May 9, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −0 lib/roomer/helpers/postgres_helper.rb
  2. +0 −1 lib/roomer/tasks/migrate.rake
@@ -86,6 +86,7 @@ def stored_procedures(schema_name)
# Person.find(1) # => will execute "SELECT id FROM 'global.person' where 'id' = 1"
# end
def ensure_prefix(prefix, &block)
+ ActiveRecord::Base.connection.set_roomer_search_path
yield
end
@@ -63,7 +63,6 @@ namespace :roomer do
version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
Roomer.tenant_model.find(:all).each do |tenant|
ensuring_tenant(tenant) do
- ActiveRecord::Base.connection.schema_search_path = "#{tenant.schema_name},#{Roomer.shared_schema_name}"
ActiveRecord::Migrator.migrate(Roomer.tenanted_migrations_directory, version)
end
end

0 comments on commit ec45da2

Please sign in to comment.