From 19ecb66d0747515cee3bb058ab89dc0a69edb3fe Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Tue, 17 Jul 2012 14:17:48 -0700 Subject: [PATCH] Send the patch into AC::B. Because of the way the tests worked, I assumed I had to put the patch into ApplicationController. It'll actually work in ActionController::Base, due to the way that the real code is structured. Yay stubs. --- lib/draper/action_controller/base.rb | 2 +- .../support/samples/application_controller.rb | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/draper/action_controller/base.rb b/lib/draper/action_controller/base.rb index 898065fe..25d0871b 100644 --- a/lib/draper/action_controller/base.rb +++ b/lib/draper/action_controller/base.rb @@ -6,4 +6,4 @@ def view_context end end -ApplicationController.send(:include, DraperViewContext) +ActionController::Base.send(:include, DraperViewContext) diff --git a/spec/support/samples/application_controller.rb b/spec/support/samples/application_controller.rb index 0f4ca7ad..c9ff09ef 100644 --- a/spec/support/samples/application_controller.rb +++ b/spec/support/samples/application_controller.rb @@ -1,17 +1,8 @@ require './spec/support/samples/application_helper' module ActionController - class Base - @@before_filters = [] - def self.before_filters - @@before_filters - end - def self.before_filter(name) - @@before_filters << name - end - + class AbstractController def view_context -# puts "zomg view context" @view_context ||= ApplicationController end @@ -19,6 +10,15 @@ def view_context=(input) @view_context = input end end + class Base < AbstractController + @@before_filters = [] + def self.before_filters + @@before_filters + end + def self.before_filter(name) + @@before_filters << name + end + end end class ApplicationController < ActionController::Base