acts_as_tenant 2.0.0 → 2.0.1
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 +4 -4
- data/lib/acts_as_tenant/model_extensions.rb +1 -1
- data/lib/acts_as_tenant/version.rb +1 -1
- data/lib/acts_as_tenant.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a241e056fc0e64709f94c3b8df2d91d192fa904a990bff28e951fceec7071351
|
|
4
|
+
data.tar.gz: d57c2ebb29e624ccacaa4b031214539a2a28363da65a653a9a75172e9f3a29dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed5452f120dc6beaafee9952a3850d0378a212a081eecc5783115733e045e3e7658827bc0992e9e97101990751e3cfae5940379cee24d7a272e123ecfa4d51d6
|
|
7
|
+
data.tar.gz: b4890ebc99294ece2e1e487c088800c7c5374baeee4d67a0e538e71051079589455562452bb1cf62d6f9d910777b29fbc4beab5f93da52250a8817577fbaa090
|
|
@@ -124,7 +124,7 @@ module ActsAsTenant
|
|
|
124
124
|
value = record.read_attribute_for_validation(attr)
|
|
125
125
|
next if value.nil?
|
|
126
126
|
|
|
127
|
-
relation = a.scope ? a.
|
|
127
|
+
relation = a.scope ? a.scope_for(a.klass.all, record) : a.klass
|
|
128
128
|
associated = relation.find_by(a.association_primary_key => value)
|
|
129
129
|
|
|
130
130
|
if associated.nil? || tenant_mismatch.call(record, associated)
|
data/lib/acts_as_tenant.rb
CHANGED
|
@@ -109,7 +109,7 @@ module ActsAsTenant
|
|
|
109
109
|
def self.with_tenant(tenant, &block)
|
|
110
110
|
raise ArgumentError, "block required" if block.nil?
|
|
111
111
|
|
|
112
|
-
Current.set(current_tenant: tenant
|
|
112
|
+
Current.set(current_tenant: tenant) { block.call }
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
def self.without_tenant(&block)
|
|
@@ -118,7 +118,7 @@ module ActsAsTenant
|
|
|
118
118
|
old_test_tenant = test_tenant
|
|
119
119
|
self.test_tenant = nil
|
|
120
120
|
begin
|
|
121
|
-
Current.set(current_tenant: nil, acts_as_tenant_unscoped: true
|
|
121
|
+
Current.set(current_tenant: nil, acts_as_tenant_unscoped: true) { block.call }
|
|
122
122
|
ensure
|
|
123
123
|
self.test_tenant = old_test_tenant
|
|
124
124
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: acts_as_tenant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Erwin Matthijssen
|
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
69
|
version: '0'
|
|
70
70
|
requirements: []
|
|
71
|
-
rubygems_version: 4.0.
|
|
71
|
+
rubygems_version: 4.0.20
|
|
72
72
|
specification_version: 4
|
|
73
73
|
summary: Add multi-tenancy to Rails applications using a shared db strategy
|
|
74
74
|
test_files: []
|