activerecord-multi-tenant 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +6 -14
  4. data/Appraisals +24 -24
  5. data/CHANGELOG.md +22 -0
  6. data/Gemfile.lock +79 -63
  7. data/README.md +1 -1
  8. data/activerecord-multi-tenant.gemspec +1 -1
  9. data/gemfiles/.bundle/config +2 -0
  10. data/gemfiles/active_record_5.2.gemfile +10 -2
  11. data/gemfiles/active_record_5.2.gemfile.lock +102 -96
  12. data/gemfiles/{active_record_5.1.gemfile → active_record_6.0.gemfile} +2 -2
  13. data/gemfiles/active_record_6.0.gemfile.lock +198 -0
  14. data/gemfiles/rails_5.2.gemfile +10 -2
  15. data/gemfiles/rails_5.2.gemfile.lock +109 -103
  16. data/gemfiles/{rails_5.0.gemfile → rails_6.0.gemfile} +2 -2
  17. data/gemfiles/rails_6.0.gemfile.lock +198 -0
  18. data/lib/activerecord-multi-tenant.rb +1 -0
  19. data/lib/activerecord-multi-tenant/controller_extensions.rb +2 -6
  20. data/lib/activerecord-multi-tenant/copy_from_client.rb +2 -2
  21. data/lib/activerecord-multi-tenant/migrations.rb +2 -2
  22. data/lib/activerecord-multi-tenant/model_extensions.rb +8 -15
  23. data/lib/activerecord-multi-tenant/multi_tenant.rb +9 -0
  24. data/lib/activerecord-multi-tenant/persistence_extension.rb +13 -0
  25. data/lib/activerecord-multi-tenant/query_rewriter.rb +59 -105
  26. data/lib/activerecord-multi-tenant/sidekiq.rb +2 -1
  27. data/lib/activerecord-multi-tenant/version.rb +1 -1
  28. data/spec/activerecord-multi-tenant/controller_extensions_spec.rb +19 -24
  29. data/spec/activerecord-multi-tenant/model_extensions_spec.rb +54 -104
  30. data/spec/activerecord-multi-tenant/query_rewriter_spec.rb +40 -0
  31. data/spec/activerecord-multi-tenant/record_modifications_spec.rb +60 -3
  32. data/spec/activerecord-multi-tenant/schema_dumper_tester.rb +0 -0
  33. data/spec/activerecord-multi-tenant/sidekiq_spec.rb +4 -4
  34. data/spec/schema.rb +1 -4
  35. data/spec/spec_helper.rb +1 -6
  36. metadata +15 -20
  37. data/gemfiles/active_record_5.1.gemfile.lock +0 -173
  38. data/gemfiles/rails_4.0.gemfile +0 -8
  39. data/gemfiles/rails_4.0.gemfile.lock +0 -141
  40. data/gemfiles/rails_4.1.gemfile +0 -8
  41. data/gemfiles/rails_4.1.gemfile.lock +0 -146
  42. data/gemfiles/rails_4.2.gemfile +0 -8
  43. data/gemfiles/rails_4.2.gemfile.lock +0 -169
  44. data/gemfiles/rails_5.0.gemfile.lock +0 -175
  45. data/gemfiles/rails_5.1.gemfile +0 -8
  46. data/gemfiles/rails_5.1.gemfile.lock +0 -175
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "rails", "4.1.16"
7
-
8
- gemspec :path => "../"
@@ -1,146 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- activerecord-multi-tenant (1.0.0)
5
- rails (>= 4.0)
6
- request_store (>= 1.0.5)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionmailer (4.1.16)
12
- actionpack (= 4.1.16)
13
- actionview (= 4.1.16)
14
- mail (~> 2.5, >= 2.5.4)
15
- actionpack (4.1.16)
16
- actionview (= 4.1.16)
17
- activesupport (= 4.1.16)
18
- rack (~> 1.5.2)
19
- rack-test (~> 0.6.2)
20
- actionview (4.1.16)
21
- activesupport (= 4.1.16)
22
- builder (~> 3.1)
23
- erubis (~> 2.7.0)
24
- activemodel (4.1.16)
25
- activesupport (= 4.1.16)
26
- builder (~> 3.1)
27
- activerecord (4.1.16)
28
- activemodel (= 4.1.16)
29
- activesupport (= 4.1.16)
30
- arel (~> 5.0.0)
31
- activesupport (4.1.16)
32
- i18n (~> 0.6, >= 0.6.9)
33
- json (~> 1.7, >= 1.7.7)
34
- minitest (~> 5.1)
35
- thread_safe (~> 0.1)
36
- tzinfo (~> 1.1)
37
- appraisal (2.1.0)
38
- bundler
39
- rake
40
- thor (>= 0.14.0)
41
- arel (5.0.1.20140414130214)
42
- builder (3.2.3)
43
- byebug (9.0.6)
44
- coderay (1.1.1)
45
- concurrent-ruby (1.0.5)
46
- connection_pool (2.2.1)
47
- diff-lcs (1.3)
48
- erubis (2.7.0)
49
- i18n (0.8.1)
50
- json (1.8.6)
51
- mail (2.6.4)
52
- mime-types (>= 1.16, < 4)
53
- method_source (0.8.2)
54
- mime-types (3.1)
55
- mime-types-data (~> 3.2015)
56
- mime-types-data (3.2016.0521)
57
- minitest (5.10.1)
58
- pg (0.20.0)
59
- pry (0.10.4)
60
- coderay (~> 1.1.0)
61
- method_source (~> 0.8.1)
62
- slop (~> 3.4)
63
- pry-byebug (3.4.2)
64
- byebug (~> 9.0)
65
- pry (~> 0.10)
66
- rack (1.5.5)
67
- rack-protection (2.0.0)
68
- rack
69
- rack-test (0.6.3)
70
- rack (>= 1.0)
71
- rails (4.1.16)
72
- actionmailer (= 4.1.16)
73
- actionpack (= 4.1.16)
74
- actionview (= 4.1.16)
75
- activemodel (= 4.1.16)
76
- activerecord (= 4.1.16)
77
- activesupport (= 4.1.16)
78
- bundler (>= 1.3.0, < 2.0)
79
- railties (= 4.1.16)
80
- sprockets-rails (~> 2.0)
81
- railties (4.1.16)
82
- actionpack (= 4.1.16)
83
- activesupport (= 4.1.16)
84
- rake (>= 0.8.7)
85
- thor (>= 0.18.1, < 2.0)
86
- rake (12.0.0)
87
- redis (3.3.3)
88
- request_store (1.4.1)
89
- rack (>= 1.4)
90
- rspec (3.5.0)
91
- rspec-core (~> 3.5.0)
92
- rspec-expectations (~> 3.5.0)
93
- rspec-mocks (~> 3.5.0)
94
- rspec-core (3.5.4)
95
- rspec-support (~> 3.5.0)
96
- rspec-expectations (3.5.0)
97
- diff-lcs (>= 1.2.0, < 2.0)
98
- rspec-support (~> 3.5.0)
99
- rspec-mocks (3.5.0)
100
- diff-lcs (>= 1.2.0, < 2.0)
101
- rspec-support (~> 3.5.0)
102
- rspec-rails (3.5.2)
103
- actionpack (>= 3.0)
104
- activesupport (>= 3.0)
105
- railties (>= 3.0)
106
- rspec-core (~> 3.5.0)
107
- rspec-expectations (~> 3.5.0)
108
- rspec-mocks (~> 3.5.0)
109
- rspec-support (~> 3.5.0)
110
- rspec-support (3.5.0)
111
- sidekiq (5.0.3)
112
- concurrent-ruby (~> 1.0)
113
- connection_pool (~> 2.2, >= 2.2.0)
114
- rack-protection (>= 1.5.0)
115
- redis (~> 3.3, >= 3.3.3)
116
- slop (3.6.0)
117
- sprockets (3.7.1)
118
- concurrent-ruby (~> 1.0)
119
- rack (> 1, < 3)
120
- sprockets-rails (2.3.3)
121
- actionpack (>= 3.0)
122
- activesupport (>= 3.0)
123
- sprockets (>= 2.8, < 4.0)
124
- thor (0.19.4)
125
- thread_safe (0.3.6)
126
- tzinfo (1.2.2)
127
- thread_safe (~> 0.1)
128
-
129
- PLATFORMS
130
- ruby
131
-
132
- DEPENDENCIES
133
- activerecord-multi-tenant!
134
- appraisal
135
- pg
136
- pry
137
- pry-byebug
138
- rails (= 4.1.16)
139
- rake
140
- rspec (>= 3.0)
141
- rspec-rails
142
- sidekiq
143
- thor
144
-
145
- BUNDLED WITH
146
- 1.17.2
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "rails", "4.2.8"
7
-
8
- gemspec :path => "../"
@@ -1,169 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- activerecord-multi-tenant (1.0.0)
5
- rails (>= 4.0)
6
- request_store (>= 1.0.5)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionmailer (4.2.8)
12
- actionpack (= 4.2.8)
13
- actionview (= 4.2.8)
14
- activejob (= 4.2.8)
15
- mail (~> 2.5, >= 2.5.4)
16
- rails-dom-testing (~> 1.0, >= 1.0.5)
17
- actionpack (4.2.8)
18
- actionview (= 4.2.8)
19
- activesupport (= 4.2.8)
20
- rack (~> 1.6)
21
- rack-test (~> 0.6.2)
22
- rails-dom-testing (~> 1.0, >= 1.0.5)
23
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
- actionview (4.2.8)
25
- activesupport (= 4.2.8)
26
- builder (~> 3.1)
27
- erubis (~> 2.7.0)
28
- rails-dom-testing (~> 1.0, >= 1.0.5)
29
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
30
- activejob (4.2.8)
31
- activesupport (= 4.2.8)
32
- globalid (>= 0.3.0)
33
- activemodel (4.2.8)
34
- activesupport (= 4.2.8)
35
- builder (~> 3.1)
36
- activerecord (4.2.8)
37
- activemodel (= 4.2.8)
38
- activesupport (= 4.2.8)
39
- arel (~> 6.0)
40
- activesupport (4.2.8)
41
- i18n (~> 0.7)
42
- minitest (~> 5.1)
43
- thread_safe (~> 0.3, >= 0.3.4)
44
- tzinfo (~> 1.1)
45
- appraisal (2.1.0)
46
- bundler
47
- rake
48
- thor (>= 0.14.0)
49
- arel (6.0.4)
50
- builder (3.2.3)
51
- byebug (9.0.6)
52
- coderay (1.1.1)
53
- concurrent-ruby (1.0.5)
54
- connection_pool (2.2.1)
55
- diff-lcs (1.3)
56
- erubis (2.7.0)
57
- globalid (0.3.7)
58
- activesupport (>= 4.1.0)
59
- i18n (0.8.1)
60
- loofah (2.0.3)
61
- nokogiri (>= 1.5.9)
62
- mail (2.6.4)
63
- mime-types (>= 1.16, < 4)
64
- method_source (0.8.2)
65
- mime-types (3.1)
66
- mime-types-data (~> 3.2015)
67
- mime-types-data (3.2016.0521)
68
- mini_portile2 (2.1.0)
69
- minitest (5.10.1)
70
- nokogiri (1.7.1)
71
- mini_portile2 (~> 2.1.0)
72
- pg (0.20.0)
73
- pry (0.10.4)
74
- coderay (~> 1.1.0)
75
- method_source (~> 0.8.1)
76
- slop (~> 3.4)
77
- pry-byebug (3.4.2)
78
- byebug (~> 9.0)
79
- pry (~> 0.10)
80
- rack (1.6.5)
81
- rack-protection (1.5.3)
82
- rack
83
- rack-test (0.6.3)
84
- rack (>= 1.0)
85
- rails (4.2.8)
86
- actionmailer (= 4.2.8)
87
- actionpack (= 4.2.8)
88
- actionview (= 4.2.8)
89
- activejob (= 4.2.8)
90
- activemodel (= 4.2.8)
91
- activerecord (= 4.2.8)
92
- activesupport (= 4.2.8)
93
- bundler (>= 1.3.0, < 2.0)
94
- railties (= 4.2.8)
95
- sprockets-rails
96
- rails-deprecated_sanitizer (1.0.3)
97
- activesupport (>= 4.2.0.alpha)
98
- rails-dom-testing (1.0.8)
99
- activesupport (>= 4.2.0.beta, < 5.0)
100
- nokogiri (~> 1.6)
101
- rails-deprecated_sanitizer (>= 1.0.1)
102
- rails-html-sanitizer (1.0.3)
103
- loofah (~> 2.0)
104
- railties (4.2.8)
105
- actionpack (= 4.2.8)
106
- activesupport (= 4.2.8)
107
- rake (>= 0.8.7)
108
- thor (>= 0.18.1, < 2.0)
109
- rake (12.0.0)
110
- redis (3.3.3)
111
- request_store (1.4.1)
112
- rack (>= 1.4)
113
- rspec (3.5.0)
114
- rspec-core (~> 3.5.0)
115
- rspec-expectations (~> 3.5.0)
116
- rspec-mocks (~> 3.5.0)
117
- rspec-core (3.5.4)
118
- rspec-support (~> 3.5.0)
119
- rspec-expectations (3.5.0)
120
- diff-lcs (>= 1.2.0, < 2.0)
121
- rspec-support (~> 3.5.0)
122
- rspec-mocks (3.5.0)
123
- diff-lcs (>= 1.2.0, < 2.0)
124
- rspec-support (~> 3.5.0)
125
- rspec-rails (3.5.2)
126
- actionpack (>= 3.0)
127
- activesupport (>= 3.0)
128
- railties (>= 3.0)
129
- rspec-core (~> 3.5.0)
130
- rspec-expectations (~> 3.5.0)
131
- rspec-mocks (~> 3.5.0)
132
- rspec-support (~> 3.5.0)
133
- rspec-support (3.5.0)
134
- sidekiq (4.2.10)
135
- concurrent-ruby (~> 1.0)
136
- connection_pool (~> 2.2, >= 2.2.0)
137
- rack-protection (>= 1.5.0)
138
- redis (~> 3.2, >= 3.2.1)
139
- slop (3.6.0)
140
- sprockets (3.7.1)
141
- concurrent-ruby (~> 1.0)
142
- rack (> 1, < 3)
143
- sprockets-rails (3.2.0)
144
- actionpack (>= 4.0)
145
- activesupport (>= 4.0)
146
- sprockets (>= 3.0.0)
147
- thor (0.19.4)
148
- thread_safe (0.3.6)
149
- tzinfo (1.2.2)
150
- thread_safe (~> 0.1)
151
-
152
- PLATFORMS
153
- ruby
154
-
155
- DEPENDENCIES
156
- activerecord-multi-tenant!
157
- appraisal
158
- pg
159
- pry
160
- pry-byebug
161
- rails (= 4.2.8)
162
- rake
163
- rspec (>= 3.0)
164
- rspec-rails
165
- sidekiq
166
- thor
167
-
168
- BUNDLED WITH
169
- 1.17.2
@@ -1,175 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- activerecord-multi-tenant (1.0.0)
5
- rails (>= 4.0)
6
- request_store (>= 1.0.5)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actioncable (5.0.1)
12
- actionpack (= 5.0.1)
13
- nio4r (~> 1.2)
14
- websocket-driver (~> 0.6.1)
15
- actionmailer (5.0.1)
16
- actionpack (= 5.0.1)
17
- actionview (= 5.0.1)
18
- activejob (= 5.0.1)
19
- mail (~> 2.5, >= 2.5.4)
20
- rails-dom-testing (~> 2.0)
21
- actionpack (5.0.1)
22
- actionview (= 5.0.1)
23
- activesupport (= 5.0.1)
24
- rack (~> 2.0)
25
- rack-test (~> 0.6.3)
26
- rails-dom-testing (~> 2.0)
27
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.0.1)
29
- activesupport (= 5.0.1)
30
- builder (~> 3.1)
31
- erubis (~> 2.7.0)
32
- rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
- activejob (5.0.1)
35
- activesupport (= 5.0.1)
36
- globalid (>= 0.3.6)
37
- activemodel (5.0.1)
38
- activesupport (= 5.0.1)
39
- activerecord (5.0.1)
40
- activemodel (= 5.0.1)
41
- activesupport (= 5.0.1)
42
- arel (~> 7.0)
43
- activesupport (5.0.1)
44
- concurrent-ruby (~> 1.0, >= 1.0.2)
45
- i18n (~> 0.7)
46
- minitest (~> 5.1)
47
- tzinfo (~> 1.1)
48
- appraisal (2.1.0)
49
- bundler
50
- rake
51
- thor (>= 0.14.0)
52
- arel (7.1.4)
53
- builder (3.2.3)
54
- byebug (9.0.6)
55
- coderay (1.1.1)
56
- concurrent-ruby (1.0.5)
57
- connection_pool (2.2.1)
58
- diff-lcs (1.3)
59
- erubis (2.7.0)
60
- globalid (0.3.7)
61
- activesupport (>= 4.1.0)
62
- i18n (0.8.1)
63
- loofah (2.0.3)
64
- nokogiri (>= 1.5.9)
65
- mail (2.6.4)
66
- mime-types (>= 1.16, < 4)
67
- method_source (0.8.2)
68
- mime-types (3.1)
69
- mime-types-data (~> 3.2015)
70
- mime-types-data (3.2016.0521)
71
- mini_portile2 (2.1.0)
72
- minitest (5.10.1)
73
- nio4r (1.2.1)
74
- nokogiri (1.7.1)
75
- mini_portile2 (~> 2.1.0)
76
- pg (0.20.0)
77
- pry (0.10.4)
78
- coderay (~> 1.1.0)
79
- method_source (~> 0.8.1)
80
- slop (~> 3.4)
81
- pry-byebug (3.4.2)
82
- byebug (~> 9.0)
83
- pry (~> 0.10)
84
- rack (2.0.1)
85
- rack-protection (1.5.3)
86
- rack
87
- rack-test (0.6.3)
88
- rack (>= 1.0)
89
- rails (5.0.1)
90
- actioncable (= 5.0.1)
91
- actionmailer (= 5.0.1)
92
- actionpack (= 5.0.1)
93
- actionview (= 5.0.1)
94
- activejob (= 5.0.1)
95
- activemodel (= 5.0.1)
96
- activerecord (= 5.0.1)
97
- activesupport (= 5.0.1)
98
- bundler (>= 1.3.0, < 2.0)
99
- railties (= 5.0.1)
100
- sprockets-rails (>= 2.0.0)
101
- rails-dom-testing (2.0.2)
102
- activesupport (>= 4.2.0, < 6.0)
103
- nokogiri (~> 1.6)
104
- rails-html-sanitizer (1.0.3)
105
- loofah (~> 2.0)
106
- railties (5.0.1)
107
- actionpack (= 5.0.1)
108
- activesupport (= 5.0.1)
109
- method_source
110
- rake (>= 0.8.7)
111
- thor (>= 0.18.1, < 2.0)
112
- rake (12.0.0)
113
- redis (3.3.3)
114
- request_store (1.4.1)
115
- rack (>= 1.4)
116
- rspec (3.5.0)
117
- rspec-core (~> 3.5.0)
118
- rspec-expectations (~> 3.5.0)
119
- rspec-mocks (~> 3.5.0)
120
- rspec-core (3.5.4)
121
- rspec-support (~> 3.5.0)
122
- rspec-expectations (3.5.0)
123
- diff-lcs (>= 1.2.0, < 2.0)
124
- rspec-support (~> 3.5.0)
125
- rspec-mocks (3.5.0)
126
- diff-lcs (>= 1.2.0, < 2.0)
127
- rspec-support (~> 3.5.0)
128
- rspec-rails (3.5.2)
129
- actionpack (>= 3.0)
130
- activesupport (>= 3.0)
131
- railties (>= 3.0)
132
- rspec-core (~> 3.5.0)
133
- rspec-expectations (~> 3.5.0)
134
- rspec-mocks (~> 3.5.0)
135
- rspec-support (~> 3.5.0)
136
- rspec-support (3.5.0)
137
- sidekiq (4.2.10)
138
- concurrent-ruby (~> 1.0)
139
- connection_pool (~> 2.2, >= 2.2.0)
140
- rack-protection (>= 1.5.0)
141
- redis (~> 3.2, >= 3.2.1)
142
- slop (3.6.0)
143
- sprockets (3.7.1)
144
- concurrent-ruby (~> 1.0)
145
- rack (> 1, < 3)
146
- sprockets-rails (3.2.0)
147
- actionpack (>= 4.0)
148
- activesupport (>= 4.0)
149
- sprockets (>= 3.0.0)
150
- thor (0.19.4)
151
- thread_safe (0.3.6)
152
- tzinfo (1.2.2)
153
- thread_safe (~> 0.1)
154
- websocket-driver (0.6.5)
155
- websocket-extensions (>= 0.1.0)
156
- websocket-extensions (0.1.2)
157
-
158
- PLATFORMS
159
- ruby
160
-
161
- DEPENDENCIES
162
- activerecord-multi-tenant!
163
- appraisal
164
- pg
165
- pry
166
- pry-byebug
167
- rails (= 5.0.1)
168
- rake
169
- rspec (>= 3.0)
170
- rspec-rails
171
- sidekiq
172
- thor
173
-
174
- BUNDLED WITH
175
- 1.17.2