ros-apartment 2.7.1 → 2.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://my.diffend.io/protect/gems'
3
+ source 'http://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- gem 'perx-rubocop', '~> 0.0.3'
8
7
  gem 'rails', '>= 3.1.2'
8
+ gem 'rubocop'
9
9
 
10
10
  group :local do
11
11
  gem 'guard-rspec', '~> 4.2'
data/Guardfile CHANGED
@@ -8,19 +8,4 @@ guard :rspec do
8
8
  watch(%r{^lib/apartment/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
9
9
  watch(%r{^lib/apartment/(.+)\.rb$}) { |m| "spec/integration/#{m[1]}_spec.rb" }
10
10
  watch('spec/spec_helper.rb') { 'spec' }
11
-
12
- # # Rails example
13
- # watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
14
- # watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
15
- # watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
16
- # watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
17
- # watch('config/routes.rb') { "spec/routing" }
18
- # watch('app/controllers/application_controller.rb') { "spec/controllers" }
19
-
20
- # # Capybara features specs
21
- # watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
22
-
23
- # # Turnip features and steps
24
- # watch(%r{^spec/acceptance/(.+)\.feature$})
25
- # watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
26
11
  end
data/HISTORY.md CHANGED
@@ -1,42 +1,42 @@
1
- # 2.7.1
1
+ # v2.7.1
2
2
 
3
- # Enhancements
3
+ **Implemented enhancements:**
4
4
 
5
5
  - N/a
6
6
 
7
- # Bugfixes
7
+ **Fixed bugs:**
8
8
 
9
9
  - [Resolves #82] Enhanced db:create breaks plugin compatibility - <https://github.com/rails-on-services/apartment/pull/83>
10
10
 
11
- # Chores
11
+ **Closed issues:**
12
12
 
13
13
  - Update rake version in development
14
14
  - Renamed gemspec to match gem name
15
15
 
16
- # 2.7.0
16
+ # v2.7.0
17
17
 
18
- # Enhancements
18
+ **Implemented enhancements:**
19
19
 
20
20
  - [Resolves #70] Rake tasks define methods on main - <https://github.com/rails-on-services/apartment/pull/75>
21
21
  - Add database and schema to active record log. Configurable, defaults to false to keep current behavior - <https://github.com/rails-on-services/apartment/pull/55>
22
22
 
23
- # Bugfixes
23
+ **Fixed bugs:**
24
24
 
25
25
  - [Fixes #61] Fix database create in mysql - <https://github.com/rails-on-services/apartment/pull/76>
26
26
 
27
- # Chores
27
+ **Closed issues:**
28
28
 
29
29
  - Remove deprecated tld_length config option: tld_length was removed in influitive#309, this configuration option doesn't have any effect now. - <https://github.com/rails-on-services/apartment/pull/72>
30
30
  - Using [diffend.io proxy](https://diffend.io) to safely check required gems
31
31
  - Added [story branch](https://github.com/story-branch/story_branch) to the configuration
32
32
  - Using travis-ci to run rubocop as well, replacing github actions: github actions do not work in fork's PRs
33
33
 
34
- # 2.6.1
34
+ # v2.6.1
35
35
 
36
- ## Enhancements
36
+ **Implemented enhancements:**
37
37
  - N/a
38
38
 
39
- ## Bugfixes
39
+ **Fixed bugs:**
40
40
  - [Resolves influitive#607] Avoid early connection
41
41
  - <https://github.com/rails-on-services/apartment/pull/39>
42
42
  - <https://github.com/rails-on-services/apartment/pull/53>
@@ -44,89 +44,90 @@
44
44
  - [Resolves #52] Rake db:setup tries to seed non existent tenant - <https://github.com/rails-on-services/apartment/pull/54>
45
45
  - [Resolves #56] DB rollback uses second last migration - <https://github.com/rails-on-services/apartment/pull/57>
46
46
 
47
- ## Chores
47
+ #**Closed issues:**
48
48
  - N/a
49
49
 
50
- # 2.6.0
50
+ # v2.6.0
51
51
 
52
- ## Enhancements
52
+ **Implemented enhancements:**
53
53
  - [Resolves #26] Support configuration for skip checking of schema existence before switching
54
54
  - [Resolves #41] Add tenant info to console boot
55
55
 
56
- ## Bugfixes
56
+ **Fixed bugs:**
57
57
  - [Resolves #37] Custom Console deprecation warning
58
58
  - [Resolves #42] After switch callback not working with nil argument
59
59
 
60
- ## Chores
60
+ #**Closed issues:**
61
61
  - Updated github actions configuration to run on PRs as well
62
62
 
63
- # 2.5.0
63
+ # v2.5.0
64
64
 
65
- ## Enhancements
65
+ **Implemented enhancements:**
66
66
  - [Resolves #6] Adds support for rails 6.1
67
67
  - [Resolves #27] Adds support to not rely on set search path, but instead prepends the schema name to the table name when using postgresql with schemas.
68
68
  - [Resolves #35] Cache keys are now tenant dependent
69
69
 
70
- ## Bugfixes
70
+ **Fixed bugs:**
71
71
  - [Resolves #27] Manually switching connection between read and write forgets the schema
72
72
 
73
- ## Chores
73
+ #**Closed issues:**
74
74
  - [Resolves #31] Add latest ruby versions to test matrix
75
75
 
76
- # 2.4.0
76
+ # v2.4.0
77
77
 
78
- ## Enhancements
78
+ **Implemented enhancements:**
79
79
  - [Resolves #14] Add console info about tenants and fast switches #17
80
80
  - Skip init if we're running webpacker:compile #18
81
81
 
82
- ## Bugfixes
82
+ **Fixed bugs:**
83
83
  - Don't crash when no database connection is present #16
84
84
  - Rescuing ActiveRecord::NoDatabaseError when dropping tenants #19
85
85
 
86
- ## Chores
86
+ #**Closed issues:**
87
87
  - Rakefile should use mysql port from configuration #5
88
88
  - [Resolves #9] Cleanup rubocop todo #8
89
89
  - Cleanup travis matrix #23
90
90
 
91
- # 2.3.0
91
+ # v2.3.0
92
92
  * January 3, 2020
93
93
 
94
- ## Added
94
+ **Implemented enhancements:**
95
95
  - Basic support for rails 6
96
96
  - Released different gem name, with same API as apartment
97
97
 
98
- # 2.2.1
98
+ # v2.2.1
99
99
  * June 19, 2019
100
100
 
101
- ## Added
101
+ **Implemented enhancements:**
102
102
  - #566: IGNORE_EMPTY_TENANTS environment variable to ignore empty tenants
103
103
  warning. [Pysis868]
104
104
 
105
- ## Fixed
105
+ **Fixed bugs:**
106
106
  - #586: Ignore `CREATE SCHEMA public` statement in pg dump [artemave]
107
107
  - #549: Fix Postgres schema creation with dump SQL [ancorcruz]
108
108
 
109
- # 2.2.0
109
+ # v2.2.0
110
110
  * April 14, 2018
111
111
 
112
- ## Added
112
+ **Implemented enhancements:**
113
113
  - #523: Add Rails 5.2 support [IngusSkaistkalns]
114
114
  - #504: Test against Ruby 2.5.0 [ahorek]
115
115
  - #528: Test against Rails 5.2 [meganemura]
116
116
 
117
- ## Removed
117
+ **Removed:**
118
118
  - #504: Remove Rails 4.0/4.1 support [ahorek]
119
119
  - #545: Stop supporting for JRuby + Rails 5.0 [meganemura]
120
120
 
121
- ## Fixed
121
+ **Fixed bugs:**
122
122
  - #537: Fix PostgresqlSchemaFromSqlAdapter for newer PostgreSQL [shterrett]
123
123
  - #532: Issue is reported by [aldrinmartoq]
124
124
  - #519: Fix exception when main database doesn't exist [mayeco]
125
125
 
126
- ## Changed
126
+ **Closed issues:**
127
+
127
128
  - #514: Fix typo [menorval]
128
129
 
129
- # 2.1.0
130
+ # v2.1.0
130
131
  * December 15, 2017
131
132
 
132
133
  - Add `parallel_migration_threads` configuration option for running migrations
@@ -138,7 +139,7 @@
138
139
  - "Host" elevator [shrmnk]
139
140
  - Enhance db:drop task to act on all tenants [kuzukuzu]
140
141
 
141
- # 2.0.0
142
+ # v2.0.0
142
143
  * July 26, 2017
143
144
 
144
145
  - Raise FileNotFound rather than abort when loading files [meganemura]
@@ -156,30 +157,30 @@
156
157
  - Skip initialization for assets:clean and assets:precompile tasks
157
158
  [frank-west-iii]
158
159
 
159
- # 1.2.0
160
+ # v1.2.0
160
161
  * July 28, 2016
161
162
 
162
163
  - Official Rails 5 support
163
164
 
164
- # 1.1.0
165
+ # v1.1.0
165
166
  * May 26, 2016
166
167
 
167
168
  - Reset tenant after each request
168
169
  - [Support callbacks](https://github.com/influitive/apartment/commit/ff9c9d092a781026502f5997c0bbedcb5748bc83) on switch [cbeer]
169
170
  - Preliminary support for [separate database hosts](https://github.com/influitive/apartment/commit/abdffbf8cd9fba87243f16c86390da13e318ee1f) [apneadiving]
170
171
 
171
- # 1.0.2
172
+ # v1.0.2
172
173
  * July 2, 2015
173
174
 
174
175
  - Fix pg_dump env vars - pull/208 [MitinPavel]
175
176
  - Allow custom seed data file - pull/234 [typeoneerror]
176
177
 
177
- # 1.0.1
178
+ # v1.0.1
178
179
  * April 28, 2015
179
180
 
180
181
  - Fix `Apartment::Deprecation` which was rescuing all exceptions
181
182
 
182
- # 1.0.0
183
+ # v1.0.0
183
184
  * Feb 3, 2015
184
185
 
185
186
  - [BREAKING CHANGE] `Apartment::Tenant.process` is deprecated in favour of `Apartment::Tenant.switch`
@@ -187,27 +188,27 @@
187
188
  - Raise proper `TenantNotFound`, `TenantExists` exceptions
188
189
  - Deprecate old `SchemaNotFound`, `DatabaseNotFound` exceptions
189
190
 
190
- # 0.26.1
191
+ # v0.26.1
191
192
  * Jan 13, 2015
192
193
 
193
194
  - Fixed [schema quoting bug](https://github.com/influitive/apartment/issues/198#issuecomment-69782651) [jonsgreen]
194
195
 
195
- # 0.26.0
196
+ # v0.26.0
196
197
  * Jan 5, 2015
197
198
 
198
199
  - Rails 4.2 support
199
200
 
200
- # 0.25.2
201
+ # v0.25.2
201
202
  * Sept 8, 2014
202
203
 
203
204
  - Heroku fix on `assets:precompile` - pull/169 [rabbitt]
204
205
 
205
- # 0.25.1
206
+ # v0.25.1
206
207
  * July 17, 2014
207
208
 
208
209
  - Fixed a few vestiges of Apartment::Database
209
210
 
210
- # 0.25.0
211
+ # v0.25.0
211
212
  * July 3, 2014
212
213
 
213
214
  - [BREAKING CHANGE] - `Apartment::Database` is not deprecated in favour of
@@ -215,23 +216,23 @@
215
216
  - ActiveRecord (and Rails) 4.1 now supported
216
217
  - A new sql based adapter that dumps the schema using sql
217
218
 
218
- # 0.24.3
219
+ # v0.24.3
219
220
  * March 5, 2014
220
221
 
221
222
  - Rake enhancements weren't removed from the generator template
222
223
 
223
- # 0.24.2
224
+ # v0.24.2
224
225
  * February 24, 2014
225
226
 
226
227
  - Better warnings if `apartment:migrate` is run
227
228
 
228
- # 0.24.1
229
+ # v0.24.1
229
230
  * February 21, 2014
230
231
 
231
232
  - requiring `apartment/tasks/enhancements` in an initializer doesn't work
232
233
  - One can disable tenant migrations using `Apartment.db_migrate_tenants = false` in the Rakefile
233
234
 
234
- # 0.24
235
+ # v0.24
235
236
  * February 21, 2014 (In honour of the Women's Gold Medal in Hockey at Sochi)
236
237
 
237
238
  - [BREAKING CHANGE] `apartment:migrate` task no longer depends on `db:migrate`
@@ -242,31 +243,31 @@
242
243
  - This is an ongoing effort to completely replace 'database' with 'tenant' as a better abstraction
243
244
  - Note the obvious `Apartment::Database` still exists but will hopefully become `Apartment::Tenant` soon
244
245
 
245
- # 0.23.2
246
+ # v0.23.2
246
247
  * January 9, 2014
247
248
 
248
249
  - Increased visibility of #parse_database_name warning
249
250
 
250
- # 0.23.1
251
+ # v0.23.1
251
252
  * January 8, 2014
252
253
 
253
254
  - Schema adapters now initialize with default and persistent schemas
254
255
  - Deprecated Apartment::Elevators#parse_database_name
255
256
 
256
- # 0.23.0
257
+ # v0.23.0
257
258
  * August 21, 2013
258
259
 
259
260
  - Subdomain Elevator now allows for exclusions
260
261
  - Delayed::Job has been completely removed
261
262
 
262
- # 0.22.1
263
+ # v0.22.1
263
264
  * August 21, 2013
264
265
 
265
266
  - Fix bug where if your ruby process importing the database schema is run
266
267
  from a directory other than the app root, Apartment wouldn't know what
267
268
  schema_migrations to insert into the database (Rails only)
268
269
 
269
- # 0.22.0
270
+ # v0.22.0
270
271
  * June 9, 2013
271
272
 
272
273
  - Numerous bug fixes:
@@ -277,42 +278,42 @@
277
278
  - Official Sidekiq support with the [apartment-sidekiq gem](https://github.com/influitive/apartment-sidekiq)
278
279
 
279
280
 
280
- # 0.21.1
281
+ # v0.21.1
281
282
  * May 31, 2013
282
283
 
283
284
  - Clearing the AR::QueryCache after switching databases.
284
285
  - Fixes issue with stale model being loaded for schema adapters
285
286
 
286
- # 0.21.0
287
+ # v0.21.0
287
288
  * April 24, 2013
288
289
 
289
290
  - JDBC support!! [PetrolMan]
290
291
 
291
- # 0.20.0
292
+ # v0.20.0
292
293
  * Feb 6, 2013
293
294
 
294
295
  - Mysql now has a 'schema like' option to perform like Postgresql (default)
295
296
  - This should be significantly more performant than using connections
296
297
  - Psych is now supported for Delayed::Job yaml parsing
297
298
 
298
- # 0.19.2
299
+ # v0.19.2
299
300
  * Jan 30, 2013
300
301
 
301
302
  - Database schema file can now be set manually or skipped altogether
302
303
 
303
- # 0.19.1
304
+ # v0.19.1
304
305
  * Jan 30, 2013
305
306
 
306
307
  - Allow schema.rb import file to be specified in config or skip schema.rb import altogether
307
308
 
308
- # 0.19.0
309
+ # v0.19.0
309
310
  * Dec 29, 2012
310
311
 
311
312
  - Apartment is now threadsafe
312
313
  - New postgis adapter [zonpantli]
313
314
  - Removed ActionDispatch dependency for use with Rack apps (regression)
314
315
 
315
- # 0.18.0
316
+ # v0.18.0
316
317
  * Nov 27, 2012
317
318
 
318
319
  - Added `append_environment` config option [virtualstaticvoid]
@@ -320,19 +321,19 @@
320
321
  - Added `connection_class` config option [smashtank]
321
322
  - Fixed a [bug](https://github.com/influitive/apartment/issues/17#issuecomment-10758327) in pg adapter when missing schema
322
323
 
323
- # 0.17.1
324
+ # v0.17.1
324
325
  * Oct 30, 2012
325
326
 
326
327
  - Fixed a bug where switching to an unknown db in mysql2 would crash the app [Frodotus]
327
328
 
328
- # 0.17.0
329
+ # v0.17.0
329
330
  * Sept 26, 2012
330
331
 
331
332
  - Apartment has [a new home!](https://github.com/influitive/apartment)
332
333
  - Support Sidekiq hooks to switch dbs [maedhr]
333
334
  - Allow VERSION to be used on apartment:migrate [Bhavin Kamani]
334
335
 
335
- # 0.16.0
336
+ # v0.16.0
336
337
  * June 1, 2012
337
338
 
338
339
  - Apartment now supports a default_schema to be set, rather than relying on ActiveRecord's default schema_search_path
@@ -341,50 +342,50 @@
341
342
  - There is now a full domain based elevator to switch dbs based on the whole domain [lcowell]
342
343
  - There is now a generic elevator that takes a Proc to switch dbs based on the return value of that proc.
343
344
 
344
- # 0.15.0
345
+ # v0.15.0
345
346
  * March 18, 2012
346
347
 
347
348
  - Remove Rails dependency, Apartment can now be used with any Rack based framework using ActiveRecord
348
349
 
349
- # 0.14.4
350
+ # v0.14.4
350
351
  * March 8, 2012
351
352
 
352
353
  - Delayed::Job Hooks now return to the previous database, rather than resetting
353
354
 
354
- # 0.14.3
355
+ # v0.14.3
355
356
  * Feb 21, 2012
356
357
 
357
358
  - Fix yaml serialization of non DJ models
358
359
 
359
- # 0.14.2
360
+ # v0.14.2
360
361
  * Feb 21, 2012
361
362
 
362
363
  - Fix Delayed::Job yaml encoding with Rails > 3.0.x
363
364
 
364
- # 0.14.1
365
+ # v0.14.1
365
366
  * Dec 13, 2011
366
367
 
367
368
  - Fix ActionDispatch::Callbacks deprecation warnings
368
369
 
369
- # 0.14.0
370
+ # v0.14.0
370
371
  * Dec 13, 2011
371
372
 
372
373
  - Rails 3.1 Support
373
374
 
374
- # 0.13.1
375
+ # v0.13.1
375
376
  * Nov 8, 2011
376
377
 
377
378
  - Reset prepared statement cache for rails 3.1.1 before switching dbs when using postgresql schemas
378
379
  - Only necessary until the next release which will be more schema aware
379
380
 
380
- # 0.13.0
381
+ # v0.13.0
381
382
  * Oct 25, 2011
382
383
 
383
384
  - `process` will now rescue with reset if the previous schema/db is no longer available
384
385
  - `create` now takes an optional block which allows you to process within the newly created db
385
386
  - Fixed Rails version >= 3.0.10 and < 3.1 because there have been significant testing problems with 3.1, next version will hopefully fix this
386
387
 
387
- # 0.12.0
388
+ # v0.12.0
388
389
  * Oct 4, 2011
389
390
 
390
391
  - Added a `drop` method for removing databases/schemas
@@ -392,7 +393,7 @@
392
393
  - Excluded models now take string references so they are properly reloaded in development
393
394
  - Better silencing of `schema.rb` loading using `verbose` flag
394
395
 
395
- # 0.11.1
396
+ # v0.11.1
396
397
  * Sep 22, 2011
397
398
 
398
399
  - Better use of Railties for initializing apartment
@@ -400,88 +401,88 @@
400
401
  - Added reloader middleware in development to init Apartment on each request
401
402
  - Override `reload!` in console to also init Apartment
402
403
 
403
- # 0.11.0
404
+ # v0.11.0
404
405
  * Sep 20, 2011
405
406
 
406
407
  - Excluded models no longer use a different connection when using postgresql schemas. Instead their table_name is prefixed with `public.`
407
408
 
408
- # 0.10.3
409
+ # v0.10.3
409
410
  * Sep 20, 2011
410
411
 
411
412
  - Fix improper raising of exceptions on create and reset
412
413
 
413
- # 0.10.2
414
+ # v0.10.2
414
415
  * Sep 15, 2011
415
416
 
416
417
  - Remove all the annoying logging for loading db schema and seeding on create
417
418
 
418
- # 0.10.1
419
+ # v0.10.1
419
420
  * Aug 11, 2011
420
421
 
421
422
  - Fixed bug in DJ where new objects (that hadn't been pulled from the db) didn't have the proper database assigned
422
423
 
423
- # 0.10.0
424
+ # v0.10.0
424
425
  * July 29, 2011
425
426
 
426
427
  - Added better support for Delayed Job
427
428
  - New config option that enables Delayed Job wrappers
428
429
  - Note that DJ support uses a work-around in order to get queues stored in the public schema, not sure why it doesn't work out of the box, will look into it, until then, see documentation on queue'ng jobs
429
430
 
430
- # 0.9.2
431
+ # v0.9.2
431
432
  * July 4, 2011
432
433
 
433
434
  - Migrations now run associated rails migration fully, fixes schema.rb not being reloaded after migrations
434
435
 
435
- # 0.9.1
436
+ # v0.9.1
436
437
  * June 24, 2011
437
438
 
438
439
  - Hooks now take the payload object as an argument to fetch the proper db for DJ hooks
439
440
 
440
- # 0.9.0
441
+ # v0.9.0
441
442
  * June 23, 2011
442
443
 
443
444
  - Added module to provide delayed job hooks
444
445
 
445
- # 0.8.0
446
+ # v0.8.0
446
447
  * June 23, 2011
447
448
 
448
449
  - Added #current_database which will return the current database (or schema) name
449
450
 
450
- # 0.7.0
451
+ # v0.7.0
451
452
  * June 22, 2011
452
453
 
453
454
  - Added apartment:seed rake task for seeding all dbs
454
455
 
455
- # 0.6.0
456
+ # v0.6.0
456
457
  * June 21, 2011
457
458
 
458
459
  - Added #process to connect to new db, perform operations, then ensure a reset
459
460
 
460
- # 0.5.1
461
+ # v0.5.1
461
462
  * June 21, 2011
462
463
 
463
464
  - Fixed db migrate up/down/rollback
464
465
  - added db:redo
465
466
 
466
- # 0.5.0
467
+ # v0.5.0
467
468
  * June 20, 2011
468
469
 
469
470
  - Added the concept of an "Elevator", a rack based strategy for db switching
470
471
  - Added the Subdomain Elevator middleware to enabled db switching based on subdomain
471
472
 
472
- # 0.4.0
473
+ # v0.4.0
473
474
  * June 14, 2011
474
475
 
475
476
  - Added `configure` method on Apartment instead of using yml file, allows for dynamic setting of db names to migrate for rake task
476
477
  - Added `seed_after_create` config option to import seed data to new db on create
477
478
 
478
- # 0.3.0
479
+ # v0.3.0
479
480
  * June 10, 2011
480
481
 
481
482
  - Added full support for database migration
482
483
  - Added in method to establish new connection for excluded models on startup rather than on each switch
483
484
 
484
- # 0.2.0
485
+ # v0.2.0
485
486
  * June 6, 2011 *
486
487
 
487
488
  - Refactor to use more rails/active_support functionality
@@ -489,7 +490,7 @@
489
490
  - Remove OStruct and just use hashes for fetching methods
490
491
  - Added schema load on create instead of migrating from scratch
491
492
 
492
- # 0.1.3
493
+ # v0.1.3
493
494
  * March 30, 2011 *
494
495
 
495
496
  - Original pass from Ryan