could you tell me plz – how to use in rails3 application external Active Record session store?
In rails2 its simply
ActiveRecord::SessionStore::Session.establish_connection("sessions_#{RAILS_ENV}")
but wat about rails3?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Looking at the source for
activerecord-3.0.0.rc/lib/active_record/session_store.rbI see this:So, you should be able to do something like:
ActiveRecord::SessionStore::Session.connection = establish_connection("sessions_#{RAILS_ENV}")but I haven’t tested that.You can also make your own session class that you have more control over how it connects to the database, from the same file: