From d8888b94b32b28003ec247d0565e73dee731275e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Strza=C5=82kowski?= Date: Thu, 5 Dec 2013 00:17:39 +0100 Subject: Retain ActionPack dependency on ActionView --- actionpack/actionpack.gemspec | 2 +- actionpack/lib/abstract_controller/rendering.rb | 1 + actionpack/lib/action_controller/base.rb | 18 +++--------------- 3 files changed, 5 insertions(+), 16 deletions(-) (limited to 'actionpack') diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec index 8a85bf346a..1d6009bab8 100644 --- a/actionpack/actionpack.gemspec +++ b/actionpack/actionpack.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |s| s.add_dependency 'rack', '~> 1.5.2' s.add_dependency 'rack-test', '~> 0.6.2' + s.add_dependency 'actionview', version - s.add_development_dependency 'actionview', version s.add_development_dependency 'activemodel', version end diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index ce3a0316c4..fce61cddfd 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -13,6 +13,7 @@ module AbstractController module Rendering extend ActiveSupport::Concern + include ActionView::ViewPaths # Normalize arguments, options and then delegates render_to_body and # sticks the result in self.response_body. diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 7f9ed54264..85f0f50807 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -2,20 +2,6 @@ require "action_controller/log_subscriber" require "action_controller/metal/params_wrapper" module ActionController - # The metal anonymous class was introduced to solve issue with including modules in ActionController::Base. - # Modules needs to be included in particluar order. First we need to have AbstractController::Rendering included, - # next we should include actuall implementation which would be for example ActionView::Rendering and after that - # ActionController::Rendering. This order must be preserved and as we want to have middle module included dynamicaly - # metal class was introduced. It has AbstractController::Rendering included and is parent class of - # ActionController::Base which includes ActionController::Rendering. If we include ActionView::Rendering - # beetween them to perserve the required order, we can simply do this by: - # - # ActionController::Base.superclass.send(:include, ActionView::Rendering) - # - metal = Class.new(Metal) do - include AbstractController::Rendering - end - # Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed # on request and then either it renders a template or redirects to another action. An action is defined as a public method # on the controller, which will automatically be made accessible to the web-server through \Rails Routes. @@ -174,7 +160,7 @@ module ActionController # render action: "overthere" # won't be called if monkeys is nil # end # - class Base < metal + class Base < Metal abstract! # We document the request and response methods here because albeit they are @@ -214,6 +200,7 @@ module ActionController end MODULES = [ + AbstractController::Rendering, AbstractController::Translation, AbstractController::AssetPaths, @@ -221,6 +208,7 @@ module ActionController HideActions, UrlFor, Redirecting, + ActionView::Layouts, Rendering, Renderers::All, ConditionalGet, -- cgit v1.2.3 From d6eda3ef3c59e377670442cd7f36460dbdf389f5 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Wed, 4 Dec 2013 23:13:04 -0200 Subject: Remove missing integration points of AV extraction --- actionpack/test/abstract_unit.rb | 2 -- actionpack/test/controller/render_test.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'actionpack') diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index a0d90f7eee..0e163a93eb 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -246,8 +246,6 @@ class Rack::TestCase < ActionDispatch::IntegrationTest end end -ActionController::Base.superclass.send(:include, ActionView::Layouts) - module ActionController class Base include ActionController::Testing diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index f41287381a..26806fb03f 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -529,4 +529,4 @@ class HeadRenderTest < ActionController::TestCase assert_equal "something", @response.headers["X-Custom-Header"] assert_response :forbidden end -end \ No newline at end of file +end -- cgit v1.2.3