activerecord-multi-tenant 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -28
  3. data/Appraisals +6 -49
  4. data/Gemfile.lock +77 -61
  5. data/gemfiles/active_record_5.2.gemfile +2 -1
  6. data/gemfiles/active_record_5.2.gemfile.lock +38 -38
  7. data/gemfiles/active_record_6.0.gemfile +1 -1
  8. data/gemfiles/active_record_6.0.gemfile.lock +95 -95
  9. data/gemfiles/rails_5.2.gemfile +2 -1
  10. data/gemfiles/rails_5.2.gemfile.lock +38 -38
  11. data/gemfiles/rails_6.0.gemfile +1 -1
  12. data/gemfiles/rails_6.0.gemfile.lock +95 -95
  13. data/lib/activerecord-multi-tenant/controller_extensions.rb +2 -6
  14. data/lib/activerecord-multi-tenant/copy_from_client.rb +2 -2
  15. data/lib/activerecord-multi-tenant/migrations.rb +2 -2
  16. data/lib/activerecord-multi-tenant/model_extensions.rb +3 -9
  17. data/lib/activerecord-multi-tenant/multi_tenant.rb +1 -0
  18. data/lib/activerecord-multi-tenant/query_rewriter.rb +22 -73
  19. data/lib/activerecord-multi-tenant/sidekiq.rb +2 -1
  20. data/lib/activerecord-multi-tenant/version.rb +1 -1
  21. data/spec/activerecord-multi-tenant/controller_extensions_spec.rb +19 -24
  22. data/spec/activerecord-multi-tenant/model_extensions_spec.rb +6 -30
  23. data/spec/activerecord-multi-tenant/query_rewriter_spec.rb +8 -0
  24. data/spec/activerecord-multi-tenant/sidekiq_spec.rb +4 -4
  25. data/spec/schema.rb +1 -4
  26. data/spec/spec_helper.rb +1 -6
  27. metadata +6 -14
  28. data/gemfiles/active_record_5.1.gemfile +0 -15
  29. data/gemfiles/active_record_5.1.gemfile.lock +0 -180
  30. data/gemfiles/rails_4.2.gemfile +0 -16
  31. data/gemfiles/rails_4.2.gemfile.lock +0 -175
  32. data/gemfiles/rails_5.0.gemfile +0 -15
  33. data/gemfiles/rails_5.0.gemfile.lock +0 -180
  34. data/gemfiles/rails_5.1.gemfile +0 -15
  35. data/gemfiles/rails_5.1.gemfile.lock +0 -180
@@ -3,6 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "rails", "~> 6.0.0"
6
+ gem "rails", "~> 6.0.3"
7
7
 
8
8
  gemspec path: "../"
@@ -1,165 +1,165 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- activerecord-multi-tenant (1.0.4)
4
+ activerecord-multi-tenant (1.1.0)
5
5
  rails (>= 4.2)
6
6
  request_store (>= 1.0.5)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (6.0.0)
12
- actionpack (= 6.0.0)
11
+ actioncable (6.0.3.1)
12
+ actionpack (= 6.0.3.1)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (6.0.0)
16
- actionpack (= 6.0.0)
17
- activejob (= 6.0.0)
18
- activerecord (= 6.0.0)
19
- activestorage (= 6.0.0)
20
- activesupport (= 6.0.0)
15
+ actionmailbox (6.0.3.1)
16
+ actionpack (= 6.0.3.1)
17
+ activejob (= 6.0.3.1)
18
+ activerecord (= 6.0.3.1)
19
+ activestorage (= 6.0.3.1)
20
+ activesupport (= 6.0.3.1)
21
21
  mail (>= 2.7.1)
22
- actionmailer (6.0.0)
23
- actionpack (= 6.0.0)
24
- actionview (= 6.0.0)
25
- activejob (= 6.0.0)
22
+ actionmailer (6.0.3.1)
23
+ actionpack (= 6.0.3.1)
24
+ actionview (= 6.0.3.1)
25
+ activejob (= 6.0.3.1)
26
26
  mail (~> 2.5, >= 2.5.4)
27
27
  rails-dom-testing (~> 2.0)
