From 6b0a6472365a7b9c3883d2de3ae19b49e77c847f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 9 Sep 2007 21:54:59 +0000 Subject: Removed ActionController::Base#keep_flash (use flash.keep instead) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7428 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/flash.rb | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'actionpack/lib/action_controller/flash.rb') diff --git a/actionpack/lib/action_controller/flash.rb b/actionpack/lib/action_controller/flash.rb index 314d32e9f5..b3e39912ce 100644 --- a/actionpack/lib/action_controller/flash.rb +++ b/actionpack/lib/action_controller/flash.rb @@ -1,8 +1,8 @@ module ActionController #:nodoc: # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed - # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action - # that sets flash[:notice] = "Successfully created" before redirecting to a display action that can then expose - # the flash to its template. Actually, that exposure is automatically done. Example: + # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create + # action that sets flash[:notice] = "Successfully created" before redirecting to a display action that can + # then expose the flash to its template. Actually, that exposure is automatically done. Example: # # class WeblogController < ActionController::Base # def create @@ -19,8 +19,8 @@ module ActionController #:nodoc: # display.erb # <% if flash[:notice] %>
<%= flash[:notice] %>
<% end %> # - # This example just places a string in the flash, but you can put any object in there. And of course, you can put as many - # as you like at a time too. Just remember: They'll be gone by the time the next action has been performed. + # This example just places a string in the flash, but you can put any object in there. And of course, you can put as + # many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed. # # See docs on the FlashHash class for more details about the flash. module Flash @@ -85,7 +85,7 @@ module ActionController #:nodoc: # # Entries set via now are accessed the same way as standard entries: flash['my-key']. def now - FlashNow.new self + FlashNow.new(self) end # Keeps either the entire current flash or a specific flash entry available for the next action: @@ -117,7 +117,8 @@ module ActionController #:nodoc: end end - (@used.keys - keys).each{|k| @used.delete k } # clean up after keys that could have been left over by calling reject! or shift on the flash + # clean up after keys that could have been left over by calling reject! or shift on the flash + (@used.keys - keys).each{ |k| @used.delete(k) } end private @@ -130,13 +131,12 @@ module ActionController #:nodoc: unless k.nil? @used[k] = v else - keys.each{|key| use key, v } + keys.each{ |key| use(key, v) } end end end module InstanceMethods #:nodoc: - protected def reset_session_with_flash reset_session_without_flash @@ -163,12 +163,6 @@ module ActionController #:nodoc: @_flash end - # deprecated. use flash.keep instead - def keep_flash #:doc: - ActiveSupport::Deprecation.warn 'keep_flash is deprecated; use flash.keep instead.', caller - flash.keep - end - private def assign_shortcuts_with_flash(request, response) #:nodoc: assign_shortcuts_without_flash(request, response) @@ -181,4 +175,4 @@ module ActionController #:nodoc: end end end -end +end \ No newline at end of file -- cgit v1.2.3