aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/flash.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-17 16:23:11 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-17 16:23:11 -0700
commit55ee0ba7f5b6b5d2023eb5dcc030946ed589fe53 (patch)
treefeb3f10381724dd41389b604d51dc42080098a60 /actionpack/lib/action_controller/base/flash.rb
parent8fdf3d7890d2e58508e028c93d3797f21a774dbc (diff)
downloadrails-55ee0ba7f5b6b5d2023eb5dcc030946ed589fe53.tar.gz
rails-55ee0ba7f5b6b5d2023eb5dcc030946ed589fe53.tar.bz2
rails-55ee0ba7f5b6b5d2023eb5dcc030946ed589fe53.zip
Cleaning up if defined?(ActionController::Http) blocks from the pre new base era.
Diffstat (limited to 'actionpack/lib/action_controller/base/flash.rb')
-rw-r--r--actionpack/lib/action_controller/base/flash.rb53
1 files changed, 22 insertions, 31 deletions
diff --git a/actionpack/lib/action_controller/base/flash.rb b/actionpack/lib/action_controller/base/flash.rb
index cac14175d9..590f9be3ac 100644
--- a/actionpack/lib/action_controller/base/flash.rb
+++ b/actionpack/lib/action_controller/base/flash.rb
@@ -28,13 +28,7 @@ module ActionController #:nodoc:
module Flash
extend ActiveSupport::Concern
- # TODO : Remove the defined? check when new base is the main base
- include Session if defined?(ActionController::Http)
-
- included do
- # TODO : Remove the defined? check when new base is the main base
- include InstanceMethods
- end
+ include Session
class FlashNow #:nodoc:
def initialize(flash)
@@ -141,33 +135,30 @@ module ActionController #:nodoc:
end
end
- module InstanceMethods #:nodoc:
- protected
- def process_action(method_name)
- super
- if defined? @_flash
- @_flash.store(session)
- remove_instance_variable(:@_flash)
- end
- end
-
- def reset_session
- super
- remove_instance_variable(:@_flash) if defined?(@_flash)
- end
+ protected
+ def process_action(method_name)
+ super
+ if defined? @_flash
+ @_flash.store(session)
+ remove_instance_variable(:@_flash)
+ end
end
- protected
- # Access the contents of the flash. Use <tt>flash["notice"]</tt> to
- # read a notice you put there or <tt>flash["notice"] = "hello"</tt>
- # to put a new one.
- def flash #:doc:
- if !defined?(@_flash)
- @_flash = session["flash"] || FlashHash.new
- @_flash.sweep
- end
+ def reset_session
+ super
+ remove_instance_variable(:@_flash) if defined?(@_flash)
+ end
- @_flash
+ # Access the contents of the flash. Use <tt>flash["notice"]</tt> to
+ # read a notice you put there or <tt>flash["notice"] = "hello"</tt>
+ # to put a new one.
+ def flash #:doc:
+ if !defined?(@_flash)
+ @_flash = session["flash"] || FlashHash.new
+ @_flash.sweep
end
+
+ @_flash
+ end
end
end