lib/strongbolt/user_abilities.rb
def populate_tenants_cache
        return if @tenants_cache.present?

        Strongbolt.logger.debug "Populating tenants cache for user #{self.id}"

        @tenants_cache = {}
        # Go over each tenants
        Strongbolt.tenants.each do |tenant|
          @tenants_cache[tenant.name] = send("accessible_#{tenant.send(:plural_association_name)}").pluck(:id)
          Strongbolt.logger.debug "#{@tenants_cache[tenant.name].size} #{tenant.name}"
        end
      end
#
# Populate a hash of tenants as keys and ids array as values
#
Populate a hash of tenants as keys and ids array as values
Populate a hash of tenants as keys and ids array as values
def populate_tenants_cache
        return if @tenants_cache.present?
        Strongbolt.logger.debug "Populating tenants cache for user #{self.id}"
        @tenants_cache = {}
        Strongbolt.tenants.each do |tenant|
          @tenants_cache[tenant.name] = send("accessible_#{tenant.send(:plural_association_name)}").pluck(:id)
          Strongbolt.logger.debug "#{@tenants_cache[tenant.name].size} #{tenant.name}"
        end
      end
def populate_tenants_cache return if @tenants_cache . present? Strongbolt . logger . debug "Populating tenants cache for user #{self.id}" @tenants_cache = { } Strongbolt . tenants . each do | tenant | @tenants_cache [ tenant . name ] = send ( "accessible_#{tenant.send(:plural_association_name)}" ) . pluck ( :id ) Strongbolt . logger . debug "#{@tenants_cache[tenant.name].size} #{tenant.name}" end end
Populate a hash of tenants as keys and ids array as values
Populate a hash of tenants as keys and ids array as values
# Go over each tenants