ros-apartment 3.0.2 → 3.1.0

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
  SHA256:
3
- metadata.gz: 793fd10dfd8877d9771404883e999dbb9a190ce0e1ca6d41ad05995f3d374df5
4
- data.tar.gz: 27eb3923d9a8688eefb8ab7deeec360b9fa76579fdb48d7a85c5eed22dfc078c
3
+ metadata.gz: 2494257d1e615c2ef2e79647f3d5b62762dec8c51af19f2c5fe352b01572e752
4
+ data.tar.gz: 23b24db12c93d35cf10e34e1c71455a6fe05c9afe162dca6de5115212cb052b7
5
5
  SHA512:
6
- metadata.gz: ae1043d76528ac646baec58e009678894d7d544ec43ad0abefd95f5097d98fbbb115551fb34bb32d046f3f5716d6ca07cf618b574a7299a7fade2d44adc66ab2
7
- data.tar.gz: 5d9f4e6473d8862cf346c082b26c7348bc6f0c1dd300bfb20621fc5ca8713fe8cb25d4c2989413db01bf49144ac2a432004499e2d93fd9ff99133f6f6530d182
6
+ metadata.gz: e13fe607631fe0953b16ec42a64ba162deb3fc1522b70ac09b152acbc47b6bebd63a25cc35a6873a3190304de40166f89e9782ceced0259932116739890526f2
7
+ data.tar.gz: 035b1b87cdf43f463a6895981d63100a238a2a8b3ad0e0b529d74fa261f6138005e0f5aecd425e857d9ba10ee11c613cb8d6b3002cd35484b34b58f4df367e9a
data/.rubocop_todo.yml CHANGED
@@ -207,6 +207,7 @@ RSpec/ExampleWording:
207
207
  RSpec/FilePath:
208
208
  Exclude:
209
209
  - 'spec/adapters/mysql2_adapter_spec.rb'
210
+ - 'spec/adapters/trilogy_adapter_spec.rb'
210
211
  - 'spec/adapters/postgresql_adapter_spec.rb'
211
212
  - 'spec/adapters/sqlite3_adapter_spec.rb'
212
213
  - 'spec/tenant_spec.rb'
@@ -292,6 +293,7 @@ RSpec/MultipleExpectations:
292
293
  RSpec/NamedSubject:
293
294
  Exclude:
294
295
  - 'spec/adapters/mysql2_adapter_spec.rb'
296
+ - 'spec/adapters/trilogy_adapter_spec.rb'
295
297
  - 'spec/adapters/sqlite3_adapter_spec.rb'
296
298
  - 'spec/support/contexts.rb'
297
299
  - 'spec/support/requirements.rb'
@@ -315,6 +317,7 @@ RSpec/NoExpectationExample:
315
317
  RSpec/SpecFilePathFormat:
316
318
  Exclude:
317
319
  - 'spec/adapters/mysql2_adapter_spec.rb'
320
+ - 'spec/adapters/trilogy_adapter_spec.rb'
318
321
  - 'spec/adapters/postgresql_adapter_spec.rb'
319
322
  - 'spec/adapters/sqlite3_adapter_spec.rb'
320
323
  - 'spec/tenant_spec.rb'
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'apartment/adapters/mysql2_adapter'
4
+
5
+ module Apartment
6
+ # Helper module to decide wether to use trilogy adapter or trilogy adapter with schemas
7
+ module Tenant
8
+ def self.trilogy_adapter(config)
9
+ if Apartment.use_schemas
10
+ Adapters::TrilogySchemaAdapter.new(config)
11
+ else
12
+ Adapters::TrilogyAdapter.new(config)
13
+ end
14
+ end
15
+ end
16
+
17
+ module Adapters
18
+ class TrilogyAdapter < Mysql2Adapter
19
+ protected
20
+
21
+ def rescue_from
22
+ Trilogy::Error
23
+ end
24
+ end
25
+
26
+ class TrilogySchemaAdapter < Mysql2SchemaAdapter
27
+ end
28
+ end
29
+ end
@@ -14,7 +14,7 @@ module Apartment
14
14
 
15
15
  private
16
16
 
17
- def debug(progname = nil, &)
17
+ def debug(progname = nil, &blk)
18
18
  progname = " #{apartment_log}#{progname}" unless progname.nil?
19
19
 
20
20
  super
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Apartment
4
- VERSION = '3.0.2'
4
+ VERSION = '3.1.0'
5
5
  end
@@ -30,6 +30,8 @@ Gem::Specification.new do |s|
30
30
  'github_repo' => 'ssh://github.com/rails-on-services/apartment'
31
31
  }
32
32
 
33
+ s.required_ruby_version = '>= 3.0', '< 3.4'
34
+
33
35
  s.add_dependency 'activerecord', '>= 6.1.0', '< 7.2'
34
36
  s.add_dependency 'parallel', '< 2.0'
35
37
  s.add_dependency 'public_suffix', '>= 2.0.5', '< 6.0'
@@ -58,5 +60,6 @@ Gem::Specification.new do |s|
58
60
  s.add_development_dependency 'mysql2', '~> 0.5'
59
61
  s.add_development_dependency 'pg', '~> 1.5'
60
62
  s.add_development_dependency 'sqlite3', '< 2.0'
63
+ s.add_development_dependency 'trilogy', '< 3.0'
61
64
  end
62
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ros-apartment
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Brunner
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-05-24 00:00:00.000000000 Z
13
+ date: 2024-05-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -302,6 +302,20 @@ dependencies:
302
302
  - - "<"
303
303
  - !ruby/object:Gem::Version
304
304
  version: '2.0'
305
+ - !ruby/object:Gem::Dependency
306
+ name: trilogy
307
+ requirement: !ruby/object:Gem::Requirement
308
+ requirements:
309
+ - - "<"
310
+ - !ruby/object:Gem::Version
311
+ version: '3.0'
312
+ type: :development
313
+ prerelease: false
314
+ version_requirements: !ruby/object:Gem::Requirement
315
+ requirements:
316
+ - - "<"
317
+ - !ruby/object:Gem::Version
318
+ version: '3.0'
305
319
  description: Apartment allows Rack applications to deal with database multitenancy
306
320
  through ActiveRecord
307
321
  email:
@@ -337,6 +351,7 @@ files:
337
351
  - lib/apartment/adapters/postgis_adapter.rb
338
352
  - lib/apartment/adapters/postgresql_adapter.rb
339
353
  - lib/apartment/adapters/sqlite3_adapter.rb
354
+ - lib/apartment/adapters/trilogy_adapter.rb
340
355
  - lib/apartment/console.rb
341
356
  - lib/apartment/custom_console.rb
342
357
  - lib/apartment/deprecation.rb
@@ -372,7 +387,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
372
387
  requirements:
373
388
  - - ">="
374
389
  - !ruby/object:Gem::Version
375
- version: '0'
390
+ version: '3.0'
391
+ - - "<"
392
+ - !ruby/object:Gem::Version
393
+ version: '3.4'
376
394
  required_rubygems_version: !ruby/object:Gem::Requirement
377
395
  requirements:
378
396
  - - ">="