28
- actionpack (6.0.0)
29
- actionview (= 6.0.0)
30
- activesupport (= 6.0.0)
31
- rack (~> 2.0)
28
+ actionpack (6.0.3.1)
29
+ actionview (= 6.0.3.1)
30
+ activesupport (= 6.0.3.1)
31
+ rack (~> 2.0, >= 2.0.8)
32
32
  rack-test (>= 0.6.3)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
35
- actiontext (6.0.0)
36
- actionpack (= 6.0.0)
37
- activerecord (= 6.0.0)
38
- activestorage (= 6.0.0)
39
- activesupport (= 6.0.0)
35
+ actiontext (6.0.3.1)
36
+ actionpack (= 6.0.3.1)
37
+ activerecord (= 6.0.3.1)
38
+ activestorage (= 6.0.3.1)
39
+ activesupport (= 6.0.3.1)
40
40
  nokogiri (>= 1.8.5)
41
- actionview (6.0.0)
42
- activesupport (= 6.0.0)
41
+ actionview (6.0.3.1)
42
+ activesupport (= 6.0.3.1)
43
43
  builder (~> 3.1)
44
44
  erubi (~> 1.4)
45
45
  rails-dom-testing (~> 2.0)
46
46
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
47
- activejob (6.0.0)
48
- activesupport (= 6.0.0)
47
+ activejob (6.0.3.1)
48
+ activesupport (= 6.0.3.1)
49
49
  globalid (>= 0.3.6)
50
- activemodel (6.0.0)
51
- activesupport (= 6.0.0)
52
- activerecord (6.0.0)
53
- activemodel (= 6.0.0)
54
- activesupport (= 6.0.0)
55
- activestorage (6.0.0)
56
- actionpack (= 6.0.0)
57
- activejob (= 6.0.0)
58
- activerecord (= 6.0.0)
50
+ activemodel (6.0.3.1)
51
+ activesupport (= 6.0.3.1)
52
+ activerecord (6.0.3.1)
53
+ activemodel (= 6.0.3.1)
54
+ activesupport (= 6.0.3.1)
55
+ activestorage (6.0.3.1)
56
+ actionpack (= 6.0.3.1)
57
+ activejob (= 6.0.3.1)
58
+ activerecord (= 6.0.3.1)
59
59
  marcel (~> 0.3.1)
60
- activesupport (6.0.0)
60
+ activesupport (6.0.3.1)
61
61
  concurrent-ruby (~> 1.0, >= 1.0.2)
62
62
  i18n (>= 0.7, < 2)
63
63
  minitest (~> 5.1)
64
64
  tzinfo (~> 1.1)
65
- zeitwerk (~> 2.1, >= 2.1.8)
65
+ zeitwerk (~> 2.2, >= 2.2.2)
66
66
  appraisal (2.2.0)
67
67
  bundler
68
68
  rake
69
69
  thor (>= 0.14.0)
70
- builder (3.2.3)
71
- byebug (11.0.1)
70
+ builder (3.2.4)
71
+ byebug (11.1.3)
72
72
  coderay (1.1.2)
73
- concurrent-ruby (1.1.5)
73
+ concurrent-ruby (1.1.6)
74
74
  connection_pool (2.2.2)
75
- crass (1.0.4)
75
+ crass (1.0.6)
76
76
  diff-lcs (1.3)
77
77
  erubi (1.9.0)
78
78
  globalid (0.4.2)
79
79
  activesupport (>= 4.2.0)
80
- i18n (1.7.0)
80
+ i18n (1.8.2)
81
81
  concurrent-ruby (~> 1.0)
82
- loofah (2.3.0)
82
+ loofah (2.5.0)
83
83
  crass (~> 1.0.2)
84
84
  nokogiri (>= 1.5.9)
85
85
  mail (2.7.1)
86
86
  mini_mime (>= 0.1.1)
87
87
  marcel (0.3.3)
88
88
  mimemagic (~> 0.3.2)
89
- method_source (0.9.2)
90
- mimemagic (0.3.3)
89
+ method_source (1.0.0)
90
+ mimemagic (0.3.5)
91
91
  mini_mime (1.0.2)
