apartment 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +5 -0
- data/README.md +0 -2
- data/lib/apartment/adapters/abstract_adapter.rb +1 -0
- data/lib/apartment/database.rb +1 -1
- data/lib/apartment/version.rb +1 -1
- data/spec/integration/database_integration_spec.rb +13 -1
- metadata +3 -3
data/HISTORY.md
CHANGED
data/README.md
CHANGED
data/lib/apartment/database.rb
CHANGED
@@ -3,7 +3,7 @@ require 'active_support/core_ext/string/inflections' # for `constantize`
|
|
3
3
|
module Apartment
|
4
4
|
module Database
|
5
5
|
|
6
|
-
MULTI_TENANT_METHODS = [:create, :switch, :reset, :connect_and_reset]
|
6
|
+
MULTI_TENANT_METHODS = [:create, :switch, :reset, :connect_and_reset, :process]
|
7
7
|
|
8
8
|
class << self
|
9
9
|
|
data/lib/apartment/version.rb
CHANGED
@@ -39,7 +39,6 @@ describe Apartment::Database do
|
|
39
39
|
it "should load postgresql adapter" do
|
40
40
|
Apartment::Database.adapter
|
41
41
|
Apartment::Adapters::PostgresqlAdapter.should be_a(Class)
|
42
|
-
|
43
42
|
end
|
44
43
|
|
45
44
|
it "should raise exception with invalid adapter specified" do
|
@@ -67,6 +66,19 @@ describe Apartment::Database do
|
|
67
66
|
Apartment::Test.drop_schema(database)
|
68
67
|
end
|
69
68
|
|
69
|
+
describe "#process" do
|
70
|
+
it "should connect to new schema" do
|
71
|
+
Apartment::Database.process(database) do
|
72
|
+
ActiveRecord::Base.connection.schema_search_path.should == database
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should reset to public schema" do
|
77
|
+
Apartment::Database.process(database)
|
78
|
+
ActiveRecord::Base.connection.schema_search_path.should == @schema_search_path
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
70
82
|
describe "#create" do
|
71
83
|
it "should create new postgres schema" do
|
72
84
|
ActiveRecord::Base.connection.execute("SELECT nspname FROM pg_namespace;").collect{|row| row['nspname']}.should include(database)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: apartment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.6.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan Brunner
|
@@ -185,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
185
185
|
requirements:
|
186
186
|
- - ">="
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
hash:
|
188
|
+
hash: 4521352595890258295
|
189
189
|
segments:
|
190
190
|
- 0
|
191
191
|
version: "0"
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
requirements:
|
195
195
|
- - ">="
|
196
196
|
- !ruby/object:Gem::Version
|
197
|
-
hash:
|
197
|
+
hash: 4521352595890258295
|
198
198
|
segments:
|
199
199
|
- 0
|
200
200
|
version: "0"
|