apartment 0.26.0 → 0.26.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +5 -0
- data/lib/apartment/adapters/postgresql_adapter.rb +3 -6
- data/lib/apartment/version.rb +1 -1
- data/spec/adapters/postgresql_adapter_spec.rb +6 -0
- metadata +32 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d6e788468ee9bf06e6609665cc72fc7f7dcc4f8
|
4
|
+
data.tar.gz: 219fad7766c4fecbbe3317a4567de5fc0df1c9e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d89e61072548c8231dfe3e55bc824fa9ba484a8bbfb8146c2ba0b00d77d9254b485b4f3d67df21d1601570f0ac3885645a38793fac8de157dfdbe30d500927e9
|
7
|
+
data.tar.gz: f896417457f7c0c5ae40fcf61e5737f2d983cf2b40ba09e66163ada7379dbc9fbc633037e48e83abbac81b98306f8dfa002c2f6475a96c1394d2a4af62ec42c3
|
data/HISTORY.md
CHANGED
@@ -173,7 +173,7 @@ module Apartment
|
|
173
173
|
# @return {String} patched raw SQL dump
|
174
174
|
#
|
175
175
|
def patch_search_path(sql)
|
176
|
-
search_path = "SET search_path = #{
|
176
|
+
search_path = "SET search_path = \"#{current}\", #{default_schema};"
|
177
177
|
|
178
178
|
sql
|
179
179
|
.split("\n")
|
@@ -198,18 +198,15 @@ module Apartment
|
|
198
198
|
|
199
199
|
# Convenience method for current database name
|
200
200
|
#
|
201
|
-
def dbname
|
201
|
+
def dbname
|
202
202
|
ActiveRecord::Base.connection_config[:database]
|
203
203
|
end
|
204
204
|
|
205
205
|
# Convenience method for the default schema
|
206
206
|
#
|
207
|
-
def default_schema
|
207
|
+
def default_schema
|
208
208
|
Apartment.default_schema
|
209
209
|
end
|
210
|
-
|
211
210
|
end
|
212
|
-
|
213
|
-
|
214
211
|
end
|
215
212
|
end
|
data/lib/apartment/version.rb
CHANGED
@@ -34,6 +34,12 @@ describe Apartment::Adapters::PostgresqlAdapter, database: :postgresql do
|
|
34
34
|
|
35
35
|
it_should_behave_like "a generic apartment adapter"
|
36
36
|
it_should_behave_like "a schema based apartment adapter"
|
37
|
+
|
38
|
+
it 'allows for dashes in the schema name' do
|
39
|
+
expect { Apartment::Tenant.create('has-dashes') }.to_not raise_error
|
40
|
+
end
|
41
|
+
|
42
|
+
after { Apartment::Tenant.drop('has-dashes') if Apartment.connection.schema_exists? 'has-dashes' }
|
37
43
|
end
|
38
44
|
|
39
45
|
context "using connections" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apartment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.26.
|
4
|
+
version: 0.26.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brunner
|
@@ -9,152 +9,152 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-01-
|
12
|
+
date: 2015-01-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 3.1.2
|
21
|
-
- -
|
21
|
+
- - <
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '5.0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- -
|
28
|
+
- - '>='
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 3.1.2
|
31
|
-
- -
|
31
|
+
- - <
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '5.0'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rack
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.3.6
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.3.6
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: appraisal
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rake
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.9'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.9'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: rspec-rails
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.14'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '2.14'
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
91
|
name: guard-rspec
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '4.2'
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '4.2'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: capybara
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 1.0.0
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 1.0.0
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: mysql2
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 0.3.10
|
125
125
|
type: :development
|
126
126
|
prerelease: false
|
127
127
|
version_requirements: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ~>
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: 0.3.10
|
132
132
|
- !ruby/object:Gem::Dependency
|
133
133
|
name: pg
|
134
134
|
requirement: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.11.0
|
139
139
|
type: :development
|
140
140
|
prerelease: false
|
141
141
|
version_requirements: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: 0.11.0
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: sqlite3
|
148
148
|
requirement: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
type: :development
|
154
154
|
prerelease: false
|
155
155
|
version_requirements: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
description: Apartment allows Rack applications to deal with database multitenancy
|
@@ -166,12 +166,12 @@ executables: []
|
|
166
166
|
extensions: []
|
167
167
|
extra_rdoc_files: []
|
168
168
|
files:
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
173
|
-
-
|
174
|
-
-
|
169
|
+
- .gitignore
|
170
|
+
- .pryrc
|
171
|
+
- .rspec
|
172
|
+
- .ruby-gemset
|
173
|
+
- .ruby-version
|
174
|
+
- .travis.yml
|
175
175
|
- Appraisals
|
176
176
|
- Gemfile
|
177
177
|
- Guardfile
|
@@ -298,12 +298,12 @@ require_paths:
|
|
298
298
|
- lib
|
299
299
|
required_ruby_version: !ruby/object:Gem::Requirement
|
300
300
|
requirements:
|
301
|
-
- -
|
301
|
+
- - '>='
|
302
302
|
- !ruby/object:Gem::Version
|
303
303
|
version: '0'
|
304
304
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
305
305
|
requirements:
|
306
|
-
- -
|
306
|
+
- - '>='
|
307
307
|
- !ruby/object:Gem::Version
|
308
308
|
version: '0'
|
309
309
|
requirements: []
|