92
92
  mini_portile2 (2.4.0)
93
- minitest (5.12.2)
93
+ minitest (5.14.1)
94
94
  nio4r (2.5.2)
95
- nokogiri (1.10.4)
95
+ nokogiri (1.10.9)
96
96
  mini_portile2 (~> 2.4.0)
97
- pg (1.1.4)
98
- pry (0.12.2)
99
- coderay (~> 1.1.0)
100
- method_source (~> 0.9.0)
101
- pry-byebug (3.7.0)
97
+ pg (1.2.3)
98
+ pry (0.13.1)
99
+ coderay (~> 1.1)
100
+ method_source (~> 1.0)
101
+ pry-byebug (3.9.0)
102
102
  byebug (~> 11.0)
103
- pry (~> 0.10)
104
- rack (2.0.7)
105
- rack-protection (2.0.7)
103
+ pry (~> 0.13.0)
104
+ rack (2.2.2)
105
+ rack-protection (2.0.8.1)
106
106
  rack
107
107
  rack-test (1.1.0)
108
108
  rack (>= 1.0, < 3)
109
- rails (6.0.0)
110
- actioncable (= 6.0.0)
111
- actionmailbox (= 6.0.0)
112
- actionmailer (= 6.0.0)
113
- actionpack (= 6.0.0)
114
- actiontext (= 6.0.0)
115
- actionview (= 6.0.0)
116
- activejob (= 6.0.0)
117
- activemodel (= 6.0.0)
118
- activerecord (= 6.0.0)
119
- activestorage (= 6.0.0)
120
- activesupport (= 6.0.0)
109
+ rails (6.0.3.1)
110
+ actioncable (= 6.0.3.1)
111
+ actionmailbox (= 6.0.3.1)
112
+ actionmailer (= 6.0.3.1)
113
+ actionpack (= 6.0.3.1)
114
+ actiontext (= 6.0.3.1)
115
+ actionview (= 6.0.3.1)
116
+ activejob (= 6.0.3.1)
117
+ activemodel (= 6.0.3.1)
118
+ activerecord (= 6.0.3.1)
119
+ activestorage (= 6.0.3.1)
120
+ activesupport (= 6.0.3.1)
121
121
  bundler (>= 1.3.0)
122
- railties (= 6.0.0)
122
+ railties (= 6.0.3.1)
123
123
  sprockets-rails (>= 2.0.0)
124
124
  rails-dom-testing (2.0.3)
125
125
  activesupport (>= 4.2.0)
126
126
  nokogiri (>= 1.6)
127
127
  rails-html-sanitizer (1.3.0)
128
128
  loofah (~> 2.3)
129
- railties (6.0.0)
130
- actionpack (= 6.0.0)
131
- activesupport (= 6.0.0)
129
+ railties (6.0.3.1)
130
+ actionpack (= 6.0.3.1)
131
+ activesupport (= 6.0.3.1)
132
132
  method_source
133
133
  rake (>= 0.8.7)
134
134
  thor (>= 0.20.3, < 2.0)
135
- rake (13.0.0)
136
- redis (4.1.3)
137
- request_store (1.4.1)
135
+ rake (13.0.1)
136
+ redis (4.1.4)
137
+ request_store (1.5.0)
138
138
  rack (>= 1.4)
139
139
  rspec (3.9.0)
140
140
  rspec-core (~> 3.9.0)
141
141
  rspec-expectations (~> 3.9.0)
142
142
  rspec-mocks (~> 3.9.0)
143
- rspec-core (3.9.0)
144
- rspec-support (~> 3.9.0)
145
- rspec-expectations (3.9.0)
143
+ rspec-core (3.9.2)
144
+ rspec-support (~> 3.9.3)
145
+ rspec-expectations (3.9.2)
146
146
  diff-lcs (>= 1.2.0, < 2.0)
147
147
  rspec-support (~> 3.9.0)
148
- rspec-mocks (3.9.0)
148
+ rspec-mocks (3.9.1)
149
149
  diff-lcs (>= 1.2.0, < 2.0)
150
150
  rspec-support (~> 3.9.0)
