ros-apartment 2.3.0.alpha2 → 2.3.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: 34315580882fc1aba022c3e274f51e72c3cd5feef66f655dad4ce82cacec1aa3
4
- data.tar.gz: 7e970b07d5467167efc9b49e6d7f8b69c0f28c2fbccff63f0137e5b7664b0b4f
3
+ metadata.gz: ea7b5564bca9125cfb7b8a7863793c69a3462dabd8211d274891b79a948c28f5
4
+ data.tar.gz: c502a0c3dccdd4edca005b68b6e945d82a6943716d917ef2df2e6fa91d2a2204
5
5
  SHA512:
6
- metadata.gz: 3b77d009ba12644e49099928f74811a5ca56d6142a08c35cbd21fc34d1aa0c6fc1e94a8165aae35593b235bffb81dccb9627f44bdc7944e6470e6c123db8c3b7
7
- data.tar.gz: 1590e8e67d2af1651986c2ce19da2d3aaa474e30f37b1039b59ca1bb302c24124e4eacf320fb7c11b6a415957bb7130ed108959dc3deebc6663c8b78d8349262
6
+ metadata.gz: c1babac9d50b907b36337157870ab606291a91cb022a80b11a1e3f008301f2a1b019137fb8ea03119e2a054b97041d4e532191142fff97eee3ad27cc30b10a0c
7
+ data.tar.gz: 7cee77bbe095d7f2d8b3a64468b5730d719152d5ec904ab15261b49366bc113dbb97f7b4a1297535c4c294d8b8099090f542ae315a2744fe55d1fb19895b4615
data/HISTORY.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 2.3.0
2
+ * January 3, 2020
3
+
4
+ ## Added
5
+ - Basic support for rails 6
6
+ - Released different gem name, with same API as apartment
7
+
1
8
  # 2.2.1
2
9
  * June 19, 2019
3
10
 
