activerecord-multi-tenant 1.0.1 → 1.1.1

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