151
- rspec-rails (3.9.0)
152
- actionpack (>= 3.0)
153
- activesupport (>= 3.0)
154
- railties (>= 3.0)
155
- rspec-core (~> 3.9.0)
156
- rspec-expectations (~> 3.9.0)
157
- rspec-mocks (~> 3.9.0)
158
- rspec-support (~> 3.9.0)
159
- rspec-support (3.9.0)
160
- sidekiq (6.0.1)
151
+ rspec-rails (4.0.1)
152
+ actionpack (>= 4.2)
153
+ activesupport (>= 4.2)
154
+ railties (>= 4.2)
155
+ rspec-core (~> 3.9)
156
+ rspec-expectations (~> 3.9)
157
+ rspec-mocks (~> 3.9)
158
+ rspec-support (~> 3.9)
159
+ rspec-support (3.9.3)
160
+ sidekiq (6.0.7)
161
161
  connection_pool (>= 2.2.2)
162
- rack (>= 2.0.0)
162
+ rack (~> 2.0)
163
163
  rack-protection (>= 2.0.0)
164
164
  redis (>= 4.1.0)
165
165
  sprockets (4.0.0)
@@ -169,14 +169,14 @@ GEM
169
169
  actionpack (>= 4.0)
170
170
  activesupport (>= 4.0)
171
171
  sprockets (>= 3.0.0)
172
- thor (0.20.3)
172
+ thor (1.0.1)
173
173
  thread_safe (0.3.6)
174
- tzinfo (1.2.5)
174
+ tzinfo (1.2.7)
175
175
  thread_safe (~> 0.1)
176
- websocket-driver (0.7.1)
176
+ websocket-driver (0.7.2)
177
177
  websocket-extensions (>= 0.1.0)
178
178
  websocket-extensions (0.1.4)
179
- zeitwerk (2.2.0)
179
+ zeitwerk (2.3.0)
180
180
 
181
181
  PLATFORMS
182
182
  ruby
@@ -187,7 +187,7 @@ DEPENDENCIES
187
187
  pg
188
188
  pry
189
189
  pry-byebug
190
- rails (~> 6.0.0)
190
+ rails (~> 6.0.3)
191
191
  rake
192
192
  rspec (>= 3.0)
193
193
  rspec-rails
@@ -195,4 +195,4 @@ DEPENDENCIES
195
195
  thor
196
196
 
197
197
  BUNDLED WITH
198
- 1.17.3
198
+ 2.1.4
@@ -20,10 +20,6 @@ module MultiTenant
20
20
  end
21
21
  end
22
22
 
23
- if defined?(ActionController::Base)
24
- ActionController::Base.extend MultiTenant::ControllerExtensions
25
- end
26
-
27
- if defined?(ActionController::API)
28
- ActionController::API.extend MultiTenant::ControllerExtensions
23
+ ActiveSupport.on_load(:action_controller) do |base|
24
+ base.extend MultiTenant::ControllerExtensions
29
25
  end
@@ -28,6 +28,6 @@ module MultiTenant
28
28
  end
29
29
  end
30
30
 
31
- if defined?(ActiveRecord::Base)
32
- ActiveRecord::Base.extend(MultiTenant::CopyFromClient)
31
+ ActiveSupport.on_load(:active_record) do |base|
32
+ base.extend(MultiTenant::CopyFromClient)
33
33
  end
@@ -44,10 +44,10 @@ module ActiveRecord
44
44
  module SchemaStatements
45
45
  alias :orig_create_table :create_table
46
46
  def create_table(table_name, options = {}, &block)
47
- ret = orig_create_table(table_name, options.except(:partition_key), &block)
47
+ ret = orig_create_table(table_name, **options.except(:partition_key), &block)
48
48
  if options[:partition_key] && options[:partition_key].to_s != 'id'
49
49
  execute "ALTER TABLE #{table_name} DROP CONSTRAINT #{table_name}_pkey"
50
- execute "ALTER TABLE #{table_name} ADD PRIMARY KEY(id, \"#{options[:partition_key]}\")"
50
+ execute "ALTER TABLE #{table_name} ADD PRIMARY KEY(\"#{options[:partition_key]}\", id)"
51
51
  end
52
52
  ret
53
53
  end
