aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/base/flash.rb53
-rw-r--r--actionpack/lib/action_controller/base/streaming.rb5
-rw-r--r--actionpack/lib/action_controller/base/verification.rb1
-rw-r--r--actionpack/lib/action_controller/caching/actions.rb17
4 files changed, 27 insertions, 49 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
diff --git a/actionpack/lib/action_controller/base/streaming.rb b/actionpack/lib/action_controller/base/streaming.rb
index 5c72fc9ad9..70a97ccfec 100644
--- a/actionpack/lib/action_controller/base/streaming.rb
+++ b/actionpack/lib/action_controller/base/streaming.rb
@@ -4,10 +4,7 @@ module ActionController #:nodoc:
module Streaming
extend ActiveSupport::Concern
- # TODO : Remove the defined? check when new base is the main base
- if defined?(ActionController::Http)
- include ActionController::Renderer
- end
+ include ActionController::Renderer
DEFAULT_SEND_FILE_OPTIONS = {
:type => 'application/octet-stream'.freeze,
diff --git a/actionpack/lib/action_controller/base/verification.rb b/actionpack/lib/action_controller/base/verification.rb
index 7190b6b106..951ae1bee1 100644
--- a/actionpack/lib/action_controller/base/verification.rb
+++ b/actionpack/lib/action_controller/base/verification.rb
@@ -2,7 +2,6 @@ module ActionController #:nodoc:
module Verification #:nodoc:
extend ActiveSupport::Concern
- # TODO : Remove the defined? check when new base is the main base
include AbstractController::Callbacks, Session, Flash, Renderer
# This module provides a class-level method for specifying that certain
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb
index 4420678df6..d8a1662acc 100644
--- a/actionpack/lib/action_controller/caching/actions.rb
+++ b/actionpack/lib/action_controller/caching/actions.rb
@@ -84,19 +84,10 @@ module ActionController #:nodoc:
@options = options
end
- # TODO: Remove once New Base is merged
- if defined?(ActionController::Http)
- def filter(controller)
- should_continue = before(controller)
- yield if should_continue
- after(controller)
- end
- else
- def filter(controller, action)
- should_continue = before(controller)
- action.call if should_continue
- after(controller)
- end
+ def filter(controller)
+ should_continue = before(controller)
+ yield if should_continue
+ after(controller)
end
def before(controller)