Sha256: 31055965afbaadccca0595621c17be51ab8bd3d28e65a88603cc1db2676b28ba

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

# Require whichever elevator you're using below here...
#
# require 'apartment/elevators/generic'
# require 'apartment/elevators/domain'
require 'apartment/elevators/subdomain'

#
# Apartment Configuration
#
Apartment.configure do |config|

  # These models will not be multi-tenanted,
  # but remain in the global (public) namespace
  #
  # An example might be a Customer or Tenant model that stores each tenant information
  # ex:
  #
  # config.excluded_models = %w{Tenant}
  #
  config.excluded_models = %w{}

  # use postgres schemas?
  config.use_schemas = true

  # configure persistent schemas (E.g. hstore )
  # config.persistent_schemas = %w{ hstore }

  # add the Rails environment to database names?
  # config.prepend_environment = true
  # config.append_environment = true

  # supply list of database names for migrations to run on
  config.tenant_names = lambda{ ToDo_Tenant_Or_User_Model.pluck :database }
end

##
# Elevator Configuration

# Rails.application.config.middleware.use 'Apartment::Elevators::Generic', lambda { |request|
#   # TODO: supply generic implementation
# }

# Rails.application.config.middleware.use 'Apartment::Elevators::Domain'

Rails.application.config.middleware.use 'Apartment::Elevators::Subdomain'

##
# Rake enhancements so that db:migrate etc... also runs migrations on all tenants
require 'apartment/tasks/enhancements'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
apartment-0.24.2 lib/generators/apartment/install/templates/apartment.rb
apartment-0.24.1 lib/generators/apartment/install/templates/apartment.rb
apartment-0.24.0 lib/generators/apartment/install/templates/apartment.rb