提交 ee5b621e 编写于 作者: M Matthew Draper

Revert "Merge pull request #20851 from tomprats/indifferent-sessions"

This reverts commit 22db455d, reversing
changes made to 40be61df.

This finishes off what I meant to do in 6216a092.
上级 6216a092
......@@ -29,15 +29,6 @@
## Rails 5.0.0.beta3 (February 24, 2016) ##
* Update session to have indifferent access across multiple requests.
session[:deep][:hash] = "Magic"
session[:deep][:hash] == "Magic"
session[:deep]["hash"] == "Magic"
*Tom Prats*
* Add application/gzip as a default mime type.
*Mehmet Emin İNAÇ*
......
......@@ -9,7 +9,7 @@ class Session # :nodoc:
# Singleton object used to determine if an optional param wasn't specified
Unspecified = Object.new
# Creates a session hash, merging the properties of the previous session if any
def self.create(store, req, default_options)
session_was = find req
......@@ -61,7 +61,7 @@ def values_at(*args); @delegate.values_at(*args); end
def initialize(by, req)
@by = by
@req = req
@delegate = {}.with_indifferent_access
@delegate = {}
@loaded = false
@exists = nil # we haven't checked yet
end
......
......@@ -105,16 +105,6 @@ def test_fetch
end
end
def test_with_indifferent_access
s = Session.create(store, req, {})
s[:one] = { test: "deep" }
s[:two] = { "test" => "deep" }
assert_equal 'deep', s[:one]["test"]
assert_equal 'deep', s[:two][:test]
end
private
def store
Class.new {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册