我正在将现有应用程序从 Rails 2 迁移到 Rails 3。在旧环境文件中,SqlSessionStore 设置为:
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:database_manager => SqlSessionStore)
SqlSessionStore.session_class = MysqlSession
当尝试在 Rails 3 中启动我的应用程序时,我被告知:
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)
有没有一种简单的方法可以将此概念转换为 Rails 3,或者我是否需要重新审视会话的处理方式?