Permalink
Browse files

Don't include BreadcrumbsOnRails into the ActionController::API (#99)

API and Metal should not have breadcrumbs included.

closes GH-92, closes GH-93, closes GH-77
  • Loading branch information...
jcoyne authored and weppos committed Aug 11, 2016
1 parent 714de60 commit 3a3ac0c0d42bb0535418942e9051d687661582e5
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/breadcrumbs_on_rails/railtie.rb
  2. +5 −0 test/dummy.rb
@@ -10,7 +10,7 @@ module BreadcrumbsOnRails
class Railtie < Rails::Railtie
ActiveSupport.on_load(:action_controller) do
- include BreadcrumbsOnRails::ActionController
+ ::ActionController::Base.send(:include, BreadcrumbsOnRails::ActionController)
end
end
View
@@ -39,3 +39,8 @@ def method_missing(method, *args)
end
end
+
+# Trigger lazy loading and causes the load_hooks to be executed on
+# ActionController::API. This is important because breacrumbs_on_rails includes
+# BreadcrumbsOnRails::ActionController on any module that executes these hooks
+ActionController::API rescue NameError

0 comments on commit 3a3ac0c

Please sign in to comment.