diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-12 15:06:00 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-12 15:06:00 -0700 |
commit | 8cf45150dec7f30009d006e52c646acf6b615f89 (patch) | |
tree | c66a028f0fad415b2cd636c423dd4f3a19349664 /activerecord/lib | |
parent | 4735e2ec656163e7400274e237ed37dff5e3fbb6 (diff) | |
parent | 88e6c062423638df667869292050802d674bc0fa (diff) | |
download | rails-8cf45150dec7f30009d006e52c646acf6b615f89.tar.gz rails-8cf45150dec7f30009d006e52c646acf6b615f89.tar.bz2 rails-8cf45150dec7f30009d006e52c646acf6b615f89.zip |
Merge pull request #2042 from SAP-Oxygen/master-sqlbypass-patch
Fix for SqlBypass session store (for master)
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/session_store.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index 30a7ecd2a0..76c37cc367 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -183,11 +183,6 @@ module ActiveRecord ## # :singleton-method: - # Use the ActiveRecord::Base.connection by default. - cattr_accessor :connection - - ## - # :singleton-method: # The table name defaults to 'sessions'. cattr_accessor :table_name @@table_name = 'sessions' @@ -206,10 +201,19 @@ module ActiveRecord class << self alias :data_column_name :data_column + + # Use the ActiveRecord::Base.connection by default. + attr_writer :connection + + # Use the ActiveRecord::Base.connection_pool by default. + attr_writer :connection_pool - remove_method :connection def connection - @@connection ||= ActiveRecord::Base.connection + @connection ||= ActiveRecord::Base.connection + end + + def connection_pool + @connection_pool ||= ActiveRecord::Base.connection_pool end # Look up a session by id and unmarshal its data if found. @@ -219,6 +223,8 @@ module ActiveRecord end end end + + delegate :connection, :connection=, :connection_pool, :connection_pool=, :to => self attr_reader :session_id, :new_record alias :new_record? :new_record |