Skip to content

Instantly share code, notes, and snippets.

@mikecmpbll
Created October 9, 2015 23:03
Show Gist options
  • Save mikecmpbll/437742bd8b2bc7a9e367 to your computer and use it in GitHub Desktop.
Save mikecmpbll/437742bd8b2bc7a9e367 to your computer and use it in GitHub Desktop.
def multi_tenantify(tenant, with_database = true)
connection_info = if use_tenant_specific_db_conf?
_tenants_name_value.with_indifferent_access[tenant].clone
else
@config.clone
end
if with_database
database_name = Apartment.tenant_name_transform(tenant) # to replace environmentify?
connection_info[:database] = database_name
end
connection_info
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment