Class: RuboCop::Cop::Platanus::PunditInApplicationController
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Platanus::PunditInApplicationController
- Defined in:
- lib/rubocop/cop/platanus/pundit_in_application_controller.rb
Overview
Pundit should not be included in specific controllers. Prefer including it in the ApplicationController instead.
Constant Summary collapse
- MSG =
'`Pundit` should be included only in the `ApplicationController`.'
Instance Method Summary collapse
Instance Method Details
#on_class(node) ⇒ Object
58 59 60 61 62 63 |
# File 'lib/rubocop/cop/platanus/pundit_in_application_controller.rb', line 58 def on_class(node) pundit_include_node = get_include_pundit_node(node) return unless pundit_include_node && !application_controller?(node) add_offense(pundit_include_node) end |