File cleanup/organization in controllers/concerns (#27846)

This commit is contained in:
Matt Jankowski 2023-11-30 09:39:41 -05:00 committed by GitHub
parent 0530ce5e95
commit 1f1c75bba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 26 additions and 26 deletions

View file

@ -4,7 +4,7 @@ require 'csv'
module Admin
class ExportDomainAllowsController < BaseController
include AdminExportControllerConcern
include Admin::ExportControllerConcern
before_action :set_dummy_import!, only: [:new]

View file

@ -4,7 +4,7 @@ require 'csv'
module Admin
class ExportDomainBlocksController < BaseController
include AdminExportControllerConcern
include Admin::ExportControllerConcern
before_action :set_dummy_import!, only: [:new]

View file

@ -4,9 +4,9 @@ class Api::BaseController < ApplicationController
DEFAULT_STATUSES_LIMIT = 20
DEFAULT_ACCOUNTS_LIMIT = 40
include RateLimitHeaders
include AccessTokenTrackingConcern
include ApiCachingConcern
include Api::RateLimitHeaders
include Api::AccessTokenTrackingConcern
include Api::CachingConcern
include Api::ContentSecurityPolicy
skip_before_action :require_functional!, unless: :limited_federation_mode?

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class Auth::ConfirmationsController < Devise::ConfirmationsController
include CaptchaConcern
include Auth::CaptchaConcern
layout 'auth'

View file

@ -2,7 +2,7 @@
class Auth::RegistrationsController < Devise::RegistrationsController
include RegistrationHelper
include RegistrationSpamConcern
include Auth::RegistrationSpamConcern
layout :determine_layout

View file

@ -10,7 +10,7 @@ class Auth::SessionsController < Devise::SessionsController
prepend_before_action :check_suspicious!, only: [:create]
include TwoFactorAuthenticationConcern
include Auth::TwoFactorAuthenticationConcern
before_action :set_body_classes

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module AdminExportControllerConcern
module Admin::ExportControllerConcern
extend ActiveSupport::Concern
private

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module AccessTokenTrackingConcern
module Api::AccessTokenTrackingConcern
extend ActiveSupport::Concern
ACCESS_TOKEN_UPDATE_FREQUENCY = 24.hours.freeze

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module ApiCachingConcern
module Api::CachingConcern
extend ActiveSupport::Concern
def cache_if_unauthenticated!

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module RateLimitHeaders
module Api::RateLimitHeaders
extend ActiveSupport::Concern
class_methods do

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module CaptchaConcern
module Auth::CaptchaConcern
extend ActiveSupport::Concern
include Hcaptcha::Adapters::ViewMethods

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module RegistrationSpamConcern
module Auth::RegistrationSpamConcern
extend ActiveSupport::Concern
def set_registration_form_time

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module TwoFactorAuthenticationConcern
module Auth::TwoFactorAuthenticationConcern
extend ActiveSupport::Concern
included do

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module ExportControllerConcern
module Settings::ExportControllerConcern
extend ActiveSupport::Concern
included do

View file

@ -3,7 +3,7 @@
module Settings
module Exports
class BlockedAccountsController < BaseController
include ExportControllerConcern
include Settings::ExportControllerConcern
def index
send_export_file

View file

@ -3,7 +3,7 @@
module Settings
module Exports
class BlockedDomainsController < BaseController
include ExportControllerConcern
include Settings::ExportControllerConcern
def index
send_export_file

View file

@ -3,7 +3,7 @@
module Settings
module Exports
class BookmarksController < BaseController
include ExportControllerConcern
include Settings::ExportControllerConcern
def index
send_export_file

View file

@ -3,7 +3,7 @@
module Settings
module Exports
class FollowingAccountsController < BaseController
include ExportControllerConcern
include Settings::ExportControllerConcern
def index
send_export_file

View file

@ -3,7 +3,7 @@
module Settings
module Exports
class ListsController < BaseController
include ExportControllerConcern
include Settings::ExportControllerConcern
def index
send_export_file

View file

@ -3,7 +3,7 @@
module Settings
module Exports
class MutedAccountsController < BaseController
include ExportControllerConcern
include Settings::ExportControllerConcern
def index
send_export_file

View file

@ -2,9 +2,9 @@
require 'rails_helper'
describe RateLimitHeaders do
describe Api::RateLimitHeaders do
controller(ApplicationController) do
include RateLimitHeaders
include Api::RateLimitHeaders
def show
head 200

View file

@ -2,9 +2,9 @@
require 'rails_helper'
describe ExportControllerConcern do
describe Settings::ExportControllerConcern do
controller(ApplicationController) do
include ExportControllerConcern
include Settings::ExportControllerConcern
def index
send_export_file