@@ -24,11 +24,6 @@ module MultiTenant
24
24
  def primary_key
25
25
  return @primary_key if @primary_key
26
26
 
27
- if ::ActiveRecord::VERSION::MAJOR < 5
28
- @primary_key = super || DEFAULT_ID_FIELD
29
- return @primary_key if connection.schema_cache.columns_hash(table_name).include? @primary_key
30
- end
31
-
32
27
  primary_object_keys = Array.wrap(connection.schema_cache.primary_keys(table_name)) - [partition_key]
33
28
 
34
29
  if primary_object_keys.size == 1
@@ -54,7 +49,7 @@ module MultiTenant
54
49
 
55
50
  # Create an implicit belongs_to association only if tenant class exists
56
51
  if MultiTenant.tenant_klass_defined?(tenant_name)
57
- belongs_to tenant_name, options.slice(:class_name, :inverse_of).merge(foreign_key: options[:partition_key])
52
+ belongs_to tenant_name, **options.slice(:class_name, :inverse_of).merge(foreign_key: options[:partition_key])
58
53
  end
59
54
 
60
55
  # New instances should have the tenant set
@@ -126,11 +121,10 @@ module MultiTenant
126
121
  end
127
122
  end
128
123
 
129
- if defined?(ActiveRecord::Base)
130
- ActiveRecord::Base.extend(MultiTenant::ModelExtensionsClassMethods)
124
+ ActiveSupport.on_load(:active_record) do |base|
125
+ base.extend MultiTenant::ModelExtensionsClassMethods
131
126
  end
132
127
 
133
-
134
128
  class ActiveRecord::Associations::Association
135
129
  alias skip_statement_cache_orig skip_statement_cache?
136
130
  def skip_statement_cache?(*scope)
@@ -34,6 +34,7 @@ module MultiTenant
34
34
  end
35
35
 
36
36
  def self.multi_tenant_model_for_arel(arel)
37
+ return nil unless arel.respond_to?(:ast)
37
38
  if arel.ast.relation.is_a? Arel::Nodes::JoinSource
38
39
  MultiTenant.multi_tenant_model_for_table(arel.ast.relation.left.table_name)
39
40
  else
@@ -224,22 +224,20 @@ module MultiTenant
224
224
  delete
225
225
  end
226
226
 
