acts_as_multi_tenant 2.0.0.pre.rc4 → 2.0.0.pre.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/multi_tenant/acts_as_tenant.rb +3 -1
- data/lib/multi_tenant/middleware.rb +1 -1
- data/lib/multi_tenant/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 162a5f77db2aebe2dc47c39907bfc062f243270332e6c131f6b5033096c28d8a
|
4
|
+
data.tar.gz: b7b940ef2683d892d17743e7bd871606ef911bdf23a0c9dd9cf3471bfb8a9f2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3e946ae89ea16bf870032ad8e5254993b0bbc8c10b5492708fa19731a6a004a301fe581a6c7528c1508c4ab7b7407f4afcaa65643be33128a8505fb84cdd352
|
7
|
+
data.tar.gz: f8867152d0f4a3bbc45af5d2bbd4764c27753ef4b9f93433399c0c6c0d4b991e2d877b9899c53e63b9115666dac4f4da4daeff12ade9ab9da7d0af961e3664b7
|
@@ -102,7 +102,9 @@ module MultiTenant
|
|
102
102
|
# @param records_or_identifiers array of the records or identifiers in the 'tenant_identifier' column.
|
103
103
|
#
|
104
104
|
def current_tenants=(records_or_identifiers)
|
105
|
-
records, identifiers = Array(records_or_identifiers).partition { |x|
|
105
|
+
records, identifiers = Array(records_or_identifiers).partition { |x|
|
106
|
+
x.class.respond_to?(:table_name) && x.class.table_name == self.table_name
|
107
|
+
}
|
106
108
|
tenants = if identifiers.any?
|
107
109
|
records + where({tenant_identifier => identifiers}).to_a
|
108
110
|
else
|
@@ -115,7 +115,7 @@ module MultiTenant
|
|
115
115
|
|
116
116
|
def identifiers(records_or_identifiers)
|
117
117
|
records_or_identifiers.map { |x|
|
118
|
-
if x.class.respond_to?(:
|
118
|
+
if x.class.respond_to?(:table_name) and x.class.table_name == tenant_class.table_name
|
119
119
|
x.send tenant_class.tenant_identifier
|
120
120
|
else
|
121
121
|
x.to_s
|
data/lib/multi_tenant/version.rb
CHANGED