X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2c52b067168084265ed577104fe1fa2677c6e620..652dbf5044d3f7fdb5f7af1b7e8393c2a79246c6:/config/initializers/sql_session_store.rb diff --git a/config/initializers/sql_session_store.rb b/config/initializers/sql_session_store.rb index 4325c6d4c..d2fc9801a 100644 --- a/config/initializers/sql_session_store.rb +++ b/config/initializers/sql_session_store.rb @@ -1,2 +1,9 @@ -# Use the MySQL interface for SqlSessionStore -SqlSessionStore.session_class = PostgresqlSession +# 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