3 ms·
Thats a good question - there is nothing explicit for it, yet. You could probably do it nonetheless with Rails' own has_many/belongs_to relationships for that
by lfittl 10y ago
Thats a good question - there is nothing explicit for it, yet.
You could probably do it nonetheless with Rails' own has_many/belongs_to relationships for that sub-tenant, but the automatic adding of department_id into queries wouldn't happen.
Depending on what storage you end up using, that might matter or not. For example with Citus, you'd typically take the top-level tenant (customer_id) as a shard key, and just have all the departments of that tenant on the same node - so it would work fine.