class MultiTenant::TenantJoinEnforcementClause

Attributes

table_left[R]

Public Class Methods

new(tenant_attribute, table_left) click to toggle source
# File lib/activerecord-multi-tenant/query_rewriter.rb, line 187
def initialize(tenant_attribute, table_left)
  super(tenant_attribute)
  @table_left = table_left
  @model_left = MultiTenant.multi_tenant_model_for_table(table_left.table_name)
end

Private Instance Methods

tenant_arel() click to toggle source
# File lib/activerecord-multi-tenant/query_rewriter.rb, line 194
def tenant_arel
  @tenant_attribute.eq(@table_left[@model_left.partition_key])
end