mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Deprecate @cookies
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
f0152fb610
commit
4f3bf6cb23
6 changed files with 8 additions and 6 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
* assert_select_rjs decodes escaped unicode chars since the Javascript generators encode them. #6240 [japgolly]
|
||||
|
||||
* Deprecation: @request will be removed after 1.2. Use the request method instead. [Jeremy Kemper]
|
||||
* Deprecation: @cookies, @request will be removed after 1.2. Use the corresponding method instead. [Jeremy Kemper]
|
||||
|
||||
* Make the :status parameter expand to the default message for that status code if it is an integer. Also support symbol statuses. [Jamis Buck]. Examples:
|
||||
|
||||
|
|
|
@ -1014,7 +1014,7 @@ module ActionController #:nodoc:
|
|||
end
|
||||
|
||||
def assign_shortcuts(request, response)
|
||||
@_request, @_params, @cookies = request, request.parameters, request.cookies
|
||||
@_request, @_params, @_cookies = request, request.parameters, request.cookies
|
||||
|
||||
@response = response
|
||||
@response.session = request.session
|
||||
|
@ -1030,7 +1030,7 @@ module ActionController #:nodoc:
|
|||
|
||||
|
||||
# TODO: assigns cookies headers params request response template
|
||||
DEPRECATED_INSTANCE_VARIABLES = %w(flash params request session)
|
||||
DEPRECATED_INSTANCE_VARIABLES = %w(cookies flash params request session)
|
||||
|
||||
# Gone after 1.2.
|
||||
def assign_deprecated_shortcuts(request, response)
|
||||
|
@ -1129,7 +1129,7 @@ module ActionController #:nodoc:
|
|||
else
|
||||
%w(@assigns @performed_redirect @performed_render
|
||||
@_request @request @response @_params @params @_session @session
|
||||
@cookies @template @request_origin @parent_controller)
|
||||
@_cookies @cookies @template @request_origin @parent_controller)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ module ActionController #:nodoc:
|
|||
|
||||
class CookieJar < Hash #:nodoc:
|
||||
def initialize(controller)
|
||||
@controller, @cookies = controller, controller.instance_variable_get("@cookies")
|
||||
@controller, @cookies = controller, controller.request.cookies
|
||||
super()
|
||||
update(@cookies)
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ class CookieTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def access_frozen_cookies
|
||||
@cookies["will"] = "work"
|
||||
cookies["will"] = "work"
|
||||
render_text "hello world"
|
||||
end
|
||||
|
||||
|
|
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<%= @cookies[:test] %>
|
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml
vendored
Normal file
1
actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<%= cookies[:test] %>
|
Loading…
Reference in a new issue