227
- if (ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 5
228
- def update(arel, name = nil, binds = [])
229
- model = MultiTenant.multi_tenant_model_for_arel(arel)
230
- if model.present? && !MultiTenant.with_write_only_mode_enabled? && MultiTenant.current_tenant_id.present?
231
- arel.where(MultiTenant::TenantEnforcementClause.new(model.arel_table[model.partition_key]))
232
- end
233
- super(arel, name, binds)
227
+ def update(arel, name = nil, binds = [])
228
+ model = MultiTenant.multi_tenant_model_for_arel(arel)
229
+ if model.present? && !MultiTenant.with_write_only_mode_enabled? && MultiTenant.current_tenant_id.present?
230
+ arel.where(MultiTenant::TenantEnforcementClause.new(model.arel_table[model.partition_key]))
234
231
  end
232
+ super(arel, name, binds)
233
+ end
235
234
 
236
- def delete(arel, name = nil, binds = [])
237
- model = MultiTenant.multi_tenant_model_for_arel(arel)
238
- if model.present? && !MultiTenant.with_write_only_mode_enabled? && MultiTenant.current_tenant_id.present?
239
- arel.where(MultiTenant::TenantEnforcementClause.new(model.arel_table[model.partition_key]))
240
- end
241
- super(arel, name, binds)
235
+ def delete(arel, name = nil, binds = [])
236
+ model = MultiTenant.multi_tenant_model_for_arel(arel)
237
+ if model.present? && !MultiTenant.with_write_only_mode_enabled? && MultiTenant.current_tenant_id.present?
238
+ arel.where(MultiTenant::TenantEnforcementClause.new(model.arel_table[model.partition_key]))
242
239
  end
240
+ super(arel, name, binds)
243
241
  end
244
242
  end
245
243
  end
@@ -290,7 +288,7 @@ module ActiveRecord
290
288
 
291
289
  node_list.select{ |n| n.is_a? Arel::Nodes::Join }.each do |node_join|
292
290
  if (!node_join.right ||
293
- (ActiveRecord::VERSION::MAJOR <= 5 &&
291
+ (ActiveRecord::VERSION::MAJOR == 5 &&
294
292
  !node_join.right.expr.right.is_a?(Arel::Attributes::Attribute)))
295
293
  next
296
294
  end
@@ -316,7 +314,7 @@ module ActiveRecord
316
314
 
317
315
  private
318
316
  def relations_from_node_join(node_join)
319
- if ActiveRecord::VERSION::MAJOR <= 5 || node_join.right.expr.is_a?(Arel::Nodes::Equality)
317
+ if ActiveRecord::VERSION::MAJOR == 5 || node_join.right.expr.is_a?(Arel::Nodes::Equality)
320
318
  return node_join.right.expr.right.relation, node_join.right.expr.left.relation
321
319
  end
322
320
 
@@ -327,71 +325,22 @@ module ActiveRecord
327
325
  return nil, nil
328
326
  end
329
327
 
330
- return children[0].right.relation, children[0].left.relation
328
+ if children[0].right.respond_to?('relation') && children[0].left.respond_to?('relation')
329
+ return children[0].right.relation, children[0].left.relation
330
+ end
331
+
332
+ return nil, nil
331
333
  end
332
334
  end
333
335
  end
334
336
 
335
337
  require 'active_record/base'
336
338
  module MultiTenantFindBy
337
- if ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2
338
- # Disable caching for find and find_by in Rails 4.2 - we don't have a good
339
- # way to prevent caching problems here when prepared statements are enabled
340
- def find_by(*args)
341
- return super unless respond_to?(:scoped_by_tenant?) && scoped_by_tenant?
342
-
343
- # This duplicates a bunch of code from AR's find() method
344
- return super if current_scope || !(Hash === args.first) || reflect_on_all_aggregations.any?
345
- return super if default_scopes.any?
346
-
347
- hash = args.first
348
-
349
- return super if hash.values.any? { |v| v.nil? || Array === v || Hash === v }
350
- return super unless hash.keys.all? { |k| columns_hash.has_key?(k.to_s) }
351
-
352
- key = hash.keys
339
+ def cached_find_by_statement(key, &block)
340
+ return super unless respond_to?(:scoped_by_tenant?) && scoped_by_tenant?
353
341
 
354
- # Ensure we never use the cached version
355
- find_by_statement_cache.synchronize { find_by_statement_cache[key] = nil }
356
-
357
- super
358
- end
359
-
360
- def find(*ids)
361
- return super unless respond_to?(:scoped_by_tenant?) && scoped_by_tenant?
362
-
363
- # This duplicates a bunch of code from AR's find() method
364
- return super unless ids.length == 1
365
- return super if ids.first.kind_of?(Symbol)
366
- return super if block_given? ||
367
- primary_key.nil? ||
368
- default_scopes.any? ||
369
- current_scope ||
370
- columns_hash.include?(inheritance_column) ||
371
- ids.first.kind_of?(Array)
372
-
373
- id = ids.first
374
- if ActiveRecord::Base === id
375
- id = id.id
376
- ActiveSupport::Deprecation.warn(<<-MSG.squish)
377
- You are passing an instance of ActiveRecord::Base to `find`.
378
- Please pass the id of the object by calling `.id`
379
- MSG
380
- end
381
- key = primary_key
382
-
383
- # Ensure we never use the cached version
384
- find_by_statement_cache.synchronize { find_by_statement_cache[key] = nil }
385
-
386
- super
387
- end
388
- elsif ActiveRecord::VERSION::MAJOR > 4
389
- def cached_find_by_statement(key, &block)
390
- return super unless respond_to?(:scoped_by_tenant?) && scoped_by_tenant?
391
-
392
- key = Array.wrap(key) + [MultiTenant.current_tenant_id.to_s]
393
- super(key, &block)
394
- end
342
+ key = Array.wrap(key) + [MultiTenant.current_tenant_id.to_s]
343
+ super(key, &block)
395
344
  end
396
345
  end
397
346