rails_multitenant 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +14 -11
- data/CHANGELOG.md +8 -5
- data/lib/rails_multitenant/version.rb +1 -1
- data/rails_multitenant.gemspec +2 -2
- metadata +7 -9
- data/spec/current_spec.rb.dis +0 -80
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 67d4b3670342f9781ea8caf11d7bdad5738b2dfe9bd3db7c4b875a04d0ed98d1
|
|
4
|
+
data.tar.gz: 34f9a2766c8535fef4541a5c4e8029f9f761eb9a619d6e1253f551f359c18e6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96816ef2f33df7dfe1f77a2dd71fcfb67b54109c760e639030133f7a85ce8ec1949712f091c0e50bf3f3b172ec1d0d97b87020e4b243a2e79547b358c6fd53f2
|
|
7
|
+
data.tar.gz: 902994f55431faf8747fba66847b2e2c0e2b3b15c949910cb33849e682256c21a1ed05865662aa6de033875b72162c5f98d44edaf4267feedefea49f5a69ae50
|
data/.travis.yml
CHANGED
|
@@ -3,22 +3,25 @@ sudo: false
|
|
|
3
3
|
env:
|
|
4
4
|
- RAILS_VERSION="~> 4.1.16"
|
|
5
5
|
- RAILS_VERSION="~> 4.2.10"
|
|
6
|
-
- RAILS_VERSION="~> 5.0.
|
|
7
|
-
- RAILS_VERSION="~> 5.1.
|
|
6
|
+
- RAILS_VERSION="~> 5.0.7"
|
|
7
|
+
- RAILS_VERSION="~> 5.1.6"
|
|
8
|
+
- RAILS_VERSION="~> 5.2.0"
|
|
8
9
|
rvm:
|
|
9
|
-
- 2.5.
|
|
10
|
-
- 2.4.
|
|
11
|
-
- 2.3.
|
|
12
|
-
- 2.2.
|
|
10
|
+
- 2.5.1
|
|
11
|
+
- 2.4.4
|
|
12
|
+
- 2.3.7
|
|
13
|
+
- 2.2.10
|
|
13
14
|
- 2.1.10
|
|
14
15
|
matrix:
|
|
15
16
|
exclude:
|
|
16
17
|
- rvm: 2.1.10
|
|
17
|
-
env: RAILS_VERSION="~> 5.0.
|
|
18
|
+
env: RAILS_VERSION="~> 5.0.7"
|
|
18
19
|
- rvm: 2.1.10
|
|
19
|
-
env: RAILS_VERSION="~> 5.1.
|
|
20
|
-
- rvm: 2.
|
|
20
|
+
env: RAILS_VERSION="~> 5.1.6"
|
|
21
|
+
- rvm: 2.1.10
|
|
22
|
+
env: RAILS_VERSION="~> 5.2.0"
|
|
23
|
+
- rvm: 2.4.4
|
|
21
24
|
env: RAILS_VERSION="~> 4.1.16"
|
|
22
|
-
- rvm: 2.5.
|
|
25
|
+
- rvm: 2.5.1
|
|
23
26
|
env: RAILS_VERSION="~> 4.1.16"
|
|
24
|
-
before_install: gem install bundler -v 1.
|
|
27
|
+
before_install: gem install bundler -v 1.16.2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
### 0.
|
|
4
|
-
*
|
|
3
|
+
### 0.10.0
|
|
4
|
+
* Rails 5.2 support.
|
|
5
|
+
|
|
6
|
+
### 0.9.0
|
|
7
|
+
* Modify `Current.current` to return a specified default, when not already initialized, or `nil`
|
|
5
8
|
when no default is specified.
|
|
6
9
|
* Add `Current.provide_default` to optionally specify a default value for `Current.current`.
|
|
7
10
|
* Add `Current.current=` / `Current.current?` / `Current.current!` / `Current.as_current`.
|
|
8
11
|
|
|
9
12
|
### 0.8.0
|
|
10
|
-
* Switch usage of Fixnum to Integer for Ruby > 2.4
|
|
13
|
+
* Switch usage of Fixnum to Integer for Ruby > 2.4
|
|
11
14
|
* Test with multiple Rubies
|
|
12
15
|
|
|
13
16
|
### 0.7.2
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
* Rails 5.1 support.
|
|
24
27
|
|
|
25
28
|
### 0.5.2
|
|
26
|
-
* Optimize `CurrentInstance.current` / `CurrentInstance.current_id` / `CurrentInstance.current=`
|
|
29
|
+
* Optimize `CurrentInstance.current` / `CurrentInstance.current_id` / `CurrentInstance.current=`
|
|
27
30
|
/ `CurrentInstance.current_id=`.
|
|
28
31
|
|
|
29
32
|
### 0.5.1
|
|
@@ -45,6 +48,6 @@
|
|
|
45
48
|
specifying the new registry to set. The previous registry is still returned.
|
|
46
49
|
|
|
47
50
|
### 0.2.0
|
|
48
|
-
* Merged [PR 2](https://github.com/salsify/rails-multitenant/pull/2) which adds support for
|
|
51
|
+
* Merged [PR 2](https://github.com/salsify/rails-multitenant/pull/2) which adds support for
|
|
49
52
|
multi-tenancy based on a foreign key to an external model. As part of this the `multitenant_model_on`
|
|
50
53
|
method was renamed to `multitenant_on_model`.
|
data/rails_multitenant.gemspec
CHANGED
|
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.10"
|
|
23
23
|
|
|
24
|
-
spec.add_dependency 'activerecord', ENV.fetch('RAILS_VERSION', ['>= 4.1', '< 5.
|
|
25
|
-
spec.add_dependency 'activesupport', ENV.fetch('RAILS_VERSION', ['>= 4.1', '< 5.
|
|
24
|
+
spec.add_dependency 'activerecord', ENV.fetch('RAILS_VERSION', ['>= 4.1', '< 5.3'])
|
|
25
|
+
spec.add_dependency 'activesupport', ENV.fetch('RAILS_VERSION', ['>= 4.1', '< 5.3'])
|
|
26
26
|
|
|
27
27
|
spec.add_development_dependency 'coveralls'
|
|
28
28
|
spec.add_development_dependency 'database_cleaner', '>= 1.2'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_multitenant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pat Breault
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-05-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -33,7 +33,7 @@ dependencies:
|
|
|
33
33
|
version: '4.1'
|
|
34
34
|
- - "<"
|
|
35
35
|
- !ruby/object:Gem::Version
|
|
36
|
-
version: '5.
|
|
36
|
+
version: '5.3'
|
|
37
37
|
type: :runtime
|
|
38
38
|
prerelease: false
|
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -43,7 +43,7 @@ dependencies:
|
|
|
43
43
|
version: '4.1'
|
|
44
44
|
- - "<"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '5.
|
|
46
|
+
version: '5.3'
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: activesupport
|
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -53,7 +53,7 @@ dependencies:
|
|
|
53
53
|
version: '4.1'
|
|
54
54
|
- - "<"
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '5.
|
|
56
|
+
version: '5.3'
|
|
57
57
|
type: :runtime
|
|
58
58
|
prerelease: false
|
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -63,7 +63,7 @@ dependencies:
|
|
|
63
63
|
version: '4.1'
|
|
64
64
|
- - "<"
|
|
65
65
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '5.
|
|
66
|
+
version: '5.3'
|
|
67
67
|
- !ruby/object:Gem::Dependency
|
|
68
68
|
name: coveralls
|
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -177,7 +177,6 @@ files:
|
|
|
177
177
|
- rails_multitenant.gemspec
|
|
178
178
|
- spec/be_multitenant_on_matcher_spec.rb
|
|
179
179
|
- spec/current_spec.rb
|
|
180
|
-
- spec/current_spec.rb.dis
|
|
181
180
|
- spec/db/database.yml
|
|
182
181
|
- spec/db/schema.rb
|
|
183
182
|
- spec/external_item_spec.rb
|
|
@@ -208,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
208
207
|
version: '0'
|
|
209
208
|
requirements: []
|
|
210
209
|
rubyforge_project:
|
|
211
|
-
rubygems_version: 2.6
|
|
210
|
+
rubygems_version: 2.7.6
|
|
212
211
|
signing_key:
|
|
213
212
|
specification_version: 4
|
|
214
213
|
summary: Automatically configures multiple tenants in a Rails environment
|
|
@@ -217,7 +216,6 @@ test_files:
|
|
|
217
216
|
- spec/global_context_registry_spec.rb
|
|
218
217
|
- spec/external_item_spec.rb
|
|
219
218
|
- spec/item_subtype_spec.rb
|
|
220
|
-
- spec/current_spec.rb.dis
|
|
221
219
|
- spec/current_spec.rb
|
|
222
220
|
- spec/item_spec.rb
|
|
223
221
|
- spec/external_item_with_optional_org_spec.rb
|
data/spec/current_spec.rb.dis
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# Create multiple orgs
|
|
2
|
-
# Create an item in each
|
|
3
|
-
# Make sure you can only see one org's item in one org
|
|
4
|
-
|
|
5
|
-
describe RailsMultitenant::GlobalContextRegistry::Current do
|
|
6
|
-
|
|
7
|
-
class Parent
|
|
8
|
-
include RailsMultitenant::GlobalContextRegistry::Current
|
|
9
|
-
|
|
10
|
-
attr_accessor :id
|
|
11
|
-
|
|
12
|
-
def initialize(id: 0)
|
|
13
|
-
@id = id
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
class Dependent
|
|
18
|
-
include RailsMultitenant::GlobalContextRegistry::Current
|
|
19
|
-
global_context_dependent_on Parent
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
class StepParent < Parent
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'current' do
|
|
26
|
-
expect(Parent.current.id).to eq(0)
|
|
27
|
-
expect(Parent.current).to eq(Parent.current)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'current=' do
|
|
31
|
-
Parent.current = Parent.new(id: 42)
|
|
32
|
-
expect(Parent.current.id).to eq(42)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
it 'clear_current!' do
|
|
37
|
-
Parent.clear_current!
|
|
38
|
-
expect(Parent.current.id).to eq(0)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it 'current?' do
|
|
42
|
-
Parent.clear_current!
|
|
43
|
-
expect(Parent.current?).to be_falsey
|
|
44
|
-
Parent.current = Parent.new(id: 42)
|
|
45
|
-
expect(Parent.current?).to be_truthy
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
context 'with dependencies' do
|
|
49
|
-
it 'dependent is cleared' do
|
|
50
|
-
Parent.current = Parent.new(id: 78)
|
|
51
|
-
Dependent.current = Dependent.new
|
|
52
|
-
Parent.current = Parent.new(id: 78)
|
|
53
|
-
expect(Dependent.current?).to be_falsey
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it 'dependent subclass is cleared' do
|
|
57
|
-
Parent.current = Parent.new(id: 78)
|
|
58
|
-
Dependent.current = Dependent.new
|
|
59
|
-
Parent.current = StepParent.new(id: 78)
|
|
60
|
-
expect(Dependent.current?).to be_falsey
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
#let(dependent_id) { Organization.current.id }
|
|
65
|
-
|
|
66
|
-
it 'dependent model subclass is cleared' do
|
|
67
|
-
#Organization.current = Organization.create!
|
|
68
|
-
DependsOnOrganization.current = DependsOnOrganization.create!
|
|
69
|
-
dependent_id = DependsOnOrganization.current.object_id
|
|
70
|
-
SubOrganization.current = SubOrganization.create!
|
|
71
|
-
expect(DependsOnOrganization.current.object_id).not_to eq(dependent_id)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
end
|