data/README.md CHANGED
@@ -4,34 +4,27 @@
4
4
  [![Code Climate](https://codeclimate.com/github/influitive/apartment/badges/gpa.svg)](https://codeclimate.com/github/influitive/apartment)
5
5
  [![Build Status](https://travis-ci.org/influitive/apartment.svg?branch=development)](https://travis-ci.org/influitive/apartment)
6
6
 
7
- # NOT ACTIVELY MAINTAINED YET. SOLELY FOR TESTING PURPOSES ATM
8
-
9
7
  *Multitenancy for Rails and ActiveRecord*
10
8
 
11
9
  Apartment provides tools to help you deal with multiple tenants in your Rails
12
10
  application. If you need to have certain data sequestered based on account or company,
13
11
  but still allow some data to exist in a common tenant, Apartment can help.
14
12
 
15
- ## HELP!
16
-
17
- In order to help drive the direction of development and clean up the codebase, we'd like to take a poll
18
- on how people are currently using Apartment. If you can take 5 seconds (1 question) to answer
19
- this poll, we'd greatly appreciated it.
20
-
21
- [View Poll](http://www.poll-maker.com/poll391552x4Bfb41a9-15)
13
+ ## Apartment drop in replacement gem
22
14
 
23
- ## Excessive Memory Issues on ActiveRecord 4.x
15
+ After having reached out via github issues and email directly, no replies ever
16
+ came. Since we wanted to upgrade our application to Rails 6 we decided to fork
17
+ and start some development to support Rails 6. Because we don't have access
18
+ to the apartment gem itself, the solution was to release it under a different
19
+ name but providing the exact same API as it was before.
24
20
 
25
- > If you're noticing ever growing memory issues (ie growing with each tenant you add)
26
- > when using Apartment, that's because there's [an issue](https://github.com/rails/rails/issues/19578)
27
- > with how ActiveRecord maps Postgresql data types into AR data types.
28
- > This has been patched and will be released for AR 4.2.2. It's apparently hard
29
- > to backport to 4.1 unfortunately.
30
- > If you're noticing high memory usage from ActiveRecord with Apartment please upgrade.
21
+ ## Help wanted
31
22
 
32
- ```ruby
33
- gem 'rails', '4.2.1', github: 'influitive/rails', tag: 'v4.2.1.memfix'
34
- ```
23
+ We were never involved with the development of Apartment gem in the first place
24
+ and this project started out of our own needs. We will be more than happy
25
+ to collaborate to maintain the gem alive and supporting the latest versions
26
+ of ruby and rails, but your help is appreciated. Either by reporting bugs you
27
+ may find or proposing improvements to the gem itself. Feel free to reach out.
35
28
 
36
29
  ## Installation
37
30
 
@@ -40,7 +33,7 @@ gem 'rails', '4.2.1', github: 'influitive/rails', tag: 'v4.2.1.memfix'
40
33
  Add the following to your Gemfile:
41
34
 
42
35
  ```ruby
43
- gem 'apartment'
36
+ gem 'ros-apartment'
44
37
  ```
45
38
 
46
39
  Then generate your `Apartment` config file using
@@ -533,7 +526,12 @@ end
533
526
 
534
527
  ## Background workers
535
528
 
536
- See [apartment-sidekiq](https://github.com/influitive/apartment-sidekiq) or [apartment-activejob](https://github.com/influitive/apartment-activejob).
529
+ Both these gems have been forked as a side consequence of having a new gem name.
530
+ You can use them exactly as you were using before. They are, just like this one
531
+ a drop-in replacement.
532
+
533
+ See [apartment-sidekiq](https://github.com/rails-on-services/apartment-sidekiq)
534
+ or [apartment-activejob](https://github.com/rails-on-services/apartment-activejob).
537
535
 
538
536
  ## Callbacks
539
537
 
data/Rakefile CHANGED
@@ -119,10 +119,18 @@ def activerecord_below_5_2?
119
119
  ActiveRecord.version.release < Gem::Version.new('5.2.0')
120
120
  end
121
121
 
122
+ def activerecord_below_6_0?
123
+ ActiveRecord.version.release < Gem::Version.new('6.0.0')
124
+ end
125
+
122
126
  def migrate
123
127
  if activerecord_below_5_2?
124
128
  ActiveRecord::Migrator.migrate('spec/dummy/db/migrate')
125
- else
129
+ elsif activerecord_below_6_0?
126
130
  ActiveRecord::MigrationContext.new('spec/dummy/db/migrate').migrate
131
+ else
132
+ # TODO: Figure out if there is any other possibility that can/should be
133
+ # passed here as the second argument for the migration context
134
+ ActiveRecord::MigrationContext.new('spec/dummy/db/migrate', ActiveRecord::SchemaMigration).migrate
127
135
  end
128
136
  end
data/apartment.gemspec CHANGED
@@ -1,42 +1,43 @@
1
- # -*- encoding: utf-8 -*-
2
- $: << File.expand_path("../lib", __FILE__)
3
- require "apartment/version"
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH << File.expand_path('lib', __dir__)
4
+ require 'apartment/version'
4
5
 
5
6
  Gem::Specification.new do |s|
6
- s.name = %q{ros-apartment}
7
+ s.name = 'ros-apartment'
7
8
  s.version = Apartment::VERSION
8
9
 
9
- s.authors = ["Ryan Brunner", "Brad Robertson"]
10
- s.summary = %q{A Ruby gem for managing database multitenancy}
11
- s.description = %q{Apartment allows Rack applications to deal with database multitenancy through ActiveRecord}
12
- s.email = ["ryan@influitive.com", "brad@influitive.com"]
10
+ s.authors = ['Ryan Brunner', 'Brad Robertson', 'Rui Baltazar']
11
+ s.summary = 'A Ruby gem for managing database multitenancy. Apartment Gem drop in replacement'
12
+ s.description = 'Apartment allows Rack applications to deal with database multitenancy through ActiveRecord'
13
+ s.email = ['ryan@influitive.com', 'brad@influitive.com', 'rui.p.baltazar@gmail.com']
13
14
  s.files = `git ls-files`.split($/)
14
- s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
15
+ s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
15
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
- s.require_paths = ["lib"]
17
+ s.require_paths = ['lib']
17
18
 
18
- s.homepage = %q{https://github.com/rails-on-services/apartment}
19
- s.licenses = ["MIT"]
19
+ s.homepage = 'https://github.com/rails-on-services/apartment'
20
+ s.licenses = ['MIT']
20
21
 
21
22
  # must be >= 3.1.2 due to bug in prepared_statements
22
23
  s.add_dependency 'activerecord', '>= 3.1.2', '< 6.1'
23
- s.add_dependency 'rack', '>= 1.3.6'
24
- s.add_dependency 'public_suffix', '>= 2'
25
24
  s.add_dependency 'parallel', '>= 0.7.1'
25
+ s.add_dependency 'public_suffix', '>= 2'
26
+ s.add_dependency 'rack', '>= 1.3.6'
26
27
 
27
28
  s.add_development_dependency 'appraisal'
29
+ s.add_development_dependency 'bundler', '>= 1.3', '< 2.0'
30
+ s.add_development_dependency 'capybara', '~> 2.0'
28
31
  s.add_development_dependency 'rake', '~> 0.9'
29
32
  s.add_development_dependency 'rspec', '~> 3.4'
30
33
  s.add_development_dependency 'rspec-rails', '~> 3.4'
31
- s.add_development_dependency 'capybara', '~> 2.0'
32
- s.add_development_dependency 'bundler', '>= 1.3', '< 2.0'
33
34
 
34
35
  if defined?(JRUBY_VERSION)
35
36
  s.add_development_dependency 'activerecord-jdbc-adapter'
36
- s.add_development_dependency 'activerecord-jdbcpostgresql-adapter'
37
37
  s.add_development_dependency 'activerecord-jdbcmysql-adapter'
38
- s.add_development_dependency 'jdbc-postgres'
38
+ s.add_development_dependency 'activerecord-jdbcpostgresql-adapter'
39
39
  s.add_development_dependency 'jdbc-mysql'
40
+ s.add_development_dependency 'jdbc-postgres'
40
41
  s.add_development_dependency 'jruby-openssl'
41
42
  else
42
43
  s.add_development_dependency 'mysql2'
@@ -1,3 +1,3 @@
1
1
  module Apartment
2
- VERSION = "2.3.0.alpha2"
2
+ VERSION = "2.3.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ros-apartment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.alpha2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Brunner
8
8
  - Brad Robertson
9
+ - Rui Baltazar
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2020-01-02 00:00:00.000000000 Z
13
+ date: 2020-01-03 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: activerecord
@@ -32,19 +33,19 @@ dependencies:
32
33
  - !ruby/object:Gem::Version
33
34
  version: '6.1'
34
35
  - !ruby/object:Gem::Dependency
35
- name: rack
36
+ name: parallel
36
37
  requirement: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - ">="
39
40
  - !ruby/object:Gem::Version
40
- version: 1.3.6
41
+ version: 0.7.1
41
42
  type: :runtime
42
43
  prerelease: false
43
44
  version_requirements: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - ">="
46
47
  - !ruby/object:Gem::Version
47
- version: 1.3.6
48
+ version: 0.7.1
48
49
  - !ruby/object:Gem::Dependency
49
50
  name: public_suffix
50
51
  requirement: !ruby/object:Gem::Requirement
@@ -60,19 +61,19 @@ dependencies:
60
61
  - !ruby/object:Gem::Version
61
62
  version: '2'
62
63
  - !ruby/object:Gem::Dependency
63
- name: parallel
64
+ name: rack
64
65
  requirement: !ruby/object:Gem::Requirement
65
66
  requirements:
66
67
  - - ">="
67
68
  - !ruby/object:Gem::Version
68
- version: 0.7.1
69
+ version: 1.3.6
69
70
  type: :runtime
70
71
  prerelease: false
71
72
  version_requirements: !ruby/object:Gem::Requirement
72
73
  requirements:
73
74
  - - ">="
74
75
  - !ruby/object:Gem::Version
75
- version: 0.7.1
76
+ version: 1.3.6
76
77
  - !ruby/object:Gem::Dependency
77
78
  name: appraisal
78
79
  requirement: !ruby/object:Gem::Requirement
@@ -88,81 +89,81 @@ dependencies:
88
89
  - !ruby/object:Gem::Version
89
90
  version: '0'
90
91
  - !ruby/object:Gem::Dependency
91
- name: rake
92
+ name: bundler
92
93
  requirement: !ruby/object:Gem::Requirement
93
94
  requirements:
94
- - - "~>"
95
+ - - ">="
95
96
  - !ruby/object:Gem::Version
96
- version: '0.9'
97
+ version: '1.3'
98
+ - - "<"
99
+ - !ruby/object:Gem::Version
100
+ version: '2.0'
97
101
  type: :development
98
102
  prerelease: false
99
103
  version_requirements: !ruby/object:Gem::Requirement
100
104
  requirements:
101
- - - "~>"
105
+ - - ">="
102
106
  - !ruby/object:Gem::Version
103
- version: '0.9'
107
+ version: '1.3'
108
+ - - "<"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.0'
104
111
  - !ruby/object:Gem::Dependency
105
- name: rspec
112
+ name: capybara
106
113
  requirement: !ruby/object:Gem::Requirement
107
114
  requirements:
108
115
  - - "~>"
109
116
  - !ruby/object:Gem::Version
110
- version: '3.4'
117
+ version: '2.0'
111
118
  type: :development
112
119
  prerelease: false
113
120
  version_requirements: !ruby/object:Gem::Requirement
114
121
  requirements:
115
122
  - - "~>"
116
123
  - !ruby/object:Gem::Version
117
- version: '3.4'
124
+ version: '2.0'
118
125
  - !ruby/object:Gem::Dependency
119
- name: rspec-rails
126
+ name: rake
120
127
  requirement: !ruby/object:Gem::Requirement
121
128
  requirements:
122
129
  - - "~>"
123
130
  - !ruby/object:Gem::Version
124
- version: '3.4'
131
+ version: '0.9'
125
132
  type: :development
126
133
  prerelease: false
127
134
  version_requirements: !ruby/object:Gem::Requirement
128
135
  requirements:
129
136
  - - "~>"
130
137
  - !ruby/object:Gem::Version
131
- version: '3.4'
138
+ version: '0.9'
132
139
  - !ruby/object:Gem::Dependency
133
- name: capybara
140
+ name: rspec
134
141
  requirement: !ruby/object:Gem::Requirement
135
142
  requirements:
136
143
  - - "~>"
137
144
  - !ruby/object:Gem::Version
138
- version: '2.0'
145
+ version: '3.4'
139
146
  type: :development
140
147
  prerelease: false
141
148
  version_requirements: !ruby/object:Gem::Requirement
142
149
  requirements:
143
150
  - - "~>"
144
151
  - !ruby/object:Gem::Version
145
- version: '2.0'
152
+ version: '3.4'
146
153
  - !ruby/object:Gem::Dependency
147
- name: bundler
154
+ name: rspec-rails
148
155
  requirement: !ruby/object:Gem::Requirement
149
156
  requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '1.3'
153
- - - "<"
157
+ - - "~>"
154
158
  - !ruby/object:Gem::Version
155
- version: '2.0'
159
+ version: '3.4'
156
160
  type: :development
157
161
  prerelease: false
158
162
  version_requirements: !ruby/object:Gem::Requirement
159
163
  requirements:
160
- - - ">="
161
- - !ruby/object:Gem::Version
162
- version: '1.3'
163
- - - "<"
164
+ - - "~>"
164
165
  - !ruby/object:Gem::Version
165
- version: '2.0'
166
+ version: '3.4'
166
167
  - !ruby/object:Gem::Dependency
167
168
  name: mysql2
168
169
  requirement: !ruby/object:Gem::Requirement
@@ -210,6 +211,7 @@ description: Apartment allows Rack applications to deal with database multitenan
210
211
  email:
211
212
  - ryan@influitive.com
212
213
  - brad@influitive.com
214
+ - rui.p.baltazar@gmail.com
213
215
  executables: []
214
216
  extensions: []
215
217
  extra_rdoc_files: []
@@ -376,14 +378,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
376
378
  version: '0'
377
379
  required_rubygems_version: !ruby/object:Gem::Requirement
378
380
  requirements:
379
- - - ">"
381
+ - - ">="
380
382
  - !ruby/object:Gem::Version
381
- version: 1.3.1
383
+ version: '0'
382
384
  requirements: []
383
- rubygems_version: 3.0.6
385
+ rubyforge_project:
386
+ rubygems_version: 2.7.6
384
387
  signing_key:
385
388
  specification_version: 4
386
- summary: A Ruby gem for managing database multitenancy
389
+ summary: A Ruby gem for managing database multitenancy. Apartment Gem drop in replacement
387
390
  test_files:
388
391
  - spec/adapters/jdbc_mysql_adapter_spec.rb
389
392
  - spec/adapters/jdbc_postgresql_adapter_spec.rb