Rails 2.3 - Storing sessions in different schema
- by sa125
Hi -
I want to config my app to use a different schema than the default for storing sessions. Basically, I want the app to store all its active_record objects in app_development and only its sessions in app_sessions. Normally this could be done by defining the sessions db in database.yml:
development:
# ...
sessions:
host: localhost
database: app_sessions
username: blah
password: sssshhh
#....
And then setting in the model:
class Session < ActiveRecord::Base
establish_connection :sessions
#...
end
But since session doesn't have a model class defined, I'm looking for a way to tell it where to store its data. I've noticed the session comes from ActionController::Session, but couldn't find what I needed there. Any thoughts? thanks.