diff options
| author | Luc Donnet | 2015-01-05 14:56:12 +0100 | 
|---|---|---|
| committer | Luc Donnet | 2015-01-05 14:56:12 +0100 | 
| commit | 3bc6d313bebdc1f03e4021aabbc774a0cd97d938 (patch) | |
| tree | ac5b8c6d8309012136606d9fd9b9a00290f486a8 /config/initializers/apartment.rb | |
| parent | e632a4634b1762f4c73d11f1e5b127de9832a1ff (diff) | |
| download | chouette-core-3bc6d313bebdc1f03e4021aabbc774a0cd97d938.tar.bz2 | |
Initialize rails 4 migration
Diffstat (limited to 'config/initializers/apartment.rb')
| -rw-r--r-- | config/initializers/apartment.rb | 49 | 
1 files changed, 45 insertions, 4 deletions
| diff --git a/config/initializers/apartment.rb b/config/initializers/apartment.rb index 095ee9aff..03ae0ed0a 100644 --- a/config/initializers/apartment.rb +++ b/config/initializers/apartment.rb @@ -1,7 +1,48 @@ +# 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| -  # set your options (described below) here -  config.excluded_models = ["Referential", "Organisation", "User", "ImportTask", "Export", "ExportLogMessage","ComplianceCheckTask", "ComplianceCheckResult", "Delayed::Backend::ActiveRecord::Job", "Api::V1::ApiKey", "RuleParameterSet"]        # these models will not be multi-tenanted, but remain in the global (public) namespace -  # Dynamically get database names to migrate -  config.database_names = lambda{ Referential.pluck(:slug) } +  # 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 = ["Referential", "Organisation", "User", "ImportTask", "Export", "ExportLogMessage","ComplianceCheckTask", "ComplianceCheckResult", "Delayed::Backend::ActiveRecord::Job", "Api::V1::ApiKey", "RuleParameterSet"] + +  # use postgres schemas? +  config.use_schemas = true + +  # use raw SQL dumps for creating postgres schemas? (only appies with use_schemas set to true) +  #config.use_sql = 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{ Referential.pluck :slug }  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' | 
