mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #2042 from SAP-Oxygen/master-sqlbypass-patch
Fix for SqlBypass session store (for master)
This commit is contained in:
@@ -181,11 +181,6 @@ module ActiveRecord
|
||||
class SqlBypass
|
||||
extend ClassMethods
|
||||
|
||||
##
|
||||
# :singleton-method:
|
||||
# Use the ActiveRecord::Base.connection by default.
|
||||
cattr_accessor :connection
|
||||
|
||||
##
|
||||
# :singleton-method:
|
||||
# The table name defaults to '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
|
||||
|
||||
Reference in New Issue
Block a user