impl_entity_multi_tenant

Macro impl_entity_multi_tenant 

Source
macro_rules! impl_entity_multi_tenant {
    ($type:ident) => { ... };
}
Expand description

Helper macro to enable multi-tenancy for an entity

This macro adds an override for the Entity::tenant_id() method to return the actual tenant_id field value.

§Example

impl_data_entity!(User, "user", ["name"], {
    tenant_id: Uuid,
    email: String,
});

// Enable multi-tenancy
impl_entity_multi_tenant!(User);