Sha256: 79ff7a8e672ba4624b3342467ca906987ee5ffce4883ec8a61f3a85b662192ec

Contents?: true

Size: 302 Bytes

Versions: 25

Compression:

Stored size: 302 Bytes

Contents

# frozen_string_literal: true

module PgEngine
  module RequireTenantSet
    def self.included(klass)
      klass.before_action :require_tenant_set
    end

    def require_tenant_set
      return if ActsAsTenant.current_tenant.present?

      raise ActsAsTenant::Errors::NoTenantSet
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pg_rails-7.6.20 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.19 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.18 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.17 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.16 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.15 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.14 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.13 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.12 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.11 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.10 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.9 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.8 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.7 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.6 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.5 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.4 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.3 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.2 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb
pg_rails-7.6.1 pg_engine/app/controllers/concerns/pg_engine/require_tenant_set.rb