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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c377b128a7ca8546b7b82ca0c8192f65a8b1a775
4
- data.tar.gz: bc26a7c1fd06d203d738474caef4f509fc3846c2
3
+ metadata.gz: 1d6e788468ee9bf06e6609665cc72fc7f7dcc4f8
4
+ data.tar.gz: 219fad7766c4fecbbe3317a4567de5fc0df1c9e8
5
5
  SHA512:
6
- metadata.gz: 7ac80e070ff4fb23033690968276764a059c7b1a714d122e4463c11acdc70f9db825929845ab374b9950456b9c6de756ecdbe0ba9d9dbecb0e1d114345017cbb
7
- data.tar.gz: 069660ca61e8178a5e6df70afd99b8b31ee21ebfdf923cba2fce8a8b23c777bd226a48a959595c40ee9973acc6bd6408818faa9379ccb8b2452d9a4f54a880cf
6
+ metadata.gz: d89e61072548c8231dfe3e55bc824fa9ba484a8bbfb8146c2ba0b00d77d9254b485b4f3d67df21d1601570f0ac3885645a38793fac8de157dfdbe30d500927e9
7
+ data.tar.gz: f896417457f7c0c5ae40fcf61e5737f2d983cf2b40ba09e66163ada7379dbc9fbc633037e48e83abbac81b98306f8dfa002c2f6475a96c1394d2a4af62ec42c3
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.26.1
2
+ * Jan 13, 2015
3
+
4
+ - Fixed [schema quoting bug](https://github.com/influitive/apartment/issues/198#issuecomment-69782651) [jonsgreen]
5
+
1
6
  # 0.26.0
2
7
  * Jan 5, 2015
3
8
 
@@ -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 = #{self.current_tenant}, #{Apartment.default_schema};"
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
@@ -1,3 +1,3 @@
1
1
  module Apartment
2
- VERSION = "0.26.0"
2
+ VERSION = "0.26.1"
3
3
  end
@@ -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.0
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-05 00:00:00.000000000 Z
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
- - ".gitignore"
170
- - ".pryrc"
171
- - ".rspec"
172
- - ".ruby-gemset"
173
- - ".ruby-version"
174
- - ".travis.yml"
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: []