r2789@asus: jeremy | 2005-07-04 16:17:35 -0700

require active_record_store only if ActiveRecord is already defined. define DEFAULT_SESSION_OPTIONS only if it is undefined.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2005-07-04 18:30:22 +00:00
parent 5900d4ff75
commit e7b142aef7
1 changed files with 8 additions and 3 deletions

View File

@ -2,8 +2,10 @@ require 'action_controller/cgi_ext/cgi_ext'
require 'action_controller/cgi_ext/cookie_performance_fix'
require 'action_controller/cgi_ext/raw_post_data_fix'
require 'action_controller/session/drb_store'
require 'action_controller/session/active_record_store'
require 'action_controller/session/mem_cache_store'
if Object.const_defined?(:ActiveRecord)
require 'action_controller/session/active_record_store'
end
module ActionController #:nodoc:
class Base
@ -37,8 +39,11 @@ module ActionController #:nodoc:
class CgiRequest < AbstractRequest #:nodoc:
attr_accessor :cgi
DEFAULT_SESSION_OPTIONS =
{ :database_manager => CGI::Session::PStore, :prefix => "ruby_sess.", :session_path => "/" }
DEFAULT_SESSION_OPTIONS = {
:database_manager => CGI::Session::PStore,
:prefix => "ruby_sess.",
:session_path => "/"
} unless const_defined?(:DEFAULT_SESSION_OPTIONS)
def initialize(cgi, session_options = {})
@cgi = cgi