Sha256: 90902a352a198c97d01901da7e5e3f2a1c804217c75a3f9fe4bf245bf5ac0a44

Contents?: true

Size: 813 Bytes

Versions: 13

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Rails
      # This cop checks that controllers subclass ApplicationController.
      #
      # @example
      #
      #  # good
      #  class MyController < ApplicationController
      #    # ...
      #  end
      #
      #  # bad
      #  class MyController < ActionController::Base
      #    # ...
      #  end
      class ApplicationController < Base
        extend AutoCorrector

        MSG = 'Controllers should subclass `ApplicationController`.'
        SUPERCLASS = 'ApplicationController'
        BASE_PATTERN = '(const (const nil? :ActionController) :Base)'

        # rubocop:disable Layout/ClassStructure
        include RuboCop::Cop::EnforceSuperclass
        # rubocop:enable Layout/ClassStructure
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rubocop-rails-2.12.4 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.12.3 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.12.2 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.12.1 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.12.0 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.11.3 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.11.2 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.11.1 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.11.0 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.10.1 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.10.0 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.9.1 lib/rubocop/cop/rails/application_controller.rb
rubocop-rails-2.9.0 lib/rubocop/cop/rails/application_controller.rb