Sunday, April 3, 2011

Changing the active_resource_store database for sessions in rails 2.3.2

There's a great answer for my question over here http://stackoverflow.com/questions/378376/rails-shared-sessions-with-activerecord but it has to do with rails 2.2.2. The method used has been deprecated in 2.3.2.

Does anyone know how to use an external database for session data in rails 2.3.2? The overall goal is session sharing between two apps using two different databases. thanks!

From stackoverflow
  • Alright, found what I need. Not tested 100% to make sure it's working, but it doesn't spawn errors anymore.

    CGI::Session::ActiveRecordStore has been replaced in rails 2.3.2 with ActiveRecord::SessionStore

    So the new method to connect to an external db SHOULD be ActiveRecord::SessionStore::Session.establish_connection(:connection_name)

0 comments:

Post a Comment