Permalink
Browse files

Patch ActionView::Base instead of ApplicationHelper to avoid reload p…

…roblem in development mode
  • Loading branch information...
donv committed Jul 9, 2017
1 parent fa082eb commit 5ed78b640e2df2a5a324229019a20e3ae3e6fd25
Showing with 4 additions and 4 deletions.
  1. +2 −3 lib/simple_workflow.rb
  2. +1 −1 lib/simple_workflow/railtie.rb
  3. +1 −0 test/helper_test.rb
View
@@ -1,6 +1,5 @@
unless $LOAD_PATH.include?(File.dirname(__FILE__)) ||
$LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
$LOAD_PATH.unshift(File.dirname(__FILE__))
unless $LOAD_PATH.include?(__dir__) || $LOAD_PATH.include?(File.expand_path(__dir__))
$LOAD_PATH.unshift(__dir__)
end
require 'action_controller'
@@ -5,7 +5,7 @@ class Railtie < Rails::Railtie
app.middleware.insert_before ActionDispatch::Flash, SimpleWorkflow::Middleware
# Make workflow test utility methods available in views
ApplicationHelper.send :include, SimpleWorkflow::Helper
ActionView::Base.send :include, SimpleWorkflow::Helper
# Make workflow test utility methods available in controllers
ActionController::Base.send :include, SimpleWorkflow::Helper
View
@@ -1,4 +1,5 @@
require_relative 'test_helper'
require 'action_controller/metal/exceptions'
class HelperTest < MiniTest::Test
include SimpleWorkflow::Helper

0 comments on commit 5ed78b6

Please sign in to comment.