Module: MultiTenant::ProxiesToTenant::ProxiesToTenantPluralInverseAssociation

Defined in:
lib/multi_tenant/proxies_to_tenant.rb

Overview

Class methods for tenant proxies that have a plural inverse association (i.e. has_many). NOTE These are just some thoughts on maybe how to support this if we ever need it.

Instance Method Summary collapse

Instance Method Details

#current_tenantObject

Returns the current record of the proxy model



118
119
120
121
122
123
# File 'lib/multi_tenant/proxies_to_tenant.rb', line 118

def current_tenant
  raise MultiTenant::NotImplemented, "needs confirmed"
  if (tenant = proxied_tenant_class.current_tenant)
    tenant.send(proxied_tenant_inverse_assoc).instance_eval(&proxied_tenant_inverse_scope).first
  end
end