Permalink
Browse files

Deprecate @cookies

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f0152fb commit 4f3bf6cb23991af8fac69b67dc73844f6a92205e @jeremy jeremy committed Sep 29, 2006
View
@@ -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 @@ def initialize_template_class(response)
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 @@ def assign_shortcuts(request, response)
# 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 @@ def protected_instance_variables
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 @@ def cookie(*options)
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 @@ def set_multiple_cookies
end
def access_frozen_cookies
- @cookies["will"] = "work"
+ cookies["will"] = "work"
render_text "hello world"
end
@@ -0,0 +1 @@
+<%= @cookies[:test] %>
@@ -0,0 +1 @@
+<%= cookies[:test] %>

0 comments on commit 4f3bf6c

Please sign in to comment.