Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1001 Bytes

notes.md

File metadata and controls

31 lines (24 loc) · 1001 Bytes

Notes

  • API:

    Innkeeper::Tenant.switch("blah") do ... -> - pass "blah" into config_for - config_for uses the configured resolver to return a config hash (either database or schema by default) - connect_to_new determines what's different in the config with the current - if a 'local' switch is possible (e.g. host is unchanged), do that, otherwise reconnect Innkeeper::Tenant.switch({ host: etc }) do ... -> - pass straight through to connection_handler

    Innkeeper.configure do |config| config.tenants = proc{ Customer.map(&:subdomain) } config.tenant_decorator = ->(tenant){ "#{Rails.env}_#{tenant}" } config.tenant_resolver = Resolvers::Database end

Todo

  • rewrite generator

  • finish config tests (tenant resolver specifically)

  • write multi-threading tests

  • remove deprecated silencers?

  • rewrite readme

  • what happens when host is switched in pg without a database specified?