acts_as_multi_tenant 2.0.0.pre.rc4 → 2.0.0.pre.rc5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac7daaee9a739a8973d0d53c8d073ea60bafccaee32b61d19918803746b2a9f4
4
- data.tar.gz: e136dd897d170864a5da44354724039aac95fe3ac386a29ab5b29602cc6303fd
3
+ metadata.gz: 162a5f77db2aebe2dc47c39907bfc062f243270332e6c131f6b5033096c28d8a
4
+ data.tar.gz: b7b940ef2683d892d17743e7bd871606ef911bdf23a0c9dd9cf3471bfb8a9f2c
5
5
  SHA512:
6
- metadata.gz: c657dea1c4e15a5f6de2df7d369074b7e3464a33ce1827381e7ba8443e376c3d31c325e5607b92b468b71c057bb0fc5f554c6a7886908061e07fb2bee27eb045
7
- data.tar.gz: d95a1cf54b85204e84139ea011a6cdab1096059b353991df0e396ee986fe5025402dd027c9854ba9479c948b3878ea9093f60c2464ca6f117b4dd9f1bfcc188c
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| x.is_a? self }
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?(:model_name) and x.class.model_name.to_s == tenant_class.model_name.to_s
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
@@ -1,4 +1,4 @@
1
1
  module MultiTenant
2
2
  # Gem version
3
- VERSION = '2.0.0.pre.rc4'.freeze
3
+ VERSION = '2.0.0.pre.rc5'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_multi_tenant
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.rc4
4
+ version: 2.0.0.pre.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Hollinger