diff options
Diffstat (limited to 'actionpack/lib/action_controller/new_base')
5 files changed, 25 insertions, 14 deletions
diff --git a/actionpack/lib/action_controller/new_base/base.rb b/actionpack/lib/action_controller/new_base/base.rb index 313b9a5e1f..4892886341 100644 --- a/actionpack/lib/action_controller/new_base/base.rb +++ b/actionpack/lib/action_controller/new_base/base.rb @@ -2,22 +2,22 @@ module ActionController class Base < Http abstract! - use AbstractController::Callbacks - use AbstractController::Helpers - use AbstractController::Logger - - use ActionController::HideActions - use ActionController::UrlFor - use ActionController::Renderer - use ActionController::Layouts - use ActionController::ConditionalGet + include AbstractController::Callbacks + include AbstractController::Helpers + include AbstractController::Logger + + include ActionController::HideActions + include ActionController::UrlFor + include ActionController::Renderer + include ActionController::Layouts + include ActionController::ConditionalGet # Legacy modules include SessionManagement include ActionDispatch::StatusCodes # Rails 2.x compatibility - use ActionController::Rails2Compatibility + include ActionController::Rails2Compatibility def self.inherited(klass) ::ActionController::Base.subclasses << klass.to_s diff --git a/actionpack/lib/action_controller/new_base/compatibility.rb b/actionpack/lib/action_controller/new_base/compatibility.rb index 505675ec4d..4655a94923 100644 --- a/actionpack/lib/action_controller/new_base/compatibility.rb +++ b/actionpack/lib/action_controller/new_base/compatibility.rb @@ -1,8 +1,9 @@ module ActionController module Rails2Compatibility + extend ActiveSupport::DependencyModule # Temporary hax - setup do + included do ::ActionController::UnknownAction = ::AbstractController::ActionNotFound ::ActionController::DoubleRenderError = ::AbstractController::DoubleRenderError @@ -32,6 +33,10 @@ module ActionController module ClassMethods def protect_from_forgery() end + def consider_all_requests_local() end + def rescue_action(env) + raise env["action_dispatch.rescue.exception"] + end end def render_to_body(options) diff --git a/actionpack/lib/action_controller/new_base/hide_actions.rb b/actionpack/lib/action_controller/new_base/hide_actions.rb index 473a8ea72b..d1857a9169 100644 --- a/actionpack/lib/action_controller/new_base/hide_actions.rb +++ b/actionpack/lib/action_controller/new_base/hide_actions.rb @@ -1,10 +1,12 @@ module ActionController module HideActions - setup do + extend ActiveSupport::DependencyModule + + included do extlib_inheritable_accessor :hidden_actions - self.hidden_actions ||= Set.new + self.hidden_actions ||= Set.new end - + def action_methods() self.class.action_names end def action_names() action_methods end diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb index 79abe40389..e851eb5f9a 100644 --- a/actionpack/lib/action_controller/new_base/layouts.rb +++ b/actionpack/lib/action_controller/new_base/layouts.rb @@ -1,5 +1,7 @@ module ActionController module Layouts + extend ActiveSupport::DependencyModule + depends_on ActionController::Renderer depends_on AbstractController::Layouts diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb index bedd1d7a23..41e3dfbe23 100644 --- a/actionpack/lib/action_controller/new_base/renderer.rb +++ b/actionpack/lib/action_controller/new_base/renderer.rb @@ -1,5 +1,7 @@ module ActionController module Renderer + extend ActiveSupport::DependencyModule + depends_on AbstractController::Renderer def initialize(*) |