Class: MultiTenant::TenantJoinEnforcementClause
- Inherits:
-
Arel::Nodes::Node
- Object
- Arel::Nodes::Node
- MultiTenant::TenantJoinEnforcementClause
- Defined in:
- lib/activerecord-multi-tenant/query_rewriter.rb
Instance Attribute Summary collapse
-
#table_left ⇒ Object
readonly
Returns the value of attribute table_left.
-
#tenant_attribute ⇒ Object
readonly
Returns the value of attribute tenant_attribute.
Instance Method Summary collapse
-
#initialize(tenant_attribute, table_left) ⇒ TenantJoinEnforcementClause
constructor
A new instance of TenantJoinEnforcementClause.
- #to_s ⇒ Object
- #to_sql ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(tenant_attribute, table_left) ⇒ TenantJoinEnforcementClause
Returns a new instance of TenantJoinEnforcementClause.
180 181 182 183 184 |
# File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 180 def initialize(tenant_attribute, table_left) @table_left = table_left @model_left = MultiTenant.multi_tenant_model_for_table(table_left.table_name) @tenant_attribute = tenant_attribute end |
Instance Attribute Details
#table_left ⇒ Object (readonly)
Returns the value of attribute table_left.
179 180 181 |
# File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 179 def table_left @table_left end |
#tenant_attribute ⇒ Object (readonly)
Returns the value of attribute tenant_attribute.
178 179 180 |
# File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 178 def tenant_attribute @tenant_attribute end |
Instance Method Details
#to_s ⇒ Object
186 |
# File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 186 def to_s; to_sql; end |
#to_sql ⇒ Object
189 190 191 |
# File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 189 def to_sql(*) tenant_arel.to_sql end |
#to_str ⇒ Object
187 |
# File 'lib/activerecord-multi-tenant/query_rewriter.rb', line 187 def to_str; to_sql; end |