rekif/mastodon

View on GitHub
app/controllers/admin/email_domain_blocks_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

show is not explicitly defined on the class.
Open

    before_action :set_email_domain_block, only: [:show, :destroy]

This cop checks that methods specified in the filter's only or except options are explicitly defined in the class or module.

You can specify methods of superclass or methods added by mixins on the filter, but these confuse developers. If you specify methods where are defined on another classes or modules, you should define the filter in that class or module.

Example:

# bad
class LoginController < ApplicationController
  before_action :require_login, only: %i[index settings logout]

  def index
  end
end

# good
class LoginController < ApplicationController
  before_action :require_login, only: %i[index settings logout]

  def index
  end

  def settings
  end

  def logout
  end
end

Example:

# bad
module FooMixin
  extend ActiveSupport::Concern

  included do
    before_action proc { authenticate }, only: :foo
  end
end

# good
module FooMixin
  extend ActiveSupport::Concern

  included do
    before_action proc { authenticate }, only: :foo
  end

  def foo
    # something
  end
end

There are no issues that match your filters.

Category
Status