module PandaPal::ConsoleExtAutoSwitch
Public Instance Methods
Source
# File lib/panda_pal/engine.rb, line 175 def start(*args) begin org = nil if Rails.env.development? org = PandaPal::Organization.find_by(name: 'local') || PandaPal::Organization.first elsif PandaPal::Organization.count == 1 org = PandaPal::Organization.first end if org org.switch_tenant puts "PandaPal: Auto Switched to tenant '#{org.tenant_name}'" end rescue => err puts "PandaPal: Error occurred auto-switching tenant: #{err}" end super end
Calls superclass method