acts_as_tenant icon indicating copy to clipboard operation
acts_as_tenant copied to clipboard

ActsAsTenant::Errors::TenantIsImmutable with ActsAsTenant.without_tenant

Open alex91ckua opened this issue 5 years ago • 6 comments

I'm using ActiveAdmin and trying to allow admin user to change tenant id, like this:

  controller do
    def update
      ActsAsTenant.without_tenant { super }
    end
  end

But it still throws "ActsAsTenant::Errors::TenantIsImmutable" error, am I doing something wrong?

alex91ckua avatar Jun 20 '19 12:06 alex91ckua

I'm also having this issue, is there a way to allow changing the tenant_id column inside specific controller actions?

ksouthworth avatar Sep 01 '19 02:09 ksouthworth

Here's an example of how it can be acomplished: https://github.com/yshmarov/actsastenant-demo/blob/master/app/controllers/tenants_controller.rb#L18

yshmarov avatar Jun 17 '20 22:06 yshmarov

Here's an example of how it can be acomplished: https://github.com/yshmarov/actsastenant-demo/blob/master/app/controllers/tenants_controller.rb#L18

Example is useful, thank you. However it still results in immutable error.

pruzicka avatar Jan 02 '21 12:01 pruzicka