Class: Rubocop::Cop::ActionPolicy::ApplicationPolicy

Inherits:
RuboCop::Cop::Base
  • Object
show all
Extended by:
RuboCop::Cop::AutoCorrector
Includes:
RuboCop::Cop::EnforceSuperclass
Defined in:
lib/rubocop/cop/action_policy/application_policy.rb

Overview

Checks that your policies are subclasses of ‘ApplicationPolicy`.

Examples:


# good
class MyPolicy < ApplicationPolicy
  # ...
end

# bad
class MyPolicy < ActionPolicy::Base
  # ...
end

Constant Summary collapse

MSG =
"Policies should subclass `ApplicationPolicy`."
SUPERCLASS =
"ApplicationPolicy"
BASE_PATTERN =
"(const (const nil? :ActionPolicy) :Base)"