openstreetmap-website/config/initializers/sql_session_store.rb
Tom Hughes f07819d81a Rework application configuration
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.
2010-08-04 22:06:05 +01:00

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