Tutorial :Changing the active_resource_store database for sessions in rails 2.3.2



Question:

There's a great answer for my question over here 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!


Solution:1

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)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »