Skip to content

Commit

Permalink
Remove deprecated methods since 2-3-stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed May 18, 2010
1 parent 0c3cde4 commit 26e645f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 46 deletions.
Expand Up @@ -22,13 +22,6 @@ def initialize(by, env)
@loaded = false
end

def session_id
ActiveSupport::Deprecation.warn(
"ActionDispatch::Session::AbstractStore::SessionHash#session_id " +
"has been deprecated. Please use request.session_options[:id] instead.", caller)
@env[ENV_SESSION_OPTIONS_KEY][:id]
end

def [](key)
load! unless @loaded
super(key.to_s)
Expand All @@ -45,35 +38,14 @@ def to_hash
h
end

def update(hash = nil)
if hash.nil?
ActiveSupport::Deprecation.warn('use replace instead', caller)
replace({})
else
load! unless @loaded
super(hash.stringify_keys)
end
end

def delete(key = nil)
if key.nil?
ActiveSupport::Deprecation.warn('use clear instead', caller)
clear
else
load! unless @loaded
super(key.to_s)
end
end

def data
ActiveSupport::Deprecation.warn(
"ActionDispatch::Session::AbstractStore::SessionHash#data " +
"has been deprecated. Please use #to_hash instead.", caller)
to_hash
def update(hash)
load! unless @loaded
super(hash.stringify_keys)
end

def close
ActiveSupport::Deprecation.warn('sessions should no longer be closed', caller)
def delete(key)
load! unless @loaded
super(key.to_s)
end

def inspect
Expand Down
12 changes: 0 additions & 12 deletions actionpack/test/dispatch/session/test_session_test.rb
Expand Up @@ -2,18 +2,6 @@
require 'stringio'

class ActionController::TestSessionTest < ActiveSupport::TestCase
def test_calling_delete_without_parameters_raises_deprecation_warning_and_calls_to_clear_test_session
assert_deprecated(/use clear instead/){ ActionController::TestSession.new.delete }
end

def test_calling_update_without_parameters_raises_deprecation_warning_and_calls_to_clear_test_session
assert_deprecated(/use replace instead/){ ActionController::TestSession.new.update }
end

def test_calling_close_raises_deprecation_warning
assert_deprecated(/sessions should no longer be closed/){ ActionController::TestSession.new.close }
end

def test_ctor_allows_setting
session = ActionController::TestSession.new({:one => 'one', :two => 'two'})
assert_equal('one', session[:one])
Expand Down

0 comments on commit 26e645f

Please sign in to comment.