We've moved discussions to Discord

binds pry console reload to set tenant automatically

Pablo Soldi
Hi guys, I changed my .pryrc to set a Tenant automatically after go inside the console

# select tenant when entering console
class WelcomeClass
  def self.select_tenant
    # ActsAsTenant.current_tenant = Account.find 123
    ActsAsTenant.current_tenant = Account.first
  end
end

# run the code at `bin/rails console`
Pry.config.exec_string = WelcomeClass.select_tenant

For dev purpose, this is really helpful. I'm looking for a way to auto set the tenant after execute a "reload!" inside the console. Did you find a way to bind the reload method?
Pablo Soldi
Hi guys, I changed my .pryrc to set a Tenant automatically after go inside the console

# select tenant when entering console
class WelcomeClass
  def self.select_tenant
    # ActsAsTenant.current_tenant = Account.find 123
    ActsAsTenant.current_tenant = Account.first
  end
end

# run the code at `bin/rails console`
Pry.config.exec_string = WelcomeClass.select_tenant

For dev purpose, this is really helpful. I'm looking for a way to auto set the tenant after execute a "reload!" inside the console. Did you find a way to bind the reload method?
Notifications
You’re not receiving notifications from this thread.
© 2022 Jumpstart Pro by GoRails, LLC