Sha256: d355ee1a607321d0d461a244b67d2ff6023cad783cdff40d7265face65a01b91

Contents?: true

Size: 550 Bytes

Versions: 5

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

def st(schema_name = nil)
  if schema_name.nil?
    tenant_list.each { |t| puts t }

  elsif tenant_list.include? schema_name
    Apartment::Tenant.switch!(schema_name)
  else
    puts "Tenant #{schema_name} is not part of the tenant list"

  end
end

def tenant_list
  tenant_list = [Apartment.default_tenant]
  tenant_list += Apartment.tenant_names
  tenant_list.uniq
end

def tenant_info_msg
  puts "Available Tenants: #{tenant_list}\n"
  puts "Use `st 'tenant'` to switch tenants & `tenant_list` to see list\n"
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
ros-apartment-3.2.0 lib/apartment/console.rb
synerma-apartment-3.1.0 lib/apartment/console.rb
puzzle-apartment-2.13.0 lib/apartment/console.rb
puzzle-apartment-2.12.0 lib/apartment/console.rb
ros-apartment-2.11.0 lib/apartment/console.rb