Skip to content

Commit

Permalink
Send the patch into AC::B.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
steveklabnik committed Jul 17, 2012
1 parent 0b03d9c commit 19ecb66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/draper/action_controller/base.rb
Expand Up @@ -6,4 +6,4 @@ def view_context
end
end

ApplicationController.send(:include, DraperViewContext)
ActionController::Base.send(:include, DraperViewContext)
20 changes: 10 additions & 10 deletions spec/support/samples/application_controller.rb
@@ -1,24 +1,24 @@
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

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
Expand Down

0 comments on commit 19ecb66

Please sign in to comment.