Class: Veri::Inputs::Tenant
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Veri::Inputs::Base
Instance Method Details
#resolve ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/veri/inputs/tenant.rb', line 4 def resolve case tenant = process when nil { tenant_type: nil, tenant_id: nil } when String { tenant_type: tenant, tenant_id: nil } when ActiveRecord::Base raise_error unless tenant.persisted? { tenant_type: tenant.class.to_s, tenant_id: tenant.public_send(tenant.class.primary_key) } else tenant end end |