SqlSessionStore in Rails 3

I am migrating an existing application from Rails 2 to Rails 3. In the old environment file, SqlSessionStore was configured using

ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:database_manager => SqlSessionStore)
SqlSessionStore.session_class = MysqlSession

When I tried to run my application in Rails 3, they told me:

DEPRECATION WARNING: config.action_controller.session= has been deprecated. Please use config.session_store(name, options) instead. (called from config/application.rb:35)
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing': uninitialized constant ActionController::CgiRequest (NameError)

Is there an easy way to translate this concept into Rails 3, or do I need to revise the session processing?

+3
source share
1 answer

Do you want something like this in application.rb

module MyApp
  class Application < Rails::Application
    config.session_store :active_record_store

See docs and questions here: http://apidock.com/rails/ActiveRecord/SessionStore

+3
source

Source: https://habr.com/ru/post/1764942/


All Articles