]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/sql_session_store.rb
Merge branch 'master' into openid
[rails.git] / config / initializers / sql_session_store.rb
index 4325c6d4c717ab1f090760687c78294b3fcd6404..d2fc9801af75e4ab976f7d99b5a38085a275e32d 100644 (file)
@@ -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