Permalink
Browse files

enruing search path where ensuring schema

  • Loading branch information...
1 parent c49deb7 commit 3136c08c6ae20f65a514fab849b82444bce6acb4 @dceballos committed May 13, 2013
View
2 lib/roomer/helpers/postgres_helper.rb
@@ -127,7 +127,7 @@ def ensuring_schema_and_search_path(schema_name, &block)
end
def ensuring_tenant(tenant,&blk)
- ensuring_schema(tenant.try(Roomer.tenant_schema_name_column)) do
+ ensuring_schema_and_search_path(tenant.try(Roomer.tenant_schema_name_column)) do
Roomer.with_tenant(tenant,&blk)
end
end
View
2 lib/roomer/tasks/migrate.rake
@@ -15,7 +15,7 @@ namespace :roomer do
# copied from https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railties/databases.rake
task :abort_if_pending_migrations => :environment do
- ensuring_schema(Roomer.shared_schema_name) do
+ ensuring_schema_and_search_path(Roomer.shared_schema_name) do
pending_migrations = ActiveRecord::Migrator.new(:up, Roomer.shared_migrations_directory).pending_migrations
if pending_migrations.any?
puts "You have #{pending_migrations.size} pending migrations:"
View
8 test/roomer/helpers/postgres_helper_test.rb
@@ -27,14 +27,14 @@ class PostgresHelperTest < RoomerTestCase
end
end
- test 'ensure schema' do
+ test 'ensure schema and search path' do
assert_raises(ArgumentError) do
- ensuring_schema {}
+ ensuring_schema_and_search_path {}
end
assert_nothing_raised do
assert !(schemas.include?("new_tenant"))
- ensuring_schema(:new_tenant) do
+ ensuring_schema_and_search_path(:new_tenant) do
assert schemas.include? "new_tenant"
end
end
@@ -43,7 +43,7 @@ class PostgresHelperTest < RoomerTestCase
test 'ensure schema with capital letters in the name' do
assert_nothing_raised do
create_schema("Testschema")
- ensuring_schema("Testschema") do
+ ensuring_schema_and_search_path("Testschema") do
assert schemas.include? "Testschema"
end
end

0 comments on commit 3136c08

Please sign in to comment.