Use a preinitializer to load the settings from application.yml so that they are available as early as possible. All settings can also be overridden using environment variables. The ad-hoc settins in environment.rb are then moved to this new system so we have one consistent location for settings.
9 lines
344 B
Ruby
9 lines
344 B
Ruby
# Work out which session store adapter to use
|
|
environment = Rails.configuration.environment
|
|
adapter = Rails.configuration.database_configuration[environment]["adapter"]
|
|
session_class = adapter + "_session"
|
|
|
|
# Configure SqlSessionStore
|
|
unless STATUS == :database_offline
|
|
SqlSessionStore.session_class = session_class.camelize.constantize
|
|
end
|