multitenant
multitenant copied to clipboard
making cross tenant data leaks a thing of the past.
IMHO, using ``` attr_accessor :current_tenant ``` is not thread-safe. You should use ``` Thread.current[:current_tenant] ``` instead.
Today, I noticed that when using `validates :field, uniqueness: true` on a model with `belongs_to_multitenant` doesn't cause the validation query to be restricted to the tenant. My goal was a...
In this pull request I'm including a feature which I sent in a previous one that I closed: - when leaving the scope of a tenant, restore the previous tenant...
The problem I have faced is the following: `with_tenant` method works correctly only for cases where ActiveRecord relation queries db inside the `with_tenant` block. Otherwise, it is simply ignored. In...