Exception: MultiTenant::TenantsNotFound
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- MultiTenant::TenantsNotFound
- Defined in:
- lib/acts_as_multi_tenant.rb
Instance Attribute Summary collapse
-
#tenant_class ⇒ Object
readonly
Returns the value of attribute tenant_class.
Instance Method Summary collapse
-
#initialize(tenant_class, identifiers, found_records) ⇒ TenantsNotFound
constructor
A new instance of TenantsNotFound.
- #message ⇒ Object
-
#not_found ⇒ Object
Returns an array of the tenant identifiers that could not be found.
- #to_s ⇒ Object
Constructor Details
#initialize(tenant_class, identifiers, found_records) ⇒ TenantsNotFound
Returns a new instance of TenantsNotFound.
15 16 17 18 19 |
# File 'lib/acts_as_multi_tenant.rb', line 15 def initialize(tenant_class, identifiers, found_records) @tenant_class = tenant_class @identifiers = identifiers @found_records = found_records end |
Instance Attribute Details
#tenant_class ⇒ Object (readonly)
Returns the value of attribute tenant_class.
13 14 15 |
# File 'lib/acts_as_multi_tenant.rb', line 13 def tenant_class @tenant_class end |
Instance Method Details
#message ⇒ Object
32 33 34 |
# File 'lib/acts_as_multi_tenant.rb', line 32 def "The following #{@tenant_class.name} tenants could not be found: #{not_found.join ", "}" end |
#not_found ⇒ Object
Returns an array of the tenant identifiers that could not be found
22 23 24 25 26 |
# File 'lib/acts_as_multi_tenant.rb', line 22 def not_found @not_found ||= @identifiers.map(&:to_s) - @found_records.map { |tenant| tenant.send(@tenant_class.tenant_identifier).to_s } end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/acts_as_multi_tenant.rb', line 28 def to_s end |