diff --git a/.rubocop.yml b/.rubocop.yml index b39793cfe..5d3322b6c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -118,9 +118,6 @@ Style/EmptyMethod: Style/FloatDivision: Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false - Style/GuardClause: Enabled: false diff --git a/Gemfile b/Gemfile index dc39e9c1e..7db0bb8dc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,6 @@ -source 'https://rubygems.org/' +# frozen_string_literal: true + +source "https://rubygems.org/" gem "dotenv", require: "dotenv/load" diff --git a/Rakefile b/Rakefile index 2d06b2dc8..ae9b388d3 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/concerns/user_warnable.rb b/app/concerns/user_warnable.rb index 369d4e3ea..ad9ecd6ec 100644 --- a/app/concerns/user_warnable.rb +++ b/app/concerns/user_warnable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UserWarnable extend ActiveSupport::Concern diff --git a/app/controllers/admin/danger_zone_controller.rb b/app/controllers/admin/danger_zone_controller.rb index e56f578f1..0bbb2a6da 100644 --- a/app/controllers/admin/danger_zone_controller.rb +++ b/app/controllers/admin/danger_zone_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class DangerZoneController < ApplicationController before_action :admin_only diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb index 4a5fba432..c294432e6 100644 --- a/app/controllers/admin/dashboards_controller.rb +++ b/app/controllers/admin/dashboards_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class DashboardsController < ApplicationController before_action :admin_only diff --git a/app/controllers/admin/exceptions_controller.rb b/app/controllers/admin/exceptions_controller.rb index 9288f36af..d751a02a2 100644 --- a/app/controllers/admin/exceptions_controller.rb +++ b/app/controllers/admin/exceptions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ExceptionsController < ApplicationController before_action :admin_only diff --git a/app/controllers/admin/reowner_controller.rb b/app/controllers/admin/reowner_controller.rb index 5a5665179..3f9412170 100644 --- a/app/controllers/admin/reowner_controller.rb +++ b/app/controllers/admin/reowner_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ReownerController < ApplicationController before_action :is_bd_staff_only diff --git a/app/controllers/admin/staff_notes_controller.rb b/app/controllers/admin/staff_notes_controller.rb index b2acc31a6..b2e9413ac 100644 --- a/app/controllers/admin/staff_notes_controller.rb +++ b/app/controllers/admin/staff_notes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class StaffNotesController < ApplicationController before_action :can_view_staff_notes_only diff --git a/app/controllers/admin/stuck_dnp_controller.rb b/app/controllers/admin/stuck_dnp_controller.rb index 30936cd19..d3ea1df04 100644 --- a/app/controllers/admin/stuck_dnp_controller.rb +++ b/app/controllers/admin/stuck_dnp_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class StuckDnpController < ApplicationController before_action :admin_only diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 7524ceeb5..250922c5c 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class UsersController < ApplicationController before_action :admin_only diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6b7cc3065..ca06b47d1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base class APIThrottled < Exception; end class FeatureUnavailable < StandardError; end diff --git a/app/controllers/artist_urls_controller.rb b/app/controllers/artist_urls_controller.rb index d2cac21e2..2ba40df37 100644 --- a/app/controllers/artist_urls_controller.rb +++ b/app/controllers/artist_urls_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ArtistUrlsController < ApplicationController respond_to :json, :html before_action :member_only, except: [:index] diff --git a/app/controllers/artist_versions_controller.rb b/app/controllers/artist_versions_controller.rb index 33c7e018c..01b64eec3 100644 --- a/app/controllers/artist_versions_controller.rb +++ b/app/controllers/artist_versions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ArtistVersionsController < ApplicationController respond_to :html, :json diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 0c77bd0bb..16f1571a1 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ArtistsController < ApplicationController respond_to :html, :json before_action :member_only, :except => [:index, :show, :show_or_new] diff --git a/app/controllers/bans_controller.rb b/app/controllers/bans_controller.rb index e8668ca42..4bf0aa02a 100644 --- a/app/controllers/bans_controller.rb +++ b/app/controllers/bans_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BansController < ApplicationController before_action :moderator_only, :except => [:show, :index] respond_to :html diff --git a/app/controllers/blips_controller.rb b/app/controllers/blips_controller.rb index 1fac4506e..9dfedb1aa 100644 --- a/app/controllers/blips_controller.rb +++ b/app/controllers/blips_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BlipsController < ApplicationController class BlipTooOld < Exception ; end respond_to :html, :json diff --git a/app/controllers/bulk_update_requests_controller.rb b/app/controllers/bulk_update_requests_controller.rb index 30bec7a85..157cd77d7 100644 --- a/app/controllers/bulk_update_requests_controller.rb +++ b/app/controllers/bulk_update_requests_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BulkUpdateRequestsController < ApplicationController respond_to :html, :json before_action :member_only, except: [:index, :show] diff --git a/app/controllers/comment_votes_controller.rb b/app/controllers/comment_votes_controller.rb index e89ce05c1..705431d7d 100644 --- a/app/controllers/comment_votes_controller.rb +++ b/app/controllers/comment_votes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CommentVotesController < ApplicationController respond_to :json respond_to :html, only: [:index] diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index c74349ba8..bc14a2b39 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CommentsController < ApplicationController respond_to :html, :json before_action :member_only, except: %i[index search show for_post] diff --git a/app/controllers/concerns/deferred_posts.rb b/app/controllers/concerns/deferred_posts.rb index 88c3c4cc5..1a8d81208 100644 --- a/app/controllers/concerns/deferred_posts.rb +++ b/app/controllers/concerns/deferred_posts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DeferredPosts extend ActiveSupport::Concern diff --git a/app/controllers/deleted_posts_controller.rb b/app/controllers/deleted_posts_controller.rb index 62ac93b0e..c4871d025 100644 --- a/app/controllers/deleted_posts_controller.rb +++ b/app/controllers/deleted_posts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DeletedPostsController < ApplicationController respond_to :html diff --git a/app/controllers/dmails_controller.rb b/app/controllers/dmails_controller.rb index 844545649..fb0173ee1 100644 --- a/app/controllers/dmails_controller.rb +++ b/app/controllers/dmails_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DmailsController < ApplicationController respond_to :html respond_to :json, except: %i[new create] diff --git a/app/controllers/dtext_previews_controller.rb b/app/controllers/dtext_previews_controller.rb index 2f954e183..221502baf 100644 --- a/app/controllers/dtext_previews_controller.rb +++ b/app/controllers/dtext_previews_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DtextPreviewsController < ApplicationController def create body = params[:body] || "" diff --git a/app/controllers/edit_histories_controller.rb b/app/controllers/edit_histories_controller.rb index 11dcda6db..1b29e9d04 100644 --- a/app/controllers/edit_histories_controller.rb +++ b/app/controllers/edit_histories_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EditHistoriesController < ApplicationController respond_to :html before_action :moderator_only diff --git a/app/controllers/email_blacklists_controller.rb b/app/controllers/email_blacklists_controller.rb index 36fae49d8..03b8ed68c 100644 --- a/app/controllers/email_blacklists_controller.rb +++ b/app/controllers/email_blacklists_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EmailBlacklistsController < ApplicationController respond_to :html, :json, :js before_action :admin_only diff --git a/app/controllers/emails_controller.rb b/app/controllers/emails_controller.rb index 6ec2d93da..4588e72aa 100644 --- a/app/controllers/emails_controller.rb +++ b/app/controllers/emails_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EmailsController < ApplicationController respond_to :html diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index e2b724014..510350a46 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FavoritesController < ApplicationController before_action :member_only, except: [:index] respond_to :html, :json diff --git a/app/controllers/forum_categories_controller.rb b/app/controllers/forum_categories_controller.rb index 4e03a2e32..a917e1711 100644 --- a/app/controllers/forum_categories_controller.rb +++ b/app/controllers/forum_categories_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumCategoriesController < ApplicationController respond_to :html before_action :admin_only diff --git a/app/controllers/forum_post_votes_controller.rb b/app/controllers/forum_post_votes_controller.rb index e6dfa3b9e..1460aa074 100644 --- a/app/controllers/forum_post_votes_controller.rb +++ b/app/controllers/forum_post_votes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumPostVotesController < ApplicationController respond_to :json before_action :member_only diff --git a/app/controllers/forum_posts_controller.rb b/app/controllers/forum_posts_controller.rb index dd9a9e9f7..c87eb5638 100644 --- a/app/controllers/forum_posts_controller.rb +++ b/app/controllers/forum_posts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumPostsController < ApplicationController respond_to :html, :json before_action :member_only, :except => [:index, :show, :search] diff --git a/app/controllers/forum_topics_controller.rb b/app/controllers/forum_topics_controller.rb index 9ba054ad5..a1402455e 100644 --- a/app/controllers/forum_topics_controller.rb +++ b/app/controllers/forum_topics_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumTopicsController < ApplicationController respond_to :html, :json before_action :member_only, :except => [:index, :show] diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 67534a2a9..d79edc9dc 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HelpController < ApplicationController respond_to :html, :json helper :wiki_pages diff --git a/app/controllers/ip_bans_controller.rb b/app/controllers/ip_bans_controller.rb index 31a0cfe1b..043fdd283 100644 --- a/app/controllers/ip_bans_controller.rb +++ b/app/controllers/ip_bans_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IpBansController < ApplicationController respond_to :html, :json before_action :admin_only diff --git a/app/controllers/iqdb_queries_controller.rb b/app/controllers/iqdb_queries_controller.rb index 19e34b066..cd738eb29 100644 --- a/app/controllers/iqdb_queries_controller.rb +++ b/app/controllers/iqdb_queries_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IqdbQueriesController < ApplicationController respond_to :html, :json # Show uses POST because it needs a file parameter. This would be GET otherwise. diff --git a/app/controllers/maintenance/user/api_keys_controller.rb b/app/controllers/maintenance/user/api_keys_controller.rb index a4b4510d9..f2809e1dc 100644 --- a/app/controllers/maintenance/user/api_keys_controller.rb +++ b/app/controllers/maintenance/user/api_keys_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class ApiKeysController < ApplicationController diff --git a/app/controllers/maintenance/user/count_fixes_controller.rb b/app/controllers/maintenance/user/count_fixes_controller.rb index a479132d0..bdd3d32fd 100644 --- a/app/controllers/maintenance/user/count_fixes_controller.rb +++ b/app/controllers/maintenance/user/count_fixes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class CountFixesController < ApplicationController diff --git a/app/controllers/maintenance/user/deletions_controller.rb b/app/controllers/maintenance/user/deletions_controller.rb index ae42a7558..4975a030d 100644 --- a/app/controllers/maintenance/user/deletions_controller.rb +++ b/app/controllers/maintenance/user/deletions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class DeletionsController < ApplicationController diff --git a/app/controllers/maintenance/user/dmail_filters_controller.rb b/app/controllers/maintenance/user/dmail_filters_controller.rb index ccd05db60..aa37bd215 100644 --- a/app/controllers/maintenance/user/dmail_filters_controller.rb +++ b/app/controllers/maintenance/user/dmail_filters_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class DmailFiltersController < ApplicationController diff --git a/app/controllers/maintenance/user/email_changes_controller.rb b/app/controllers/maintenance/user/email_changes_controller.rb index b896ed598..522227db1 100644 --- a/app/controllers/maintenance/user/email_changes_controller.rb +++ b/app/controllers/maintenance/user/email_changes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class EmailChangesController < ApplicationController diff --git a/app/controllers/maintenance/user/email_notifications_controller.rb b/app/controllers/maintenance/user/email_notifications_controller.rb index ce149e508..3723f5e19 100644 --- a/app/controllers/maintenance/user/email_notifications_controller.rb +++ b/app/controllers/maintenance/user/email_notifications_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class EmailNotificationsController < ApplicationController diff --git a/app/controllers/maintenance/user/login_reminders_controller.rb b/app/controllers/maintenance/user/login_reminders_controller.rb index 21b2e2df3..052c5c2a9 100644 --- a/app/controllers/maintenance/user/login_reminders_controller.rb +++ b/app/controllers/maintenance/user/login_reminders_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class LoginRemindersController < ApplicationController diff --git a/app/controllers/maintenance/user/password_resets_controller.rb b/app/controllers/maintenance/user/password_resets_controller.rb index d2daa35a2..94089ae9e 100644 --- a/app/controllers/maintenance/user/password_resets_controller.rb +++ b/app/controllers/maintenance/user/password_resets_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class PasswordResetsController < ApplicationController diff --git a/app/controllers/maintenance/user/passwords_controller.rb b/app/controllers/maintenance/user/passwords_controller.rb index c14592059..ccca65641 100644 --- a/app/controllers/maintenance/user/passwords_controller.rb +++ b/app/controllers/maintenance/user/passwords_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class PasswordsController < ApplicationController diff --git a/app/controllers/mascots_controller.rb b/app/controllers/mascots_controller.rb index 7c55c753e..b178f0648 100644 --- a/app/controllers/mascots_controller.rb +++ b/app/controllers/mascots_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MascotsController < ApplicationController respond_to :html, :json before_action :admin_only, except: [:index] diff --git a/app/controllers/meta_searches_controller.rb b/app/controllers/meta_searches_controller.rb index c9fd25126..9662cd90d 100644 --- a/app/controllers/meta_searches_controller.rb +++ b/app/controllers/meta_searches_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MetaSearchesController < ApplicationController def tags @meta_search = MetaSearches::Tag.new(params) diff --git a/app/controllers/mod_actions_controller.rb b/app/controllers/mod_actions_controller.rb index 7f4339d26..b3fd2076b 100644 --- a/app/controllers/mod_actions_controller.rb +++ b/app/controllers/mod_actions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ModActionsController < ApplicationController respond_to :html, :json diff --git a/app/controllers/moderator/dashboards_controller.rb b/app/controllers/moderator/dashboards_controller.rb index f82cf89b6..5441d640e 100644 --- a/app/controllers/moderator/dashboards_controller.rb +++ b/app/controllers/moderator/dashboards_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator class DashboardsController < ApplicationController before_action :janitor_only diff --git a/app/controllers/moderator/ip_addrs_controller.rb b/app/controllers/moderator/ip_addrs_controller.rb index 97cb44a66..83465bcfe 100644 --- a/app/controllers/moderator/ip_addrs_controller.rb +++ b/app/controllers/moderator/ip_addrs_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator class IpAddrsController < ApplicationController before_action :admin_only diff --git a/app/controllers/moderator/post/approvals_controller.rb b/app/controllers/moderator/post/approvals_controller.rb index 70e1c2d46..225d3cb83 100644 --- a/app/controllers/moderator/post/approvals_controller.rb +++ b/app/controllers/moderator/post/approvals_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Post class ApprovalsController < ApplicationController diff --git a/app/controllers/moderator/post/disapprovals_controller.rb b/app/controllers/moderator/post/disapprovals_controller.rb index e4a0f2d44..9df72be33 100644 --- a/app/controllers/moderator/post/disapprovals_controller.rb +++ b/app/controllers/moderator/post/disapprovals_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Post class DisapprovalsController < ApplicationController diff --git a/app/controllers/moderator/post/posts_controller.rb b/app/controllers/moderator/post/posts_controller.rb index 834cd4a24..c4f59f695 100644 --- a/app/controllers/moderator/post/posts_controller.rb +++ b/app/controllers/moderator/post/posts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Post class PostsController < ApplicationController diff --git a/app/controllers/news_updates_controller.rb b/app/controllers/news_updates_controller.rb index cd54082c1..f3cf5dd08 100644 --- a/app/controllers/news_updates_controller.rb +++ b/app/controllers/news_updates_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NewsUpdatesController < ApplicationController before_action :admin_only, except: [:index] respond_to :html diff --git a/app/controllers/note_previews_controller.rb b/app/controllers/note_previews_controller.rb index 629cc966a..ac9dd113f 100644 --- a/app/controllers/note_previews_controller.rb +++ b/app/controllers/note_previews_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NotePreviewsController < ApplicationController respond_to :json diff --git a/app/controllers/note_versions_controller.rb b/app/controllers/note_versions_controller.rb index 16b71cf55..6b9993e26 100644 --- a/app/controllers/note_versions_controller.rb +++ b/app/controllers/note_versions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NoteVersionsController < ApplicationController respond_to :html, :json diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index df91d08d2..9dc84acf4 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NotesController < ApplicationController respond_to :html, :json, :js before_action :member_only, :except => [:index, :show, :search] diff --git a/app/controllers/pool_elements_controller.rb b/app/controllers/pool_elements_controller.rb index 1194fa67c..79fe47205 100644 --- a/app/controllers/pool_elements_controller.rb +++ b/app/controllers/pool_elements_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PoolElementsController < ApplicationController respond_to :html, :json, :js before_action :member_only diff --git a/app/controllers/pool_orders_controller.rb b/app/controllers/pool_orders_controller.rb index 9ce63574f..5c6e00eef 100644 --- a/app/controllers/pool_orders_controller.rb +++ b/app/controllers/pool_orders_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PoolOrdersController < ApplicationController respond_to :html, :json, :js before_action :member_only diff --git a/app/controllers/pool_versions_controller.rb b/app/controllers/pool_versions_controller.rb index 533a2b079..1cd575a2d 100644 --- a/app/controllers/pool_versions_controller.rb +++ b/app/controllers/pool_versions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PoolVersionsController < ApplicationController respond_to :html, :json before_action :member_only diff --git a/app/controllers/pools_controller.rb b/app/controllers/pools_controller.rb index c605a0f87..87d544743 100644 --- a/app/controllers/pools_controller.rb +++ b/app/controllers/pools_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PoolsController < ApplicationController respond_to :html, :json before_action :member_only, :except => [:index, :show, :gallery] diff --git a/app/controllers/popular_controller.rb b/app/controllers/popular_controller.rb index 3684feb2f..3c2da1477 100644 --- a/app/controllers/popular_controller.rb +++ b/app/controllers/popular_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PopularController < ApplicationController respond_to :html, :json diff --git a/app/controllers/post_approvals_controller.rb b/app/controllers/post_approvals_controller.rb index 8f4cb6073..f53a4803d 100644 --- a/app/controllers/post_approvals_controller.rb +++ b/app/controllers/post_approvals_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostApprovalsController < ApplicationController respond_to :html, :json diff --git a/app/controllers/post_events_controller.rb b/app/controllers/post_events_controller.rb index 66e40f71d..d7ad831c5 100644 --- a/app/controllers/post_events_controller.rb +++ b/app/controllers/post_events_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostEventsController < ApplicationController respond_to :html, :json diff --git a/app/controllers/post_favorites_controller.rb b/app/controllers/post_favorites_controller.rb index 2cfc3ba6a..778b83c39 100644 --- a/app/controllers/post_favorites_controller.rb +++ b/app/controllers/post_favorites_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostFavoritesController < ApplicationController respond_to :html diff --git a/app/controllers/post_flags_controller.rb b/app/controllers/post_flags_controller.rb index 5ab18ce3e..73ca9b746 100644 --- a/app/controllers/post_flags_controller.rb +++ b/app/controllers/post_flags_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostFlagsController < ApplicationController before_action :member_only, :except => [:index, :show] before_action :janitor_only, only: [:destroy] diff --git a/app/controllers/post_replacements_controller.rb b/app/controllers/post_replacements_controller.rb index dcfbde3f1..b73179179 100644 --- a/app/controllers/post_replacements_controller.rb +++ b/app/controllers/post_replacements_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostReplacementsController < ApplicationController respond_to :html, :json before_action :member_only, only: [:create, :new] diff --git a/app/controllers/post_report_reasons_controller.rb b/app/controllers/post_report_reasons_controller.rb index ec3bb9b05..569cf3bb4 100644 --- a/app/controllers/post_report_reasons_controller.rb +++ b/app/controllers/post_report_reasons_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostReportReasonsController < ApplicationController respond_to :html before_action :admin_only diff --git a/app/controllers/post_set_maintainers_controller.rb b/app/controllers/post_set_maintainers_controller.rb index 45b761ed0..f7784df68 100644 --- a/app/controllers/post_set_maintainers_controller.rb +++ b/app/controllers/post_set_maintainers_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostSetMaintainersController < ApplicationController respond_to :html respond_to :js, except: [:index] diff --git a/app/controllers/post_sets_controller.rb b/app/controllers/post_sets_controller.rb index 322a0d549..fa026ace9 100644 --- a/app/controllers/post_sets_controller.rb +++ b/app/controllers/post_sets_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostSetsController < ApplicationController respond_to :html, :json before_action :member_only, except: [:index, :show] diff --git a/app/controllers/post_versions_controller.rb b/app/controllers/post_versions_controller.rb index 4fd4457f2..1f61d2408 100644 --- a/app/controllers/post_versions_controller.rb +++ b/app/controllers/post_versions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostVersionsController < ApplicationController before_action :member_only, except: [:index] respond_to :html, :json diff --git a/app/controllers/post_votes_controller.rb b/app/controllers/post_votes_controller.rb index c65b0d3c3..22bbaa024 100644 --- a/app/controllers/post_votes_controller.rb +++ b/app/controllers/post_votes_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostVotesController < ApplicationController before_action :member_only before_action :moderator_only, only: [:index, :lock] diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 2cbe70a37..5d04dd0f6 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostsController < ApplicationController before_action :member_only, except: %i[show show_seq index random] before_action :admin_only, only: [:update_iqdb] diff --git a/app/controllers/related_tags_controller.rb b/app/controllers/related_tags_controller.rb index 8ce872516..371fa7058 100644 --- a/app/controllers/related_tags_controller.rb +++ b/app/controllers/related_tags_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RelatedTagsController < ApplicationController respond_to :json, :html, only: [:show] respond_to :json, only: [:bulk] diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 926fc5e21..a95243a6f 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SessionsController < ApplicationController def new @user = User.new diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 2fcd9d963..64161eb14 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StaticController < ApplicationController def privacy @page = WikiPage.find_by(title: "e621:privacy_policy") diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 5188cb1b6..0084c1b7d 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StatsController < ApplicationController respond_to :html diff --git a/app/controllers/tag_alias_requests_controller.rb b/app/controllers/tag_alias_requests_controller.rb index a6848e098..6c37476b0 100644 --- a/app/controllers/tag_alias_requests_controller.rb +++ b/app/controllers/tag_alias_requests_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagAliasRequestsController < ApplicationController before_action :member_only diff --git a/app/controllers/tag_aliases_controller.rb b/app/controllers/tag_aliases_controller.rb index e9f2db392..f9b9c8a4d 100644 --- a/app/controllers/tag_aliases_controller.rb +++ b/app/controllers/tag_aliases_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagAliasesController < ApplicationController before_action :admin_only, except: [:index, :show, :destroy] respond_to :html, :json, :js diff --git a/app/controllers/tag_corrections_controller.rb b/app/controllers/tag_corrections_controller.rb index 3a2499847..6dec9b5c8 100644 --- a/app/controllers/tag_corrections_controller.rb +++ b/app/controllers/tag_corrections_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagCorrectionsController < ApplicationController respond_to :html, :json before_action :janitor_only, only: [:new, :create] diff --git a/app/controllers/tag_implication_requests_controller.rb b/app/controllers/tag_implication_requests_controller.rb index 4f53ef2cd..b21e96077 100644 --- a/app/controllers/tag_implication_requests_controller.rb +++ b/app/controllers/tag_implication_requests_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagImplicationRequestsController < ApplicationController before_action :member_only diff --git a/app/controllers/tag_implications_controller.rb b/app/controllers/tag_implications_controller.rb index 8e1904971..075fbd4ea 100644 --- a/app/controllers/tag_implications_controller.rb +++ b/app/controllers/tag_implications_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagImplicationsController < ApplicationController before_action :admin_only, except: [:index, :show, :destroy] respond_to :html, :json, :js diff --git a/app/controllers/tag_type_versions_controller.rb b/app/controllers/tag_type_versions_controller.rb index 776b8645f..67a6a4a34 100644 --- a/app/controllers/tag_type_versions_controller.rb +++ b/app/controllers/tag_type_versions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagTypeVersionsController < ApplicationController respond_to :html, :json diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 3223ff223..046a955d4 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagsController < ApplicationController before_action :member_only, :only => [:edit, :update, :preview] respond_to :html, :json diff --git a/app/controllers/takedowns_controller.rb b/app/controllers/takedowns_controller.rb index 095f91ab8..a4d3b5890 100644 --- a/app/controllers/takedowns_controller.rb +++ b/app/controllers/takedowns_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TakedownsController < ApplicationController respond_to :html, :json before_action :can_handle_takedowns_only, only: %i[update edit destroy add_by_ids add_by_tags count_matching_posts remove_by_ids] diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 0b5cce674..5d7050d36 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TicketsController < ApplicationController respond_to :html before_action :member_only, except: [:index] diff --git a/app/controllers/upload_whitelists_controller.rb b/app/controllers/upload_whitelists_controller.rb index 8bd7970af..15fc26300 100644 --- a/app/controllers/upload_whitelists_controller.rb +++ b/app/controllers/upload_whitelists_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadWhitelistsController < ApplicationController respond_to :html, :json, :js before_action :admin_only, only: [:new, :create, :edit, :update, :destroy] diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb index fc4f999d4..8bc05bdc2 100644 --- a/app/controllers/uploads_controller.rb +++ b/app/controllers/uploads_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadsController < ApplicationController before_action :member_only before_action :janitor_only, only: [:index, :show] diff --git a/app/controllers/user_feedbacks_controller.rb b/app/controllers/user_feedbacks_controller.rb index accccae9f..a02e49357 100644 --- a/app/controllers/user_feedbacks_controller.rb +++ b/app/controllers/user_feedbacks_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserFeedbacksController < ApplicationController before_action :moderator_only, :only => [:new, :edit, :create, :update, :destroy] respond_to :html, :json diff --git a/app/controllers/user_name_change_requests_controller.rb b/app/controllers/user_name_change_requests_controller.rb index a4ca986de..ebb48c998 100644 --- a/app/controllers/user_name_change_requests_controller.rb +++ b/app/controllers/user_name_change_requests_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserNameChangeRequestsController < ApplicationController before_action :member_only, only: [:new, :create, :show] before_action :moderator_only, only: :index diff --git a/app/controllers/user_reverts_controller.rb b/app/controllers/user_reverts_controller.rb index a4bc94015..0850fe02e 100644 --- a/app/controllers/user_reverts_controller.rb +++ b/app/controllers/user_reverts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserRevertsController < ApplicationController before_action :moderator_only diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0e2006505..c06e06468 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UsersController < ApplicationController respond_to :html, :json skip_before_action :api_check diff --git a/app/controllers/wiki_page_versions_controller.rb b/app/controllers/wiki_page_versions_controller.rb index b330d0d4e..0d047971d 100644 --- a/app/controllers/wiki_page_versions_controller.rb +++ b/app/controllers/wiki_page_versions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class WikiPageVersionsController < ApplicationController respond_to :html, :json diff --git a/app/controllers/wiki_pages_controller.rb b/app/controllers/wiki_pages_controller.rb index bee363791..c48cd4025 100644 --- a/app/controllers/wiki_pages_controller.rb +++ b/app/controllers/wiki_pages_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class WikiPagesController < ApplicationController respond_to :html, :json, :js before_action :member_only, :except => [:index, :search, :show, :show_or_new] diff --git a/app/decorators/application_decorator.rb b/app/decorators/application_decorator.rb index 9ad5623d8..3a62d6bbc 100644 --- a/app/decorators/application_decorator.rb +++ b/app/decorators/application_decorator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationDecorator < Draper::Decorator # NOTE: This is required for correct serialization of member models, otherwise hidden_attributes is ignored!!! delegate :as_json, :serializable_hash diff --git a/app/decorators/mod_action_decorator.rb b/app/decorators/mod_action_decorator.rb index 0c4e18359..f0e6d5e7d 100644 --- a/app/decorators/mod_action_decorator.rb +++ b/app/decorators/mod_action_decorator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ModActionDecorator < ApplicationDecorator def self.collection_decorator_class PaginatedDecorator diff --git a/app/decorators/paginated_decorator.rb b/app/decorators/paginated_decorator.rb index 4e9857060..9a81bf714 100644 --- a/app/decorators/paginated_decorator.rb +++ b/app/decorators/paginated_decorator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PaginatedDecorator < Draper::CollectionDecorator delegate :current_page, :total_pages, :is_first_page?, :is_last_page?, :pagination_mode, :max_numbered_pages, :records, :total_count end diff --git a/app/decorators/post_event_decorator.rb b/app/decorators/post_event_decorator.rb index 814a971de..9778e58c5 100644 --- a/app/decorators/post_event_decorator.rb +++ b/app/decorators/post_event_decorator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostEventDecorator < ApplicationDecorator def self.collection_decorator_class PaginatedDecorator diff --git a/app/decorators/posts_decorator.rb b/app/decorators/posts_decorator.rb index 7ccb9b18c..44f48c4e1 100644 --- a/app/decorators/posts_decorator.rb +++ b/app/decorators/posts_decorator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostsDecorator < ApplicationDecorator def self.collection_decorator_class PaginatedDecorator diff --git a/app/helpers/admin/users_helper.rb b/app/helpers/admin/users_helper.rb index 0291de665..833417e7f 100644 --- a/app/helpers/admin/users_helper.rb +++ b/app/helpers/admin/users_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin::UsersHelper def user_level_select(object, field) options = Danbooru.config.levels.map { |x,y| [x,y] } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 469fd77e1..65109d894 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ApplicationHelper def disable_mobile_mode? if CurrentUser.user.present? && CurrentUser.is_member? diff --git a/app/helpers/artist_versions_helper.rb b/app/helpers/artist_versions_helper.rb index 87ed000c1..64d9bdb4b 100644 --- a/app/helpers/artist_versions_helper.rb +++ b/app/helpers/artist_versions_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ArtistVersionsHelper def artist_versions_listing_type params.dig(:search, :artist_id).present? && CurrentUser.is_member? ? :revert : :standard diff --git a/app/helpers/artists_helper.rb b/app/helpers/artists_helper.rb index 0fa29ed5a..2e003e86f 100644 --- a/app/helpers/artists_helper.rb +++ b/app/helpers/artists_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ArtistsHelper def link_to_artist(name) artist = Artist.find_by(name: name) diff --git a/app/helpers/bulk_update_requests_helper.rb b/app/helpers/bulk_update_requests_helper.rb index 98b9ed3bf..4f1fac513 100644 --- a/app/helpers/bulk_update_requests_helper.rb +++ b/app/helpers/bulk_update_requests_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module BulkUpdateRequestsHelper def approved?(command, antecedent, consequent) return false unless CurrentUser.is_admin? diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index f656acee9..7b5ae07e1 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CommentsHelper def comment_vote_block(comment, vote) return if comment.is_sticky diff --git a/app/helpers/dmails_helper.rb b/app/helpers/dmails_helper.rb index 3e700b95d..e41deceac 100644 --- a/app/helpers/dmails_helper.rb +++ b/app/helpers/dmails_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DmailsHelper def dmails_current_folder_path case cookies[:dmail_folder] diff --git a/app/helpers/form_search_helper.rb b/app/helpers/form_search_helper.rb index 38d052ee2..c47f15b95 100644 --- a/app/helpers/form_search_helper.rb +++ b/app/helpers/form_search_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FormSearchHelper def form_search(path:, always_display: false, hideable: request.path.split("/")[2] != "search", method: :get, &) # dedicated search routes like /comments/search should always show diff --git a/app/helpers/forum_topics_helper.rb b/app/helpers/forum_topics_helper.rb index 340c8a63c..79044e784 100644 --- a/app/helpers/forum_topics_helper.rb +++ b/app/helpers/forum_topics_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ForumTopicsHelper def forum_topic_category_select(object, field, options = {}) select(object, field, ForumCategory.visible.reverse_mapping, options) diff --git a/app/helpers/moderator/dashboards_helper.rb b/app/helpers/moderator/dashboards_helper.rb index f32c2ecc6..d8aee0a2e 100644 --- a/app/helpers/moderator/dashboards_helper.rb +++ b/app/helpers/moderator/dashboards_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module DashboardsHelper def user_level_select_tag(name, options = {}) diff --git a/app/helpers/moderator/ip_addrs_helper.rb b/app/helpers/moderator/ip_addrs_helper.rb index 4bd38b4b8..0f4a7e3a8 100644 --- a/app/helpers/moderator/ip_addrs_helper.rb +++ b/app/helpers/moderator/ip_addrs_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module IpAddrsHelper def link_to_ip_search(type, ip_addr, count) diff --git a/app/helpers/note_versions_helper.rb b/app/helpers/note_versions_helper.rb index d8ef595e4..4ddfe75c0 100644 --- a/app/helpers/note_versions_helper.rb +++ b/app/helpers/note_versions_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module NoteVersionsHelper def note_version_body_diff_info(note_version) previous = note_version.previous diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb index 1579eccab..1759c2cd6 100644 --- a/app/helpers/pagination_helper.rb +++ b/app/helpers/pagination_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PaginationHelper def sequential_paginator(records) with_paginator_wrapper do diff --git a/app/helpers/pool_versions_helper.rb b/app/helpers/pool_versions_helper.rb index d026f5203..8eb2bd60d 100644 --- a/app/helpers/pool_versions_helper.rb +++ b/app/helpers/pool_versions_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PoolVersionsHelper def pool_version_posts_diff(pool_version) changes = [] diff --git a/app/helpers/pools_helper.rb b/app/helpers/pools_helper.rb index 8f7dd1d71..637f7b507 100644 --- a/app/helpers/pools_helper.rb +++ b/app/helpers/pools_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PoolsHelper def recent_updated_pools pool_ids = session[:recent_pool_ids].to_s.scan(/\d+/) diff --git a/app/helpers/post_replacement_helper.rb b/app/helpers/post_replacement_helper.rb index 791368251..fcc6938c4 100644 --- a/app/helpers/post_replacement_helper.rb +++ b/app/helpers/post_replacement_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostReplacementHelper def replacement_thumbnail(replacement) if replacement.post.deleteblocked? diff --git a/app/helpers/post_versions_helper.rb b/app/helpers/post_versions_helper.rb index 51330e22e..4a602c949 100644 --- a/app/helpers/post_versions_helper.rb +++ b/app/helpers/post_versions_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostVersionsHelper def post_source_diff(post_version) diff = post_version.diff_sources(post_version.previous) diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index 1810c5df5..09c0c32e5 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostsHelper def discover_mode? params[:tags] =~ /order:rank/ diff --git a/app/helpers/stats_helper.rb b/app/helpers/stats_helper.rb index 9cb58ba7d..c446d3a98 100644 --- a/app/helpers/stats_helper.rb +++ b/app/helpers/stats_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module StatsHelper def del(number) number_with_precision(number, precision: 0, delimiter: ",") diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index 45f78ac7e..7d9324181 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module TagsHelper def format_transitive_item(transitive) html = "#{transitive[0].to_s.titlecase} ".html_safe diff --git a/app/helpers/takedowns_helper.rb b/app/helpers/takedowns_helper.rb index 19bb5f2b2..23eb2c208 100644 --- a/app/helpers/takedowns_helper.rb +++ b/app/helpers/takedowns_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module TakedownsHelper def pretty_takedown_status(takedown) status = takedown.status.capitalize diff --git a/app/helpers/text_helper.rb b/app/helpers/text_helper.rb index ff0ef2a5f..7041f72f9 100644 --- a/app/helpers/text_helper.rb +++ b/app/helpers/text_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module TextHelper def text_diff(this, that) Diffy::Diff.new(this, that, ignore_crlf: true).to_s(:html).html_safe diff --git a/app/helpers/ticket_helper.rb b/app/helpers/ticket_helper.rb index b9d552152..6e1477b26 100644 --- a/app/helpers/ticket_helper.rb +++ b/app/helpers/ticket_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module TicketHelper def pretty_ticket_status(ticket) status = ticket.status diff --git a/app/helpers/title_helper.rb b/app/helpers/title_helper.rb index b133c4cd9..3fc72eb12 100644 --- a/app/helpers/title_helper.rb +++ b/app/helpers/title_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module TitleHelper def get_title return Danbooru.config.app_name if current_page? root_path diff --git a/app/helpers/uploads_helper.rb b/app/helpers/uploads_helper.rb index 17855f668..f129b4caa 100644 --- a/app/helpers/uploads_helper.rb +++ b/app/helpers/uploads_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UploadsHelper def render_status(upload) case upload.status diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index ce25c9b75..161233348 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UsersHelper def email_sig(user, purpose, expires = nil) EmailLinkValidator.generate("#{user.id}", purpose, expires) diff --git a/app/helpers/wiki_pages_helper.rb b/app/helpers/wiki_pages_helper.rb index 4bf5b91d2..cc542e8f5 100644 --- a/app/helpers/wiki_pages_helper.rb +++ b/app/helpers/wiki_pages_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WikiPagesHelper def link_to_wiki_or_new(text, tag = text) link_to(text, show_or_new_wiki_pages_path(title: tag)) diff --git a/app/inputs/boolean_input.rb b/app/inputs/boolean_input.rb index 8cc6daecc..20bd0f401 100644 --- a/app/inputs/boolean_input.rb +++ b/app/inputs/boolean_input.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BooleanInput < SimpleForm::Inputs::BooleanInput # Fix styling because the input appears before the label def label_input(wrapper_options = nil) diff --git a/app/inputs/button_select_input.rb b/app/inputs/button_select_input.rb index eec44e6c0..37d3d3cb4 100644 --- a/app/inputs/button_select_input.rb +++ b/app/inputs/button_select_input.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This behaves just like the inherited input, but adds # a css class for custom styling. Nothing more, nothing less. class ButtonSelectInput < SimpleForm::Inputs::CollectionRadioButtonsInput diff --git a/app/inputs/custom_form_builder.rb b/app/inputs/custom_form_builder.rb index 4e1d6b48f..7aaccc042 100644 --- a/app/inputs/custom_form_builder.rb +++ b/app/inputs/custom_form_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CustomFormBuilder < SimpleForm::FormBuilder def input(attribute_name, options = {}, &) options = insert_autocomplete(options) diff --git a/app/inputs/dtext_input.rb b/app/inputs/dtext_input.rb index 1a406d4d9..d68aa564b 100644 --- a/app/inputs/dtext_input.rb +++ b/app/inputs/dtext_input.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DtextInput < SimpleForm::Inputs::TextInput def input(wrapper_options = nil) input_html_options[:cols] = "80" diff --git a/app/inputs/form_builder_common.rb b/app/inputs/form_builder_common.rb index 7e3865761..062b09b5f 100644 --- a/app/inputs/form_builder_common.rb +++ b/app/inputs/form_builder_common.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FormBuilderCommon def insert_autocomplete(options) options[:input_html] ||= {} diff --git a/app/inputs/form_field_collector.rb b/app/inputs/form_field_collector.rb index ad90d7883..8dc65d59a 100644 --- a/app/inputs/form_field_collector.rb +++ b/app/inputs/form_field_collector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Captures all the input names used in a form block class FormFieldCollector attr_reader :fields diff --git a/app/inputs/search_form_builder.rb b/app/inputs/search_form_builder.rb index bd11f80b3..357caedd2 100644 --- a/app/inputs/search_form_builder.rb +++ b/app/inputs/search_form_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SearchFormBuilder < SimpleForm::FormBuilder def input(attribute_name, options = {}, &) value = value_for_attribute(attribute_name, options) diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index 156dd8404..3b8776f09 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationJob < ActiveJob::Base class JobError < Exception ; end # Automatically retry jobs that encountered a deadlock diff --git a/app/jobs/iqdb_remove_job.rb b/app/jobs/iqdb_remove_job.rb index ce647971c..a8dcb2475 100644 --- a/app/jobs/iqdb_remove_job.rb +++ b/app/jobs/iqdb_remove_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IqdbRemoveJob < ApplicationJob queue_as :iqdb diff --git a/app/jobs/iqdb_update_job.rb b/app/jobs/iqdb_update_job.rb index 1fed4eacb..c2750b332 100644 --- a/app/jobs/iqdb_update_job.rb +++ b/app/jobs/iqdb_update_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IqdbUpdateJob < ApplicationJob queue_as :iqdb diff --git a/app/jobs/tag_alias_job.rb b/app/jobs/tag_alias_job.rb index 45583bb4a..7b3a3a7e4 100644 --- a/app/jobs/tag_alias_job.rb +++ b/app/jobs/tag_alias_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagAliasJob < ApplicationJob queue_as :tags sidekiq_options lock: :until_executed, lock_args_method: :lock_args diff --git a/app/jobs/tag_alias_undo_job.rb b/app/jobs/tag_alias_undo_job.rb index bb1380dac..91251a948 100644 --- a/app/jobs/tag_alias_undo_job.rb +++ b/app/jobs/tag_alias_undo_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagAliasUndoJob < ApplicationJob queue_as :tags diff --git a/app/jobs/tag_batch_job.rb b/app/jobs/tag_batch_job.rb index 512cdc42f..2cbbded07 100644 --- a/app/jobs/tag_batch_job.rb +++ b/app/jobs/tag_batch_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagBatchJob < ApplicationJob queue_as :tags diff --git a/app/jobs/tag_implication_job.rb b/app/jobs/tag_implication_job.rb index add37f08f..58a3dce95 100644 --- a/app/jobs/tag_implication_job.rb +++ b/app/jobs/tag_implication_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagImplicationJob < ApplicationJob queue_as :tags sidekiq_options lock: :until_executed, lock_args_method: :lock_args diff --git a/app/jobs/tag_nuke_job.rb b/app/jobs/tag_nuke_job.rb index 420158b68..8054d7b46 100644 --- a/app/jobs/tag_nuke_job.rb +++ b/app/jobs/tag_nuke_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagNukeJob < ApplicationJob queue_as :tags sidekiq_options lock: :until_executed, lock_args_method: :lock_args diff --git a/app/jobs/tag_post_count_job.rb b/app/jobs/tag_post_count_job.rb index 64086addf..8d18d0f08 100644 --- a/app/jobs/tag_post_count_job.rb +++ b/app/jobs/tag_post_count_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagPostCountJob < ApplicationJob queue_as :tags sidekiq_options lock: :until_executed, lock_args_method: :lock_args diff --git a/app/jobs/tag_update_related_job.rb b/app/jobs/tag_update_related_job.rb index b3bd48e6e..81c4f9724 100644 --- a/app/jobs/tag_update_related_job.rb +++ b/app/jobs/tag_update_related_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagUpdateRelatedJob < ApplicationJob queue_as :tags diff --git a/app/jobs/transfer_favorites_job.rb b/app/jobs/transfer_favorites_job.rb index f428a85fb..b1c645a73 100644 --- a/app/jobs/transfer_favorites_job.rb +++ b/app/jobs/transfer_favorites_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TransferFavoritesJob < ApplicationJob queue_as :low_prio diff --git a/app/jobs/update_tag_category_job.rb b/app/jobs/update_tag_category_job.rb index f97930f88..97336a11a 100644 --- a/app/jobs/update_tag_category_job.rb +++ b/app/jobs/update_tag_category_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UpdateTagCategoryJob < ApplicationJob queue_as :low_prio sidekiq_options lock: :until_executed, lock_args_method: :lock_args diff --git a/app/jobs/upload_delete_files_job.rb b/app/jobs/upload_delete_files_job.rb index df8873f7d..e49e6ad32 100644 --- a/app/jobs/upload_delete_files_job.rb +++ b/app/jobs/upload_delete_files_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadDeleteFilesJob < ApplicationJob queue_as :default diff --git a/app/jobs/user_deletion_job.rb b/app/jobs/user_deletion_job.rb index 3d5d41ac2..2b8515806 100644 --- a/app/jobs/user_deletion_job.rb +++ b/app/jobs/user_deletion_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserDeletionJob < ApplicationJob queue_as :low_prio diff --git a/app/logical/admin_dashboard.rb b/app/logical/admin_dashboard.rb index 375764621..94a2123ae 100644 --- a/app/logical/admin_dashboard.rb +++ b/app/logical/admin_dashboard.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AdminDashboard def tag_aliases TagAlias.where(status: "pending").order("id desc").limit(100) diff --git a/app/logical/admin_route_constraint.rb b/app/logical/admin_route_constraint.rb index c123212ff..fc4174dfe 100644 --- a/app/logical/admin_route_constraint.rb +++ b/app/logical/admin_route_constraint.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AdminRouteConstraint def matches?(request) return false unless request.session[:user_id] diff --git a/app/logical/apng_inspector.rb b/app/logical/apng_inspector.rb index 30b97b87b..5fa97b302 100644 --- a/app/logical/apng_inspector.rb +++ b/app/logical/apng_inspector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApngInspector attr_reader :frames @@ -44,12 +46,12 @@ class ApngInspector current_pos = file.tell - chunk_len, chunk_name = chunkheader.unpack("Na4".freeze) + chunk_len, chunk_name = chunkheader.unpack("Na4") return false if chunk_name =~ /[^A-Za-z]/ yield chunk_name, chunk_len, file #no need to read further if IEND is reached - if chunk_name == "IEND".freeze + if chunk_name == "IEND" iend_reached = true break end @@ -74,7 +76,7 @@ class ApngInspector actl_corrupted = false read_success = each_chunk do |name, len, file| - if name == 'acTL'.freeze + if name == "acTL" framecount = parse_actl(len, file) if framecount < 1 actl_corrupted = true @@ -106,7 +108,7 @@ class ApngInspector if framedata == nil || framedata.length != 4 return -1 end - return framedata.unpack("N".freeze)[0] + framedata.unpack1("N") end end diff --git a/app/logical/bulk_related_tag_query.rb b/app/logical/bulk_related_tag_query.rb index 3d6acbafa..b2437e48f 100644 --- a/app/logical/bulk_related_tag_query.rb +++ b/app/logical/bulk_related_tag_query.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BulkRelatedTagQuery include ActiveModel::Serializers::JSON diff --git a/app/logical/bulk_update_request_importer.rb b/app/logical/bulk_update_request_importer.rb index 5c10f0aed..3a92a14c5 100644 --- a/app/logical/bulk_update_request_importer.rb +++ b/app/logical/bulk_update_request_importer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BulkUpdateRequestImporter class Error < RuntimeError; end attr_accessor :text, :forum_id, :creator_id, :creator_ip_addr diff --git a/app/logical/cache.rb b/app/logical/cache.rb index 51ff5773e..b34351017 100644 --- a/app/logical/cache.rb +++ b/app/logical/cache.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Cache def self.read_multi(keys, prefix) sanitized_key_to_key_hash = keys.index_by { |key| "#{prefix}:#{key}" } diff --git a/app/logical/cloudflare_service.rb b/app/logical/cloudflare_service.rb index 9ca3dce4d..d00bfbc5e 100644 --- a/app/logical/cloudflare_service.rb +++ b/app/logical/cloudflare_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CloudflareService def self.ips text, code = Cache.fetch("cloudflare_ips", expires_in: 24.hours) do diff --git a/app/logical/current_user.rb b/app/logical/current_user.rb index 06e415cbb..83c9632f1 100644 --- a/app/logical/current_user.rb +++ b/app/logical/current_user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CurrentUser def self.scoped(user, ip_addr = "127.0.0.1") old_user = self.user diff --git a/app/logical/custom_css.rb b/app/logical/custom_css.rb index 0f3629095..41fe2e46c 100644 --- a/app/logical/custom_css.rb +++ b/app/logical/custom_css.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CustomCss def self.parse(css) css.to_s.split(/\r\n|\r|\n/).map do |line| diff --git a/app/logical/danbooru/has_bit_flags.rb b/app/logical/danbooru/has_bit_flags.rb index 6e7fa2ce7..dc3536dc3 100644 --- a/app/logical/danbooru/has_bit_flags.rb +++ b/app/logical/danbooru/has_bit_flags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru module HasBitFlags extend ActiveSupport::Concern diff --git a/app/logical/danbooru/paginator/active_record_extension.rb b/app/logical/danbooru/paginator/active_record_extension.rb index 887db857f..fbe387b28 100644 --- a/app/logical/danbooru/paginator/active_record_extension.rb +++ b/app/logical/danbooru/paginator/active_record_extension.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru module Paginator module ActiveRecordExtension diff --git a/app/logical/danbooru/paginator/base_extension.rb b/app/logical/danbooru/paginator/base_extension.rb index f0fc3c3b4..796cca671 100644 --- a/app/logical/danbooru/paginator/base_extension.rb +++ b/app/logical/danbooru/paginator/base_extension.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru module Paginator module BaseExtension diff --git a/app/logical/danbooru/paginator/document_store_extensions.rb b/app/logical/danbooru/paginator/document_store_extensions.rb index 0735e5f0a..bace6ee22 100644 --- a/app/logical/danbooru/paginator/document_store_extensions.rb +++ b/app/logical/danbooru/paginator/document_store_extensions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru module Paginator module DocumentStoreExtensions diff --git a/app/logical/danbooru/paginator/paginated_array.rb b/app/logical/danbooru/paginator/paginated_array.rb index 581da8e77..f7b570e0f 100644 --- a/app/logical/danbooru/paginator/paginated_array.rb +++ b/app/logical/danbooru/paginator/paginated_array.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru module Paginator class PaginatedArray < Array diff --git a/app/logical/danbooru/paginator/pagination_error.rb b/app/logical/danbooru/paginator/pagination_error.rb index f5da127c9..c9801ecb2 100644 --- a/app/logical/danbooru/paginator/pagination_error.rb +++ b/app/logical/danbooru/paginator/pagination_error.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru module Paginator class PaginationError < Exception diff --git a/app/logical/danbooru_image_resizer.rb b/app/logical/danbooru_image_resizer.rb index b3eb926ac..a190aa35d 100644 --- a/app/logical/danbooru_image_resizer.rb +++ b/app/logical/danbooru_image_resizer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DanbooruImageResizer module_function diff --git a/app/logical/danbooru_logger.rb b/app/logical/danbooru_logger.rb index 594a20b22..3524fedd8 100644 --- a/app/logical/danbooru_logger.rb +++ b/app/logical/danbooru_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DanbooruLogger def self.log(exception, expected: false, **params) if expected diff --git a/app/logical/danger_zone.rb b/app/logical/danger_zone.rb index ef8e5443e..fe251e620 100644 --- a/app/logical/danger_zone.rb +++ b/app/logical/danger_zone.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DangerZone def self.uploads_disabled?(user) user.level < min_upload_level diff --git a/app/logical/diffy_no_subprocess.rb b/app/logical/diffy_no_subprocess.rb index 75c0e3b36..d5f24aa77 100644 --- a/app/logical/diffy_no_subprocess.rb +++ b/app/logical/diffy_no_subprocess.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Diffy normally calls out to git diff, this makes it use libgit2 instead module DiffyNoSubprocess # https://github.com/samg/diffy/blob/85b18fa6b659f724937dea58ebbc0564f4475c8c/lib/diffy/diff.rb#L43-L77 diff --git a/app/logical/discord_report/aibur_stats.rb b/app/logical/discord_report/aibur_stats.rb index 4e3b82b3b..7690c7fd3 100644 --- a/app/logical/discord_report/aibur_stats.rb +++ b/app/logical/discord_report/aibur_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiscordReport class AiburStats < Base def webhook_url diff --git a/app/logical/discord_report/base.rb b/app/logical/discord_report/base.rb index a66915de0..49602a6df 100644 --- a/app/logical/discord_report/base.rb +++ b/app/logical/discord_report/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiscordReport class Base def webhook_url diff --git a/app/logical/discord_report/janitor_stats.rb b/app/logical/discord_report/janitor_stats.rb index 136542e80..c31013188 100644 --- a/app/logical/discord_report/janitor_stats.rb +++ b/app/logical/discord_report/janitor_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiscordReport class JanitorStats < Base def webhook_url diff --git a/app/logical/discord_report/moderator_stats.rb b/app/logical/discord_report/moderator_stats.rb index 59a11eb2e..978240124 100644 --- a/app/logical/discord_report/moderator_stats.rb +++ b/app/logical/discord_report/moderator_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiscordReport class ModeratorStats < Base def webhook_url diff --git a/app/logical/document_store/class_method_proxy.rb b/app/logical/document_store/class_method_proxy.rb index 93326258e..7294072d8 100644 --- a/app/logical/document_store/class_method_proxy.rb +++ b/app/logical/document_store/class_method_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DocumentStore class ClassMethodProxy delegate_missing_to :@target diff --git a/app/logical/document_store/instance_method_proxy.rb b/app/logical/document_store/instance_method_proxy.rb index 7211f4c9e..c4cee4feb 100644 --- a/app/logical/document_store/instance_method_proxy.rb +++ b/app/logical/document_store/instance_method_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DocumentStore class InstanceMethodProxy delegate :client, :index_name, to: :class_document_store diff --git a/app/logical/document_store/model.rb b/app/logical/document_store/model.rb index 0f974fc36..47087e05b 100644 --- a/app/logical/document_store/model.rb +++ b/app/logical/document_store/model.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DocumentStore module Model def self.included(klass) diff --git a/app/logical/document_store/proxy.rb b/app/logical/document_store/proxy.rb index b5518319e..d710b0989 100644 --- a/app/logical/document_store/proxy.rb +++ b/app/logical/document_store/proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DocumentStore module Proxy def self.included(base) diff --git a/app/logical/document_store/response.rb b/app/logical/document_store/response.rb index 21808a04f..4fbc6377a 100644 --- a/app/logical/document_store/response.rb +++ b/app/logical/document_store/response.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DocumentStore class Response include Danbooru::Paginator::DocumentStoreExtensions diff --git a/app/logical/document_store/search_request.rb b/app/logical/document_store/search_request.rb index 9701e5512..d77a23a6b 100644 --- a/app/logical/document_store/search_request.rb +++ b/app/logical/document_store/search_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DocumentStore class SearchRequest attr_reader :definition diff --git a/app/logical/downloads/file.rb b/app/logical/downloads/file.rb index 97fa5fa7b..29190188a 100644 --- a/app/logical/downloads/file.rb +++ b/app/logical/downloads/file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Downloads class File include ActiveModel::Validations diff --git a/app/logical/dummy_ticket.rb b/app/logical/dummy_ticket.rb index d87a59100..ad9b3fc77 100644 --- a/app/logical/dummy_ticket.rb +++ b/app/logical/dummy_ticket.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DummyTicket def initialize(accused, post_id) @ticket = Ticket.new( diff --git a/app/logical/elastic_post_query_builder.rb b/app/logical/elastic_post_query_builder.rb index 5fa3a84eb..eab85cd84 100644 --- a/app/logical/elastic_post_query_builder.rb +++ b/app/logical/elastic_post_query_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ElasticPostQueryBuilder < ElasticQueryBuilder LOCK_TYPE_TO_INDEX_FIELD = { rating: :rating_locked, diff --git a/app/logical/elastic_query_builder.rb b/app/logical/elastic_query_builder.rb index a05eb15bf..7a27ec142 100644 --- a/app/logical/elastic_query_builder.rb +++ b/app/logical/elastic_query_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ElasticQueryBuilder attr_accessor :q, :must, :must_not, :should, :order diff --git a/app/logical/email_link_validator.rb b/app/logical/email_link_validator.rb index 5e8341c45..89c7fbbf7 100644 --- a/app/logical/email_link_validator.rb +++ b/app/logical/email_link_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EmailLinkValidator def self.generate(message, purpose, expires = nil) diff --git a/app/logical/favorite_manager.rb b/app/logical/favorite_manager.rb index 6b86c95b2..0e3173b22 100644 --- a/app/logical/favorite_manager.rb +++ b/app/logical/favorite_manager.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FavoriteManager ISOLATION = Rails.env.test? ? {} : { isolation: :repeatable_read } diff --git a/app/logical/file_methods.rb b/app/logical/file_methods.rb index 84ce1ca56..5e59d4bae 100644 --- a/app/logical/file_methods.rb +++ b/app/logical/file_methods.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FileMethods def is_image? is_png? || is_jpg? || is_gif? diff --git a/app/logical/file_validator.rb b/app/logical/file_validator.rb index f003f8ee6..718b04de0 100644 --- a/app/logical/file_validator.rb +++ b/app/logical/file_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FileValidator attr_reader :record, :file_path diff --git a/app/logical/forum_updater.rb b/app/logical/forum_updater.rb index a0047026c..04cb4b133 100644 --- a/app/logical/forum_updater.rb +++ b/app/logical/forum_updater.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumUpdater attr_reader :forum_topic, :forum_post, :expected_title diff --git a/app/logical/git_helper.rb b/app/logical/git_helper.rb index 8854dad2b..c59e496b9 100644 --- a/app/logical/git_helper.rb +++ b/app/logical/git_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module GitHelper def self.init if Rails.root.join("REVISION").exist? diff --git a/app/logical/maintenance.rb b/app/logical/maintenance.rb index 84d618ab5..faac35dc9 100644 --- a/app/logical/maintenance.rb +++ b/app/logical/maintenance.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module_function diff --git a/app/logical/meta_searches/tag.rb b/app/logical/meta_searches/tag.rb index 0c74a367f..a0094bde2 100644 --- a/app/logical/meta_searches/tag.rb +++ b/app/logical/meta_searches/tag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MetaSearches::Tag MAX_RESULTS = 25 attr_reader :search, :tags, :tag_aliases, :tag_implications diff --git a/app/logical/moderator/dashboard/queries/artist.rb b/app/logical/moderator/dashboard/queries/artist.rb index e2c545e1a..c35c24233 100644 --- a/app/logical/moderator/dashboard/queries/artist.rb +++ b/app/logical/moderator/dashboard/queries/artist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/queries/comment.rb b/app/logical/moderator/dashboard/queries/comment.rb index 526469045..512972aaf 100644 --- a/app/logical/moderator/dashboard/queries/comment.rb +++ b/app/logical/moderator/dashboard/queries/comment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/queries/mod_action.rb b/app/logical/moderator/dashboard/queries/mod_action.rb index 14fea6034..fc2bd129d 100644 --- a/app/logical/moderator/dashboard/queries/mod_action.rb +++ b/app/logical/moderator/dashboard/queries/mod_action.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/queries/note.rb b/app/logical/moderator/dashboard/queries/note.rb index 666b09ffc..827921eca 100644 --- a/app/logical/moderator/dashboard/queries/note.rb +++ b/app/logical/moderator/dashboard/queries/note.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/queries/tag.rb b/app/logical/moderator/dashboard/queries/tag.rb index ae2e5de87..8f01227ef 100644 --- a/app/logical/moderator/dashboard/queries/tag.rb +++ b/app/logical/moderator/dashboard/queries/tag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/queries/upload.rb b/app/logical/moderator/dashboard/queries/upload.rb index 0399a7848..c8afd4176 100644 --- a/app/logical/moderator/dashboard/queries/upload.rb +++ b/app/logical/moderator/dashboard/queries/upload.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/queries/user_feedback.rb b/app/logical/moderator/dashboard/queries/user_feedback.rb index 81a4a195d..bbacab8ed 100644 --- a/app/logical/moderator/dashboard/queries/user_feedback.rb +++ b/app/logical/moderator/dashboard/queries/user_feedback.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/queries/wiki_page.rb b/app/logical/moderator/dashboard/queries/wiki_page.rb index 7a9932dc7..1b560696d 100644 --- a/app/logical/moderator/dashboard/queries/wiki_page.rb +++ b/app/logical/moderator/dashboard/queries/wiki_page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard module Queries diff --git a/app/logical/moderator/dashboard/report.rb b/app/logical/moderator/dashboard/report.rb index 657280c94..2e29d6915 100644 --- a/app/logical/moderator/dashboard/report.rb +++ b/app/logical/moderator/dashboard/report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator module Dashboard class Report diff --git a/app/logical/moderator/ip_addr_search.rb b/app/logical/moderator/ip_addr_search.rb index 8351022bd..f336c502e 100644 --- a/app/logical/moderator/ip_addr_search.rb +++ b/app/logical/moderator/ip_addr_search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Moderator class IpAddrSearch attr_reader :params diff --git a/app/logical/parse_value.rb b/app/logical/parse_value.rb index d2bba91fd..3949945f2 100644 --- a/app/logical/parse_value.rb +++ b/app/logical/parse_value.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ParseValue extend self diff --git a/app/logical/pbkdf2.rb b/app/logical/pbkdf2.rb index f5d7b903a..2fb878c38 100644 --- a/app/logical/pbkdf2.rb +++ b/app/logical/pbkdf2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Password Hashing With PBKDF2 (http://crackstation.net/hashing-security.htm). # Copyright (c) 2013, Taylor Hornby # All rights reserved. diff --git a/app/logical/post_pruner.rb b/app/logical/post_pruner.rb index 3421d23b1..4193228b1 100644 --- a/app/logical/post_pruner.rb +++ b/app/logical/post_pruner.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostPruner DELETION_WINDOW = 30 diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index 9d80ecd9f..d8f00c9d1 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostQueryBuilder attr_accessor :query_string diff --git a/app/logical/post_search_context.rb b/app/logical/post_search_context.rb index e4a16dc3c..831269ed9 100644 --- a/app/logical/post_search_context.rb +++ b/app/logical/post_search_context.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostSearchContext attr_reader :post diff --git a/app/logical/post_sets/base.rb b/app/logical/post_sets/base.rb index 21c139ee4..8863b2759 100644 --- a/app/logical/post_sets/base.rb +++ b/app/logical/post_sets/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSets class Base def tag_string diff --git a/app/logical/post_sets/favorites.rb b/app/logical/post_sets/favorites.rb index 056639994..4e5d7b66d 100644 --- a/app/logical/post_sets/favorites.rb +++ b/app/logical/post_sets/favorites.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSets class Favorites < PostSets::Base attr_reader :page, :limit diff --git a/app/logical/post_sets/popular.rb b/app/logical/post_sets/popular.rb index 6e7a0c427..acac363fa 100644 --- a/app/logical/post_sets/popular.rb +++ b/app/logical/post_sets/popular.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSets class Popular < PostSets::Base attr_reader :date, :scale, :limit diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index a9ae7eabf..0b7211d2b 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSets class Post < PostSets::Base MAX_PER_PAGE = 320 diff --git a/app/logical/post_sets/post_relationship.rb b/app/logical/post_sets/post_relationship.rb index 250c40cbd..fb87ebc72 100644 --- a/app/logical/post_sets/post_relationship.rb +++ b/app/logical/post_sets/post_relationship.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSets class PostRelationship < PostSets::Post attr_reader :parent, :children diff --git a/app/logical/post_thumbnailer.rb b/app/logical/post_thumbnailer.rb index e40b3eff7..18f89cb0c 100644 --- a/app/logical/post_thumbnailer.rb +++ b/app/logical/post_thumbnailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostThumbnailer extend self def generate_resizes(file, height, width, type) diff --git a/app/logical/processing_error.rb b/app/logical/processing_error.rb index ce224f2b1..1842cc11e 100644 --- a/app/logical/processing_error.rb +++ b/app/logical/processing_error.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ProcessingError < Exception end diff --git a/app/logical/rate_limiter.rb b/app/logical/rate_limiter.rb index ba6cf15e0..202f8ebb3 100644 --- a/app/logical/rate_limiter.rb +++ b/app/logical/rate_limiter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RateLimiter def self.check_limit(key, max_attempts, lockout_time = 1.minute) return true if Cache.fetch("#{key}:lockout") diff --git a/app/logical/related_tag_calculator.rb b/app/logical/related_tag_calculator.rb index 9aaac8b84..baf16cfc3 100644 --- a/app/logical/related_tag_calculator.rb +++ b/app/logical/related_tag_calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RelatedTagCalculator MAX_RESULTS = 25 diff --git a/app/logical/related_tag_query.rb b/app/logical/related_tag_query.rb index 81dacc35f..69cff08f5 100644 --- a/app/logical/related_tag_query.rb +++ b/app/logical/related_tag_query.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RelatedTagQuery include ActiveModel::Serializers::JSON diff --git a/app/logical/session_creator.rb b/app/logical/session_creator.rb index 018da45af..c43ea5f41 100644 --- a/app/logical/session_creator.rb +++ b/app/logical/session_creator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SessionCreator attr_reader :session, :cookies, :name, :password, :ip_addr, :remember, :secure diff --git a/app/logical/session_loader.rb b/app/logical/session_loader.rb index ec43cba87..95de5d369 100644 --- a/app/logical/session_loader.rb +++ b/app/logical/session_loader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SessionLoader class AuthenticationFailure < Exception ; end diff --git a/app/logical/set_diff.rb b/app/logical/set_diff.rb index b88b1fc9c..b58f7c14a 100644 --- a/app/logical/set_diff.rb +++ b/app/logical/set_diff.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SetDiff attr_reader :additions, :removals, :added, :removed, :obsolete_added, :obsolete_removed, :changed, :unchanged diff --git a/app/logical/sources/alternates.rb b/app/logical/sources/alternates.rb index 1119bba5c..f542a60d4 100644 --- a/app/logical/sources/alternates.rb +++ b/app/logical/sources/alternates.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources module Alternates def self.all diff --git a/app/logical/sources/alternates/base.rb b/app/logical/sources/alternates/base.rb index 1da2663ed..6682c2c72 100644 --- a/app/logical/sources/alternates/base.rb +++ b/app/logical/sources/alternates/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources module Alternates class Base diff --git a/app/logical/sources/alternates/furaffinity.rb b/app/logical/sources/alternates/furaffinity.rb index ad66caff3..d4aed9c44 100644 --- a/app/logical/sources/alternates/furaffinity.rb +++ b/app/logical/sources/alternates/furaffinity.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources module Alternates class Furaffinity < Base diff --git a/app/logical/sources/alternates/null.rb b/app/logical/sources/alternates/null.rb index 498e2aec9..a5dd6b68b 100644 --- a/app/logical/sources/alternates/null.rb +++ b/app/logical/sources/alternates/null.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources module Alternates class Null < Base diff --git a/app/logical/sources/alternates/pixiv.rb b/app/logical/sources/alternates/pixiv.rb index d822b7545..39161c9b6 100644 --- a/app/logical/sources/alternates/pixiv.rb +++ b/app/logical/sources/alternates/pixiv.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources module Alternates class Pixiv < Base diff --git a/app/logical/sources/error.rb b/app/logical/sources/error.rb index e88b014fc..79ca185ee 100644 --- a/app/logical/sources/error.rb +++ b/app/logical/sources/error.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources class Error < StandardError end diff --git a/app/logical/sources/strategies.rb b/app/logical/sources/strategies.rb index 770fb27b0..066077ce2 100644 --- a/app/logical/sources/strategies.rb +++ b/app/logical/sources/strategies.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources module Strategies def self.all diff --git a/app/logical/sources/strategies/base.rb b/app/logical/sources/strategies/base.rb index 205d423f3..262755e62 100644 --- a/app/logical/sources/strategies/base.rb +++ b/app/logical/sources/strategies/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This is a collection of strategies for extracting information about a # resource. At a minimum it tries to extract the artist name and a canonical # URL to download the image from. But it can also be used to normalize a URL diff --git a/app/logical/sources/strategies/null.rb b/app/logical/sources/strategies/null.rb index 94d83b84d..9b6dc2f49 100644 --- a/app/logical/sources/strategies/null.rb +++ b/app/logical/sources/strategies/null.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Sources module Strategies class Null < Base diff --git a/app/logical/sources/strategies/pixiv_slim.rb b/app/logical/sources/strategies/pixiv_slim.rb index cf76b3283..302e14619 100644 --- a/app/logical/sources/strategies/pixiv_slim.rb +++ b/app/logical/sources/strategies/pixiv_slim.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Pixiv # # * https://i.pximg.net/img-original/img/2014/10/03/18/10/20/46324488_p0.png diff --git a/app/logical/stats_updater.rb b/app/logical/stats_updater.rb index 2928af7f8..955db182d 100644 --- a/app/logical/stats_updater.rb +++ b/app/logical/stats_updater.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StatsUpdater def self.run! stats = {} diff --git a/app/logical/storage_manager.rb b/app/logical/storage_manager.rb index 12cc192cd..a03f7601b 100644 --- a/app/logical/storage_manager.rb +++ b/app/logical/storage_manager.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StorageManager class Error < StandardError; end diff --git a/app/logical/storage_manager/hybrid.rb b/app/logical/storage_manager/hybrid.rb index f8cd36035..60697c6ea 100644 --- a/app/logical/storage_manager/hybrid.rb +++ b/app/logical/storage_manager/hybrid.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StorageManager::Hybrid < StorageManager attr_reader :submanager diff --git a/app/logical/storage_manager/local.rb b/app/logical/storage_manager/local.rb index 9153f1eaf..22ce097ce 100644 --- a/app/logical/storage_manager/local.rb +++ b/app/logical/storage_manager/local.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StorageManager::Local < StorageManager DEFAULT_PERMISSIONS = 0644 diff --git a/app/logical/storage_manager/match.rb b/app/logical/storage_manager/match.rb index 2e9a5cb05..255b69dbc 100644 --- a/app/logical/storage_manager/match.rb +++ b/app/logical/storage_manager/match.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + =begin Generalizes the hybrid storage manager to be more declarative in diff --git a/app/logical/storage_manager/null.rb b/app/logical/storage_manager/null.rb index ebaeb8bfe..0bae86a21 100644 --- a/app/logical/storage_manager/null.rb +++ b/app/logical/storage_manager/null.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StorageManager::Null < StorageManager def store(io, path) # no-op diff --git a/app/logical/tag_alias_request.rb b/app/logical/tag_alias_request.rb index cfa7db590..f57eb8828 100644 --- a/app/logical/tag_alias_request.rb +++ b/app/logical/tag_alias_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagAliasRequest < TagRelationshipRequest def self.topic_title(antecedent_name, consequent_name) "Tag alias: #{antecedent_name} -> #{consequent_name}" diff --git a/app/logical/tag_category.rb b/app/logical/tag_category.rb index a7bf51707..9f12dd8ba 100644 --- a/app/logical/tag_category.rb +++ b/app/logical/tag_category.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagCategory MAPPING = { "general" => 0, diff --git a/app/logical/tag_correction.rb b/app/logical/tag_correction.rb index 0a41d629b..97d04b51f 100644 --- a/app/logical/tag_correction.rb +++ b/app/logical/tag_correction.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagCorrection include ActiveModel::Model include ActiveModel::Serializers::JSON diff --git a/app/logical/tag_implication_request.rb b/app/logical/tag_implication_request.rb index 5d72255b1..88a1fbd9d 100644 --- a/app/logical/tag_implication_request.rb +++ b/app/logical/tag_implication_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagImplicationRequest < TagRelationshipRequest def self.topic_title(antecedent_name, consequent_name) "Tag implication: #{antecedent_name} -> #{consequent_name}" diff --git a/app/logical/tag_name_validator.rb b/app/logical/tag_name_validator.rb index 287d7ada6..f0e362d0b 100644 --- a/app/logical/tag_name_validator.rb +++ b/app/logical/tag_name_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagNameValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) normalized = Tag.normalize_name(value) diff --git a/app/logical/tag_query.rb b/app/logical/tag_query.rb index a20de54c6..43ac6ded4 100644 --- a/app/logical/tag_query.rb +++ b/app/logical/tag_query.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagQuery class CountExceededError < StandardError; end diff --git a/app/logical/tag_relationship_request.rb b/app/logical/tag_relationship_request.rb index ebed9318f..4a76eeaf2 100644 --- a/app/logical/tag_relationship_request.rb +++ b/app/logical/tag_relationship_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRelationshipRequest include ActiveModel::Validations diff --git a/app/logical/tags_preview.rb b/app/logical/tags_preview.rb index 7606444d6..915aa8cbb 100644 --- a/app/logical/tags_preview.rb +++ b/app/logical/tags_preview.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagsPreview def initialize(tags: nil) @tags = TagQuery.scan(tags).map {|x| {a: x, type: 'tag'}} diff --git a/app/logical/upload_service.rb b/app/logical/upload_service.rb index a04875ba0..20e5eb61e 100644 --- a/app/logical/upload_service.rb +++ b/app/logical/upload_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadService attr_reader :params, :post, :upload diff --git a/app/logical/upload_service/replacer.rb b/app/logical/upload_service/replacer.rb index b8c067454..3072a5796 100644 --- a/app/logical/upload_service/replacer.rb +++ b/app/logical/upload_service/replacer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadService class Replacer attr_reader :post, :replacement diff --git a/app/logical/upload_service/utils.rb b/app/logical/upload_service/utils.rb index 1196da82a..ea0fc7b68 100644 --- a/app/logical/upload_service/utils.rb +++ b/app/logical/upload_service/utils.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadService module Utils extend self diff --git a/app/logical/user_deletion.rb b/app/logical/user_deletion.rb index 6f32cbd50..8bd911afc 100644 --- a/app/logical/user_deletion.rb +++ b/app/logical/user_deletion.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserDeletion class ValidationError < Exception; end diff --git a/app/logical/user_email_change.rb b/app/logical/user_email_change.rb index 00fcb5a3e..38103b7e7 100644 --- a/app/logical/user_email_change.rb +++ b/app/logical/user_email_change.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserEmailChange attr_reader :user, :password, :new_email diff --git a/app/logical/user_name_validator.rb b/app/logical/user_name_validator.rb index 88130d0e4..427bbde9f 100644 --- a/app/logical/user_name_validator.rb +++ b/app/logical/user_name_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserNameValidator < ActiveModel::EachValidator def validate_each(rec, attr, value) name = value diff --git a/app/logical/user_promotion.rb b/app/logical/user_promotion.rb index 5c3b83c0b..578c2d8ac 100644 --- a/app/logical/user_promotion.rb +++ b/app/logical/user_promotion.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserPromotion attr_reader :user, :promoter, :new_level, :options, :old_can_approve_posts, :old_can_upload_free, :old_no_flagging, :old_replacements_beta diff --git a/app/logical/user_revert.rb b/app/logical/user_revert.rb index 779eb233a..ca93d5511 100644 --- a/app/logical/user_revert.rb +++ b/app/logical/user_revert.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # reverts all changes made by a user class UserRevert THRESHOLD = 1_000 diff --git a/app/logical/user_throttle.rb b/app/logical/user_throttle.rb index 4a80f71ff..f9cd3f5b3 100644 --- a/app/logical/user_throttle.rb +++ b/app/logical/user_throttle.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserThrottle def initialize(options, user) @prefix = options[:prefix] || "thtl:" diff --git a/app/logical/vote_manager.rb b/app/logical/vote_manager.rb index 2cc4b2d8b..6e29cdb93 100644 --- a/app/logical/vote_manager.rb +++ b/app/logical/vote_manager.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class VoteManager ISOLATION = Rails.env.test? ? {} : { isolation: :repeatable_read } diff --git a/app/mailers/maintenance/user/email_confirmation_mailer.rb b/app/mailers/maintenance/user/email_confirmation_mailer.rb index c89319cc1..1cc2be4d9 100644 --- a/app/mailers/maintenance/user/email_confirmation_mailer.rb +++ b/app/mailers/maintenance/user/email_confirmation_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class EmailConfirmationMailer < ActionMailer::Base diff --git a/app/mailers/maintenance/user/login_reminder_mailer.rb b/app/mailers/maintenance/user/login_reminder_mailer.rb index 323cfc4e6..e17890009 100644 --- a/app/mailers/maintenance/user/login_reminder_mailer.rb +++ b/app/mailers/maintenance/user/login_reminder_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class LoginReminderMailer < ActionMailer::Base diff --git a/app/mailers/maintenance/user/password_reset_mailer.rb b/app/mailers/maintenance/user/password_reset_mailer.rb index 8726c3b50..7c63fafc1 100644 --- a/app/mailers/maintenance/user/password_reset_mailer.rb +++ b/app/mailers/maintenance/user/password_reset_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Maintenance module User class PasswordResetMailer < ActionMailer::Base diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 9aab7e433..228890c1d 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserMailer < ActionMailer::Base helper ApplicationHelper helper UsersHelper diff --git a/app/models/api_key.rb b/app/models/api_key.rb index 859926ad6..98a8602ea 100644 --- a/app/models/api_key.rb +++ b/app/models/api_key.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApiKey < ApplicationRecord belongs_to :user validates :user_id, uniqueness: true diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 5253cba5a..8e7385631 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationRecord < ActiveRecord::Base self.abstract_class = true diff --git a/app/models/artist.rb b/app/models/artist.rb index a09372106..e84004a8b 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Artist < ApplicationRecord class RevertError < Exception ; end diff --git a/app/models/artist_url.rb b/app/models/artist_url.rb index a70afc0c7..69f8dd4e7 100644 --- a/app/models/artist_url.rb +++ b/app/models/artist_url.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ArtistUrl < ApplicationRecord before_validation :initialize_normalized_url, on: :create before_validation :normalize diff --git a/app/models/artist_version.rb b/app/models/artist_version.rb index 024393cc1..6ff170896 100644 --- a/app/models/artist_version.rb +++ b/app/models/artist_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ArtistVersion < ApplicationRecord array_attribute :urls array_attribute :other_names diff --git a/app/models/ban.rb b/app/models/ban.rb index 9152a0d3b..6eb05bbe1 100644 --- a/app/models/ban.rb +++ b/app/models/ban.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Ban < ApplicationRecord attr_accessor :is_permaban after_create :create_feedback diff --git a/app/models/blip.rb b/app/models/blip.rb index 654e6ea56..62bc2ac94 100644 --- a/app/models/blip.rb +++ b/app/models/blip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Blip < ApplicationRecord include UserWarnable simple_versioning diff --git a/app/models/bulk_update_request.rb b/app/models/bulk_update_request.rb index c1bb1a0c9..7e78a2133 100644 --- a/app/models/bulk_update_request.rb +++ b/app/models/bulk_update_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BulkUpdateRequest < ApplicationRecord attr_accessor :reason, :skip_forum, :should_validate diff --git a/app/models/comment.rb b/app/models/comment.rb index f946e3b03..111bcd5e4 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Comment < ApplicationRecord RECENT_COUNT = 6 include UserWarnable diff --git a/app/models/comment_vote.rb b/app/models/comment_vote.rb index c2f6fcb61..d92f0cb71 100644 --- a/app/models/comment_vote.rb +++ b/app/models/comment_vote.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CommentVote < UserVote validate :validate_user_can_vote validate :validate_comment_can_be_voted diff --git a/app/models/destroyed_post.rb b/app/models/destroyed_post.rb index e2c7124b8..a84b4786e 100644 --- a/app/models/destroyed_post.rb +++ b/app/models/destroyed_post.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DestroyedPost < ApplicationRecord end diff --git a/app/models/dmail.rb b/app/models/dmail.rb index 3d6f3f6d3..6937b6df2 100644 --- a/app/models/dmail.rb +++ b/app/models/dmail.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Dmail < ApplicationRecord validates :title, :body, presence: { on: :create } validates :title, length: { minimum: 1, maximum: 250 } diff --git a/app/models/dmail_filter.rb b/app/models/dmail_filter.rb index 9be8d9000..730ae815e 100644 --- a/app/models/dmail_filter.rb +++ b/app/models/dmail_filter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DmailFilter < ApplicationRecord belongs_to :user validates :user, presence: true diff --git a/app/models/edit_history.rb b/app/models/edit_history.rb index 8d538d306..a57a27a1e 100644 --- a/app/models/edit_history.rb +++ b/app/models/edit_history.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EditHistory < ApplicationRecord self.table_name = 'edit_histories' belongs_to :versionable, polymorphic: true diff --git a/app/models/email_blacklist.rb b/app/models/email_blacklist.rb index fa523f287..3bc71fce2 100644 --- a/app/models/email_blacklist.rb +++ b/app/models/email_blacklist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EmailBlacklist < ApplicationRecord UNVERIFY_COUNT_TRESHOLD = 250 diff --git a/app/models/exception_log.rb b/app/models/exception_log.rb index 2e8502ff3..1a2355ea5 100644 --- a/app/models/exception_log.rb +++ b/app/models/exception_log.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ExceptionLog < ApplicationRecord serialize :extra_params, coder: JSON diff --git a/app/models/favorite.rb b/app/models/favorite.rb index 3c888afee..6f1b78984 100644 --- a/app/models/favorite.rb +++ b/app/models/favorite.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Favorite < ApplicationRecord class Error < Exception end diff --git a/app/models/forum_category.rb b/app/models/forum_category.rb index 3bf28e150..bb52589aa 100644 --- a/app/models/forum_category.rb +++ b/app/models/forum_category.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumCategory < ApplicationRecord has_many :forum_topics, -> { order(id: :desc) }, foreign_key: :category validates :name, uniqueness: { case_sensitive: false } diff --git a/app/models/forum_post.rb b/app/models/forum_post.rb index 37692015b..cf0d27a47 100644 --- a/app/models/forum_post.rb +++ b/app/models/forum_post.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumPost < ApplicationRecord include UserWarnable simple_versioning diff --git a/app/models/forum_post_vote.rb b/app/models/forum_post_vote.rb index 1dec3fdb9..81a8a0068 100644 --- a/app/models/forum_post_vote.rb +++ b/app/models/forum_post_vote.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumPostVote < ApplicationRecord belongs_to_creator belongs_to :forum_post diff --git a/app/models/forum_subscription.rb b/app/models/forum_subscription.rb index 4ef1312db..595218af7 100644 --- a/app/models/forum_subscription.rb +++ b/app/models/forum_subscription.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumSubscription < ApplicationRecord belongs_to :user belongs_to :forum_topic diff --git a/app/models/forum_topic.rb b/app/models/forum_topic.rb index b24dbbfe5..ccbd90985 100644 --- a/app/models/forum_topic.rb +++ b/app/models/forum_topic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumTopic < ApplicationRecord belongs_to_creator belongs_to_updater diff --git a/app/models/forum_topic_visit.rb b/app/models/forum_topic_visit.rb index 71f237125..34ca13214 100644 --- a/app/models/forum_topic_visit.rb +++ b/app/models/forum_topic_visit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ForumTopicVisit < ApplicationRecord belongs_to :user belongs_to :forum_topic diff --git a/app/models/help_page.rb b/app/models/help_page.rb index ede0d8f81..6e0b68710 100644 --- a/app/models/help_page.rb +++ b/app/models/help_page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HelpPage < ApplicationRecord validates :wiki_page, :name, uniqueness: true validates :wiki_page, :name, presence: true diff --git a/app/models/ip_ban.rb b/app/models/ip_ban.rb index cc5f12579..0cc3a73a2 100644 --- a/app/models/ip_ban.rb +++ b/app/models/ip_ban.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IpBan < ApplicationRecord belongs_to_creator validates :reason, :ip_addr, presence: true diff --git a/app/models/mascot.rb b/app/models/mascot.rb index 1fef43223..df8444f3b 100644 --- a/app/models/mascot.rb +++ b/app/models/mascot.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Mascot < ApplicationRecord belongs_to_creator diff --git a/app/models/mod_action.rb b/app/models/mod_action.rb index 3d01ce48a..2cdb03a08 100644 --- a/app/models/mod_action.rb +++ b/app/models/mod_action.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ModAction < ApplicationRecord belongs_to :creator, :class_name => "User" before_validation :initialize_creator, :on => :create diff --git a/app/models/news_update.rb b/app/models/news_update.rb index 32a216ea9..0a89689b9 100644 --- a/app/models/news_update.rb +++ b/app/models/news_update.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NewsUpdate < ApplicationRecord belongs_to_creator belongs_to_updater diff --git a/app/models/note.rb b/app/models/note.rb index 0ca49bcbe..2cf867288 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Note < ApplicationRecord class RevertError < Exception ; end diff --git a/app/models/note_version.rb b/app/models/note_version.rb index d1e51db78..cfba48e9f 100644 --- a/app/models/note_version.rb +++ b/app/models/note_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NoteVersion < ApplicationRecord user_status_counter :note_count, foreign_key: :updater_id belongs_to_updater diff --git a/app/models/pool.rb b/app/models/pool.rb index eae9813c1..be510f40c 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Pool < ApplicationRecord class RevertError < Exception; end diff --git a/app/models/pool_version.rb b/app/models/pool_version.rb index 1051be469..859dceb46 100644 --- a/app/models/pool_version.rb +++ b/app/models/pool_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PoolVersion < ApplicationRecord user_status_counter :pool_edit_count, foreign_key: :updater_id belongs_to :updater, :class_name => "User" diff --git a/app/models/post.rb b/app/models/post.rb index 1d7c69e03..68fce8d59 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Post < ApplicationRecord class RevertError < Exception ; end class DeletionError < Exception ; end diff --git a/app/models/post_approval.rb b/app/models/post_approval.rb index 1ef5466b8..b9f0241b5 100644 --- a/app/models/post_approval.rb +++ b/app/models/post_approval.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostApproval < ApplicationRecord belongs_to :user belongs_to :post, inverse_of: :approvals diff --git a/app/models/post_disapproval.rb b/app/models/post_disapproval.rb index c01813fc0..41e1b8e82 100644 --- a/app/models/post_disapproval.rb +++ b/app/models/post_disapproval.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostDisapproval < ApplicationRecord belongs_to :post belongs_to :user diff --git a/app/models/post_event.rb b/app/models/post_event.rb index 1527d436c..eb56679f4 100644 --- a/app/models/post_event.rb +++ b/app/models/post_event.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostEvent < ApplicationRecord belongs_to :creator, class_name: "User" enum action: { diff --git a/app/models/post_flag.rb b/app/models/post_flag.rb index b1ac9d148..8437e6f1f 100644 --- a/app/models/post_flag.rb +++ b/app/models/post_flag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostFlag < ApplicationRecord class Error < Exception; end diff --git a/app/models/post_replacement.rb b/app/models/post_replacement.rb index b854b0871..fef1a325d 100644 --- a/app/models/post_replacement.rb +++ b/app/models/post_replacement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostReplacement < ApplicationRecord self.table_name = 'post_replacements2' belongs_to :post diff --git a/app/models/post_report_reason.rb b/app/models/post_report_reason.rb index 0aaedbd80..7beb7ebaa 100644 --- a/app/models/post_report_reason.rb +++ b/app/models/post_report_reason.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostReportReason < ApplicationRecord belongs_to_creator validates :reason, uniqueness: { case_sensitive: false } diff --git a/app/models/post_set.rb b/app/models/post_set.rb index 292977268..67f10f4ec 100644 --- a/app/models/post_set.rb +++ b/app/models/post_set.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostSet < ApplicationRecord array_attribute :post_ids, parse: %r{(?:https://(?:e621|e926)\.net/posts/)?(\d+)}i, cast: :to_i diff --git a/app/models/post_set_maintainer.rb b/app/models/post_set_maintainer.rb index 5937856be..26a386d0d 100644 --- a/app/models/post_set_maintainer.rb +++ b/app/models/post_set_maintainer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostSetMaintainer < ApplicationRecord belongs_to :user belongs_to :post_set diff --git a/app/models/post_version.rb b/app/models/post_version.rb index 7433184e8..3581b4221 100644 --- a/app/models/post_version.rb +++ b/app/models/post_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostVersion < ApplicationRecord class UndoError < StandardError; end belongs_to :post diff --git a/app/models/post_vote.rb b/app/models/post_vote.rb index 4c00c207f..0b747c9df 100644 --- a/app/models/post_vote.rb +++ b/app/models/post_vote.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostVote < UserVote validate :validate_user_can_vote diff --git a/app/models/staff_audit_log.rb b/app/models/staff_audit_log.rb index 67d08d223..98eb2b731 100644 --- a/app/models/staff_audit_log.rb +++ b/app/models/staff_audit_log.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StaffAuditLog < ApplicationRecord belongs_to :user, class_name: "User" diff --git a/app/models/staff_note.rb b/app/models/staff_note.rb index b2e4a393e..2a37124d2 100644 --- a/app/models/staff_note.rb +++ b/app/models/staff_note.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StaffNote < ApplicationRecord belongs_to :creator, class_name: "User" belongs_to :user diff --git a/app/models/tag.rb b/app/models/tag.rb index 74e1848f2..e874c8805 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Tag < ApplicationRecord has_one :wiki_page, :foreign_key => "title", :primary_key => "name" has_one :artist, :foreign_key => "name", :primary_key => "name" diff --git a/app/models/tag_alias.rb b/app/models/tag_alias.rb index e59192113..9a09b6f42 100644 --- a/app/models/tag_alias.rb +++ b/app/models/tag_alias.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagAlias < TagRelationship has_many :tag_rel_undos, as: :tag_rel diff --git a/app/models/tag_implication.rb b/app/models/tag_implication.rb index 69c80e2c5..10381c252 100644 --- a/app/models/tag_implication.rb +++ b/app/models/tag_implication.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagImplication < TagRelationship has_many :tag_rel_undos, as: :tag_rel diff --git a/app/models/tag_rel_undo.rb b/app/models/tag_rel_undo.rb index 256200df9..0aa67f167 100644 --- a/app/models/tag_rel_undo.rb +++ b/app/models/tag_rel_undo.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRelUndo < ApplicationRecord belongs_to :tag_rel, polymorphic: true end diff --git a/app/models/tag_relationship.rb b/app/models/tag_relationship.rb index 10070010c..3efc7a84d 100644 --- a/app/models/tag_relationship.rb +++ b/app/models/tag_relationship.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRelationship < ApplicationRecord self.abstract_class = true diff --git a/app/models/tag_type_version.rb b/app/models/tag_type_version.rb index 6ebd77d62..e8a0dfce0 100644 --- a/app/models/tag_type_version.rb +++ b/app/models/tag_type_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagTypeVersion < ApplicationRecord belongs_to :tag belongs_to_creator diff --git a/app/models/takedown.rb b/app/models/takedown.rb index a2e541cb9..b74892321 100644 --- a/app/models/takedown.rb +++ b/app/models/takedown.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Takedown < ApplicationRecord belongs_to_creator optional: true belongs_to :approver, class_name: "User", optional: true diff --git a/app/models/ticket.rb b/app/models/ticket.rb index 70665f568..7e96b972a 100644 --- a/app/models/ticket.rb +++ b/app/models/ticket.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Ticket < ApplicationRecord belongs_to_creator user_status_counter :ticket_count diff --git a/app/models/upload.rb b/app/models/upload.rb index 8f9bdafeb..2f78653ff 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tmpdir" class Upload < ApplicationRecord diff --git a/app/models/upload_whitelist.rb b/app/models/upload_whitelist.rb index 12cf58283..39d4e9a89 100644 --- a/app/models/upload_whitelist.rb +++ b/app/models/upload_whitelist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadWhitelist < ApplicationRecord before_save :clean_pattern after_save :clear_cache diff --git a/app/models/user.rb b/app/models/user.rb index 0bd01ce1d..bbce50210 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class User < ApplicationRecord class Error < Exception ; end class PrivilegeError < Exception diff --git a/app/models/user_feedback.rb b/app/models/user_feedback.rb index 738adb30c..5b13b12cb 100644 --- a/app/models/user_feedback.rb +++ b/app/models/user_feedback.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserFeedback < ApplicationRecord self.table_name = "user_feedback" belongs_to :user diff --git a/app/models/user_name_change_request.rb b/app/models/user_name_change_request.rb index 339967116..ddd3015e1 100644 --- a/app/models/user_name_change_request.rb +++ b/app/models/user_name_change_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserNameChangeRequest < ApplicationRecord after_initialize :initialize_attributes, if: :new_record? validates :user_id, :original_name, :desired_name, presence: true diff --git a/app/models/user_password_reset_nonce.rb b/app/models/user_password_reset_nonce.rb index ff142e41d..cab1aa11a 100644 --- a/app/models/user_password_reset_nonce.rb +++ b/app/models/user_password_reset_nonce.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserPasswordResetNonce < ApplicationRecord has_secure_token :key after_create :deliver_notice diff --git a/app/models/user_status.rb b/app/models/user_status.rb index bbea49ebf..b0cb64cc2 100644 --- a/app/models/user_status.rb +++ b/app/models/user_status.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserStatus < ApplicationRecord belongs_to :user diff --git a/app/models/user_vote.rb b/app/models/user_vote.rb index eb5ecf2bb..e99609c9d 100644 --- a/app/models/user_vote.rb +++ b/app/models/user_vote.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserVote < ApplicationRecord class Error < Exception; end diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 30cdc12e9..f56017797 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class WikiPage < ApplicationRecord class RevertError < Exception ; end diff --git a/app/models/wiki_page_version.rb b/app/models/wiki_page_version.rb index f99ee473f..e0e42536e 100644 --- a/app/models/wiki_page_version.rb +++ b/app/models/wiki_page_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class WikiPageVersion < ApplicationRecord array_attribute :other_names belongs_to :wiki_page diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 7a4e726a4..0903130a5 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostPresenter < Presenter attr_reader :pool delegate :post_show_sidebar_tag_list_html, :split_tag_list_text, :inline_tag_list_html, to: :tag_set_presenter diff --git a/app/presenters/post_set_presenters/base.rb b/app/presenters/post_set_presenters/base.rb index 6b40ea6f5..84ded6934 100644 --- a/app/presenters/post_set_presenters/base.rb +++ b/app/presenters/post_set_presenters/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSetPresenters class Base def posts diff --git a/app/presenters/post_set_presenters/popular.rb b/app/presenters/post_set_presenters/popular.rb index a4314e91a..a3230339a 100644 --- a/app/presenters/post_set_presenters/popular.rb +++ b/app/presenters/post_set_presenters/popular.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSetPresenters class Popular < Base delegate :posts, :date, :min_date, :max_date, to: :post_set diff --git a/app/presenters/post_set_presenters/post.rb b/app/presenters/post_set_presenters/post.rb index 38664dfc6..420a8f3c9 100644 --- a/app/presenters/post_set_presenters/post.rb +++ b/app/presenters/post_set_presenters/post.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PostSetPresenters class Post < Base attr_accessor :post_set diff --git a/app/presenters/presenter.rb b/app/presenters/presenter.rb index bbf7c0512..a9e1ccdee 100644 --- a/app/presenters/presenter.rb +++ b/app/presenters/presenter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Presenter def self.h(s) CGI.escapeHTML(s.to_s) diff --git a/app/presenters/tag_set_presenter.rb b/app/presenters/tag_set_presenter.rb index 391df9653..edea12e3d 100644 --- a/app/presenters/tag_set_presenter.rb +++ b/app/presenters/tag_set_presenter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + =begin rdoc A tag set represents a set of tags that are displayed together. This class makes it easy to fetch the categories for all the diff --git a/app/presenters/upload_presenter.rb b/app/presenters/upload_presenter.rb index d132530eb..20b2601c2 100644 --- a/app/presenters/upload_presenter.rb +++ b/app/presenters/upload_presenter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UploadPresenter < Presenter attr_reader :upload delegate :inline_tag_list_html, to: :tag_set_presenter diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index 13a796b43..98404a54d 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserPresenter attr_reader :user diff --git a/app/serializers/post_event_serializer.rb b/app/serializers/post_event_serializer.rb index 7a33abfea..92752593a 100644 --- a/app/serializers/post_event_serializer.rb +++ b/app/serializers/post_event_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostEventSerializer < ActiveModel::Serializer def creator_id object.is_creator_visible?(CurrentUser.user) ? object.creator_id : nil diff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rb index 732817ee2..d8a13eade 100644 --- a/app/serializers/post_serializer.rb +++ b/app/serializers/post_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostSerializer < ActiveModel::Serializer def tags tags = {} diff --git a/config.ru b/config.ru index d80476879..f933a0440 100644 --- a/config.ru +++ b/config.ru @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is used by Rack-based servers to start the application. if defined?(Unicorn) && ENV["RAILS_ENV"] == "production" diff --git a/config/application.rb b/config/application.rb index c34563058..a37502c14 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "boot" require "rails" diff --git a/config/boot.rb b/config/boot.rb index 988a5ddc4..aef6d031e 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile. diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 21e3e303e..62654c09e 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -1,4 +1,4 @@ -require 'socket' +# frozen_string_literal: true module Danbooru class Configuration diff --git a/config/environment.rb b/config/environment.rb index efd84d945..acc439c2e 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Load the Rails application. require_relative "application" diff --git a/config/environments/development.rb b/config/environments/development.rb index 61e8ba6e0..4e365cbe7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/integer/time" Rails.application.configure do diff --git a/config/environments/production.rb b/config/environments/production.rb index 1b9784e99..979f04260 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/integer/time" Rails.application.configure do diff --git a/config/environments/test.rb b/config/environments/test.rb index dccaa6a5c..f1f3c8936 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/integer/time" # The test environment is used exclusively to run your application's diff --git a/config/initializers/cache_store.rb b/config/initializers/cache_store.rb index 1ffc73359..f13c09b39 100644 --- a/config/initializers/cache_store.rb +++ b/config/initializers/cache_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + def get_cache_store if Rails.env.test? [:memory_store, { size: 32.megabytes }] diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 3634ffad4..709c58c34 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide content security policy. diff --git a/config/initializers/core_extensions.rb b/config/initializers/core_extensions.rb index 399c5529d..ea39fd18c 100644 --- a/config/initializers/core_extensions.rb +++ b/config/initializers/core_extensions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru module Extensions module String diff --git a/config/initializers/cors.rb b/config/initializers/cors.rb index 0c5dd99ac..7af62e593 100644 --- a/config/initializers/cors.rb +++ b/config/initializers/cors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Avoid CORS issues when API is called from the frontend app. diff --git a/config/initializers/diffy.rb b/config/initializers/diffy.rb index b9c589d96..86aa9f826 100644 --- a/config/initializers/diffy.rb +++ b/config/initializers/diffy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.configuration.to_prepare do Diffy::Diff.prepend DiffyNoSubprocess end diff --git a/config/initializers/ffmpeg.rb b/config/initializers/ffmpeg.rb index 387508f8c..c58020e57 100644 --- a/config/initializers/ffmpeg.rb +++ b/config/initializers/ffmpeg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + unless Rails.env.development? FFMPEG.logger.level = Logger::ERROR end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 96fa20015..f11e977cc 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. diff --git a/config/initializers/git_helper.rb b/config/initializers/git_helper.rb index 97429dd32..70e6f08ce 100644 --- a/config/initializers/git_helper.rb +++ b/config/initializers/git_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.configuration.to_prepare do GitHelper.init end diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 3860f659e..9e049dcc9 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/mailgun.rb b/config/initializers/mailgun.rb index aa5d120e0..9f07bd9eb 100644 --- a/config/initializers/mailgun.rb +++ b/config/initializers/mailgun.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Mailgun.configure do |config| config.api_key = Danbooru.config.mailgun_api_key end diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb index 7db3b9577..e8d0b2ae8 100644 --- a/config/initializers/permissions_policy.rb +++ b/config/initializers/permissions_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide HTTP permissions policy. For further diff --git a/config/initializers/recaptcha.rb b/config/initializers/recaptcha.rb index af169cd35..7949bd232 100644 --- a/config/initializers/recaptcha.rb +++ b/config/initializers/recaptcha.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Recaptcha.configure do |config| config.site_key = Danbooru.config.recaptcha_site_key config.secret_key = Danbooru.config.recaptcha_secret_key diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 4074a67bb..04b42e0c3 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require File.expand_path('../../state_checker', __FILE__) StateChecker.instance.check! diff --git a/config/initializers/serialization_method.rb b/config/initializers/serialization_method.rb index aba3586bf..84e882e47 100644 --- a/config/initializers/serialization_method.rb +++ b/config/initializers/serialization_method.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + ActiveModelSerializers.config.adapter = :json diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index f0fc36be6..b13bc48b5 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_danbooru_session', same_site: :lax, secure: Rails.env.production? diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index b1f1d9d75..c278a8c38 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "sidekiq-unique-jobs" Sidekiq.configure_server do |config| diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 121ab1772..30ce30dbb 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| # Wrappers are used by the form builder to generate a diff --git a/config/puma.rb b/config/puma.rb index 1e19380dc..55bd3da2a 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Puma can serve each request in a thread from an internal thread pool. # The `threads` method setting takes two numbers: a minimum and maximum. # Any libraries that use thread pools should be configured to match diff --git a/config/routes.rb b/config/routes.rb index 80c6af0e5..2da5b48a0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + id_name_constraint = { id: %r{[^/]+?}, format: /json|html/ }.freeze Rails.application.routes.draw do diff --git a/config/state_checker.rb b/config/state_checker.rb index bdfe8e251..6e6f7668f 100644 --- a/config/state_checker.rb +++ b/config/state_checker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StateChecker include Singleton diff --git a/config/unicorn/development.rb b/config/unicorn/development.rb index 6a0115978..9e54b88f6 100644 --- a/config/unicorn/development.rb +++ b/config/unicorn/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Set your full path to application. app_path = "/app" diff --git a/config/unicorn/production.rb b/config/unicorn/production.rb index 036189021..56800a5d5 100644 --- a/config/unicorn/production.rb +++ b/config/unicorn/production.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "dotenv" # Set your full path to application. diff --git a/db/fixes/100_new_iqdb_import.rb b/db/fixes/100_new_iqdb_import.rb index 29dd059a7..24b6d7249 100755 --- a/db/fixes/100_new_iqdb_import.rb +++ b/db/fixes/100_new_iqdb_import.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/101_migrate_mod_actions.rb b/db/fixes/101_migrate_mod_actions.rb index ab9a48e9a..a5611053d 100755 --- a/db/fixes/101_migrate_mod_actions.rb +++ b/db/fixes/101_migrate_mod_actions.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/102_generate_missing_post_version_fields.rb b/db/fixes/102_generate_missing_post_version_fields.rb index 0467c8cd3..f0c701f4e 100755 --- a/db/fixes/102_generate_missing_post_version_fields.rb +++ b/db/fixes/102_generate_missing_post_version_fields.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/103_fill_new_post_replacement_fields.rb b/db/fixes/103_fill_new_post_replacement_fields.rb index 143c3ac2e..50f3d71e8 100755 --- a/db/fixes/103_fill_new_post_replacement_fields.rb +++ b/db/fixes/103_fill_new_post_replacement_fields.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/104_1_add_elasticsearch_replacement_index.rb b/db/fixes/104_1_add_elasticsearch_replacement_index.rb index 38eadd9ce..e3a5e7188 100755 --- a/db/fixes/104_1_add_elasticsearch_replacement_index.rb +++ b/db/fixes/104_1_add_elasticsearch_replacement_index.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/104_2_add_elasticsearch_replacement_data.rb b/db/fixes/104_2_add_elasticsearch_replacement_data.rb index b0afe608a..81f65dcee 100755 --- a/db/fixes/104_2_add_elasticsearch_replacement_data.rb +++ b/db/fixes/104_2_add_elasticsearch_replacement_data.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/105_modaction_to_postevents.rb b/db/fixes/105_modaction_to_postevents.rb index c2a8cde7a..75bb5cd0e 100755 --- a/db/fixes/105_modaction_to_postevents.rb +++ b/db/fixes/105_modaction_to_postevents.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/106_note_ranges.rb b/db/fixes/106_note_ranges.rb index 0a480f34f..8706a4409 100755 --- a/db/fixes/106_note_ranges.rb +++ b/db/fixes/106_note_ranges.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/107_remove_name_change_tickets.rb b/db/fixes/107_remove_name_change_tickets.rb index 6dcf0ebb3..4ef5ab182 100755 --- a/db/fixes/107_remove_name_change_tickets.rb +++ b/db/fixes/107_remove_name_change_tickets.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment')) diff --git a/db/fixes/108_ticket_accuser_id.rb b/db/fixes/108_ticket_accuser_id.rb index 2e3cd763a..bb5288837 100755 --- a/db/fixes/108_ticket_accuser_id.rb +++ b/db/fixes/108_ticket_accuser_id.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "config", "environment")) diff --git a/db/fixes/109_user_status_ticket_count.rb b/db/fixes/109_user_status_ticket_count.rb index e991f07a9..5de28a8b1 100755 --- a/db/fixes/109_user_status_ticket_count.rb +++ b/db/fixes/109_user_status_ticket_count.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "config", "environment")) diff --git a/db/fixes/111_missing_warning_user_id.rb b/db/fixes/111_missing_warning_user_id.rb index b046b9962..61872ad69 100755 --- a/db/fixes/111_missing_warning_user_id.rb +++ b/db/fixes/111_missing_warning_user_id.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "config", "environment")) diff --git a/db/migrate/20220106081415_add_post_events_table.rb b/db/migrate/20220106081415_add_post_events_table.rb index a66d19ec4..7b69438ec 100644 --- a/db/migrate/20220106081415_add_post_events_table.rb +++ b/db/migrate/20220106081415_add_post_events_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddPostEventsTable < ActiveRecord::Migration[6.1] def change create_table :post_events do |t| diff --git a/db/migrate/20220203154846_remove_artist_commentaries.rb b/db/migrate/20220203154846_remove_artist_commentaries.rb index 2369f9cba..9598f5a6d 100644 --- a/db/migrate/20220203154846_remove_artist_commentaries.rb +++ b/db/migrate/20220203154846_remove_artist_commentaries.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveArtistCommentaries < ActiveRecord::Migration[6.1] def change remove_column :uploads, :artist_commentary_title diff --git a/db/migrate/20220219202441_set_user_text_defaults.rb b/db/migrate/20220219202441_set_user_text_defaults.rb index a5d6fe8b8..fe4a1a9df 100644 --- a/db/migrate/20220219202441_set_user_text_defaults.rb +++ b/db/migrate/20220219202441_set_user_text_defaults.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SetUserTextDefaults < ActiveRecord::Migration[6.1] def up change_column :users, :profile_about, :text, default: "" diff --git a/db/migrate/20220316162257_remove_dead_tables_and_columns.rb b/db/migrate/20220316162257_remove_dead_tables_and_columns.rb index b699004d6..0e3698164 100644 --- a/db/migrate/20220316162257_remove_dead_tables_and_columns.rb +++ b/db/migrate/20220316162257_remove_dead_tables_and_columns.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveDeadTablesAndColumns < ActiveRecord::Migration[6.1] def up User.without_timeout do diff --git a/db/migrate/20220516103329_post_comment_locked.rb b/db/migrate/20220516103329_post_comment_locked.rb index 8d9e8f72e..829d98eb6 100644 --- a/db/migrate/20220516103329_post_comment_locked.rb +++ b/db/migrate/20220516103329_post_comment_locked.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PostCommentLocked < ActiveRecord::Migration[6.1] def change Post.without_timeout do diff --git a/db/migrate/20220710133556_remove_pool_is_deleted.rb b/db/migrate/20220710133556_remove_pool_is_deleted.rb index 12d2ba395..0d846c966 100644 --- a/db/migrate/20220710133556_remove_pool_is_deleted.rb +++ b/db/migrate/20220710133556_remove_pool_is_deleted.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemovePoolIsDeleted < ActiveRecord::Migration[6.1] def up remove_column :pools, :is_deleted diff --git a/db/migrate/20220810131625_remove_dev_prod_differences.rb b/db/migrate/20220810131625_remove_dev_prod_differences.rb index 282a8cd53..ddddf5437 100644 --- a/db/migrate/20220810131625_remove_dev_prod_differences.rb +++ b/db/migrate/20220810131625_remove_dev_prod_differences.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveDevProdDifferences < ActiveRecord::Migration[6.1] def change execute "DROP FUNCTION IF EXISTS sourcepattern"; diff --git a/db/migrate/20221014085948_add_mascot_table.rb b/db/migrate/20221014085948_add_mascot_table.rb index d92b90571..51afbbc53 100644 --- a/db/migrate/20221014085948_add_mascot_table.rb +++ b/db/migrate/20221014085948_add_mascot_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddMascotTable < ActiveRecord::Migration[6.1] def change create_table :mascots do |t| diff --git a/db/migrate/20230203162010_mascots_add_available_on.rb b/db/migrate/20230203162010_mascots_add_available_on.rb index 9fed46c97..980ef6842 100644 --- a/db/migrate/20230203162010_mascots_add_available_on.rb +++ b/db/migrate/20230203162010_mascots_add_available_on.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MascotsAddAvailableOn < ActiveRecord::Migration[7.0] def change add_column :mascots, :available_on, :string, array: true, null: false, default: [] diff --git a/db/migrate/20230204141325_dev_prod_cleanup.rb b/db/migrate/20230204141325_dev_prod_cleanup.rb index 0567b7cc2..9349e0415 100644 --- a/db/migrate/20230204141325_dev_prod_cleanup.rb +++ b/db/migrate/20230204141325_dev_prod_cleanup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DevProdCleanup < ActiveRecord::Migration[7.0] def up execute("DROP TYPE IF EXISTS post_status") diff --git a/db/migrate/20230210092829_drop_email_unique.rb b/db/migrate/20230210092829_drop_email_unique.rb index 71781de81..87c273840 100644 --- a/db/migrate/20230210092829_drop_email_unique.rb +++ b/db/migrate/20230210092829_drop_email_unique.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DropEmailUnique < ActiveRecord::Migration[7.0] def up remove_index :users, name: :index_users_on_email diff --git a/db/migrate/20230219115601_add_text_indices.rb b/db/migrate/20230219115601_add_text_indices.rb index 2938e9371..fb354834f 100644 --- a/db/migrate/20230219115601_add_text_indices.rb +++ b/db/migrate/20230219115601_add_text_indices.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTextIndices < ActiveRecord::Migration[7.0] disable_ddl_transaction! diff --git a/db/migrate/20230221145226_remove_mascots_safe_mode_only.rb b/db/migrate/20230221145226_remove_mascots_safe_mode_only.rb index f3c2b8a33..eb89ab514 100644 --- a/db/migrate/20230221145226_remove_mascots_safe_mode_only.rb +++ b/db/migrate/20230221145226_remove_mascots_safe_mode_only.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveMascotsSafeModeOnly < ActiveRecord::Migration[7.0] def change remove_column :mascots, :safe_mode_only, type: :boolean, default: false, null: false diff --git a/db/migrate/20230221153458_remove_unused_text_index_columns.rb b/db/migrate/20230221153458_remove_unused_text_index_columns.rb index 359a7a624..f2d89a04e 100644 --- a/db/migrate/20230221153458_remove_unused_text_index_columns.rb +++ b/db/migrate/20230221153458_remove_unused_text_index_columns.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveUnusedTextIndexColumns < ActiveRecord::Migration[7.0] def up drop_trigger_and_column(:blips, :body) diff --git a/db/migrate/20230226152600_remove_testparser.rb b/db/migrate/20230226152600_remove_testparser.rb index c8306dde8..a8951bad1 100644 --- a/db/migrate/20230226152600_remove_testparser.rb +++ b/db/migrate/20230226152600_remove_testparser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveTestparser < ActiveRecord::Migration[7.0] def up execute "DROP TRIGGER trigger_posts_on_tag_index_update ON posts" diff --git a/db/migrate/20230312103728_timestamps_non_nullable.rb b/db/migrate/20230312103728_timestamps_non_nullable.rb index 5051c72f8..337171f99 100644 --- a/db/migrate/20230312103728_timestamps_non_nullable.rb +++ b/db/migrate/20230312103728_timestamps_non_nullable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TimestampsNonNullable < ActiveRecord::Migration[7.0] def change ApplicationRecord.without_timeout do diff --git a/db/migrate/20230314170352_user_feedback_body.rb b/db/migrate/20230314170352_user_feedback_body.rb index 9ea640828..4c75f4ee3 100644 --- a/db/migrate/20230314170352_user_feedback_body.rb +++ b/db/migrate/20230314170352_user_feedback_body.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserFeedbackBody < ActiveRecord::Migration[7.0] def change add_index :user_feedback, "to_tsvector('english', body)", using: :gin diff --git a/db/migrate/20230316084945_help_pages_add_default_values.rb b/db/migrate/20230316084945_help_pages_add_default_values.rb index 67a7b833d..075b50e92 100644 --- a/db/migrate/20230316084945_help_pages_add_default_values.rb +++ b/db/migrate/20230316084945_help_pages_add_default_values.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HelpPagesAddDefaultValues < ActiveRecord::Migration[7.0] def change change_column_null :help_pages, :related, false diff --git a/db/migrate/20230506161827_add_ticket_user_id.rb b/db/migrate/20230506161827_add_ticket_user_id.rb index bc8d357c8..033c2ab20 100644 --- a/db/migrate/20230506161827_add_ticket_user_id.rb +++ b/db/migrate/20230506161827_add_ticket_user_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTicketUserId < ActiveRecord::Migration[7.0] def change add_column :tickets, :accused_id, :integer diff --git a/db/migrate/20230513074838_add_user_statuses_ticket_count.rb b/db/migrate/20230513074838_add_user_statuses_ticket_count.rb index 91341dd97..3dd8a9186 100644 --- a/db/migrate/20230513074838_add_user_statuses_ticket_count.rb +++ b/db/migrate/20230513074838_add_user_statuses_ticket_count.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUserStatusesTicketCount < ActiveRecord::Migration[7.0] def change add_column :user_statuses, :ticket_count, :integer, default: 0, null: false diff --git a/db/migrate/20230517155547_add_text_wildcard_search_index.rb b/db/migrate/20230517155547_add_text_wildcard_search_index.rb index 9c5d100a4..4e2b32fb0 100644 --- a/db/migrate/20230517155547_add_text_wildcard_search_index.rb +++ b/db/migrate/20230517155547_add_text_wildcard_search_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTextWildcardSearchIndex < ActiveRecord::Migration[7.0] def up add_gin_index :blips, :body diff --git a/db/migrate/20230518182034_add_user_about_indicies.rb b/db/migrate/20230518182034_add_user_about_indicies.rb index 1b65cdfdd..cf69f7ad3 100644 --- a/db/migrate/20230518182034_add_user_about_indicies.rb +++ b/db/migrate/20230518182034_add_user_about_indicies.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUserAboutIndicies < ActiveRecord::Migration[7.0] def up add_index :users, "(to_tsvector('english', profile_about))", using: :gin diff --git a/db/migrate/20230531080817_add_blips_updater_id.rb b/db/migrate/20230531080817_add_blips_updater_id.rb index ff9457c03..0083a7caf 100644 --- a/db/migrate/20230531080817_add_blips_updater_id.rb +++ b/db/migrate/20230531080817_add_blips_updater_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddBlipsUpdaterId < ActiveRecord::Migration[7.0] def change add_column :blips, :updater_id, :integer diff --git a/db/migrate/20240101042716_user_feedback_add_updater_id.rb b/db/migrate/20240101042716_user_feedback_add_updater_id.rb index 676adff91..00aac2c5b 100644 --- a/db/migrate/20240101042716_user_feedback_add_updater_id.rb +++ b/db/migrate/20240101042716_user_feedback_add_updater_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserFeedbackAddUpdaterId < ActiveRecord::Migration[7.0] def change add_column :user_feedback, :updater_id, :integer diff --git a/docker/danbooru_local_config.rb b/docker/danbooru_local_config.rb index 64bc3dced..22664ab33 100644 --- a/docker/danbooru_local_config.rb +++ b/docker/danbooru_local_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Danbooru class CustomConfiguration < Configuration # Define your custom overloads here diff --git a/lib/tasks/maintenance.rake b/lib/tasks/maintenance.rake index 668759007..f572f3df2 100644 --- a/lib/tasks/maintenance.rake +++ b/lib/tasks/maintenance.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/newrelic" if defined?(NewRelic) namespace :maintenance do diff --git a/test/controllers/forum_post_votes_controller_test.rb b/test/controllers/forum_post_votes_controller_test.rb index 5d822f72f..211d7b586 100644 --- a/test/controllers/forum_post_votes_controller_test.rb +++ b/test/controllers/forum_post_votes_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ForumPostVotesControllerTest < ActionDispatch::IntegrationTest context "The forum post votes controller" do diff --git a/test/factories/artist.rb b/test/factories/artist.rb index ff303a529..b15e9b229 100644 --- a/test/factories/artist.rb +++ b/test/factories/artist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:artist) do sequence(:name) { |n| "artist_#{n}" } diff --git a/test/factories/artist_url.rb b/test/factories/artist_url.rb index c8158af0b..d46856363 100644 --- a/test/factories/artist_url.rb +++ b/test/factories/artist_url.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:artist_url) do artist diff --git a/test/factories/ban.rb b/test/factories/ban.rb index 26aa73f23..ed1d6f5e8 100644 --- a/test/factories/ban.rb +++ b/test/factories/ban.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:ban) do |f| banner factory: :admin_user diff --git a/test/factories/blip.rb b/test/factories/blip.rb index 504caa01f..c433a1e8c 100644 --- a/test/factories/blip.rb +++ b/test/factories/blip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:blip) do creator_ip_addr { "127.0.0.1" } diff --git a/test/factories/bulk_update_request.rb b/test/factories/bulk_update_request.rb index 838d9e786..4fc6090da 100644 --- a/test/factories/bulk_update_request.rb +++ b/test/factories/bulk_update_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:bulk_update_request) do |f| title { "xxx" } diff --git a/test/factories/comment.rb b/test/factories/comment.rb index 2c71cd227..8e395f35c 100644 --- a/test/factories/comment.rb +++ b/test/factories/comment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:comment) do post { create(:post) } diff --git a/test/factories/comment_vote.rb b/test/factories/comment_vote.rb index 532fdeafd..2cc11a724 100644 --- a/test/factories/comment_vote.rb +++ b/test/factories/comment_vote.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:comment_vote) do score { 1 } diff --git a/test/factories/dmail.rb b/test/factories/dmail.rb index 351fdd3e6..a3e7cbfd7 100644 --- a/test/factories/dmail.rb +++ b/test/factories/dmail.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:dmail) do to factory: :user diff --git a/test/factories/favorite.rb b/test/factories/favorite.rb index 192e8f8ff..3d0abbe4d 100644 --- a/test/factories/favorite.rb +++ b/test/factories/favorite.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:favorite) end diff --git a/test/factories/forum_post.rb b/test/factories/forum_post.rb index 0cc6f9d30..f07222801 100644 --- a/test/factories/forum_post.rb +++ b/test/factories/forum_post.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:forum_post) do sequence(:body) { |n| "forum_post_body_#{n}" } diff --git a/test/factories/forum_post_vote.rb b/test/factories/forum_post_vote.rb index c745c73fd..22a3ec97e 100644 --- a/test/factories/forum_post_vote.rb +++ b/test/factories/forum_post_vote.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:forum_post_vote) end diff --git a/test/factories/forum_subscription.rb b/test/factories/forum_subscription.rb index cb6713b0b..fcf07d705 100644 --- a/test/factories/forum_subscription.rb +++ b/test/factories/forum_subscription.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:forum_subscription) do end diff --git a/test/factories/forum_topic.rb b/test/factories/forum_topic.rb index ada2489b0..b7fe2184f 100644 --- a/test/factories/forum_topic.rb +++ b/test/factories/forum_topic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:forum_topic) do sequence(:title) { |n| "forum_topic_title_#{n}" } diff --git a/test/factories/forum_topic_visit.rb b/test/factories/forum_topic_visit.rb index ed07fda71..35d4c3c44 100644 --- a/test/factories/forum_topic_visit.rb +++ b/test/factories/forum_topic_visit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:forum_topic_visit) do end diff --git a/test/factories/ip_ban.rb b/test/factories/ip_ban.rb index 1d070820c..ef72d703c 100644 --- a/test/factories/ip_ban.rb +++ b/test/factories/ip_ban.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:ip_ban) do creator diff --git a/test/factories/mod_action.rb b/test/factories/mod_action.rb index 482d8abba..8480a9dbf 100644 --- a/test/factories/mod_action.rb +++ b/test/factories/mod_action.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:mod_action) do creator :factory => :user diff --git a/test/factories/news_update.rb b/test/factories/news_update.rb index 15d3ad26d..f6fc35550 100644 --- a/test/factories/news_update.rb +++ b/test/factories/news_update.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:news_update) do message { "xxx" } diff --git a/test/factories/note.rb b/test/factories/note.rb index 900fbdbfe..702e843d2 100644 --- a/test/factories/note.rb +++ b/test/factories/note.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:note) do post { create(:post) } diff --git a/test/factories/pool.rb b/test/factories/pool.rb index bc965004d..049e330cd 100644 --- a/test/factories/pool.rb +++ b/test/factories/pool.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:pool) do sequence(:name) { |n| "pool_#{n}" } diff --git a/test/factories/post.rb b/test/factories/post.rb index 8009f4db5..d14ec0f62 100644 --- a/test/factories/post.rb +++ b/test/factories/post.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:post) do sequence :md5 do |n| diff --git a/test/factories/post_approval.rb b/test/factories/post_approval.rb index 6f3eaf824..5f28a62b4 100644 --- a/test/factories/post_approval.rb +++ b/test/factories/post_approval.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:post_approval) do user factory: :moderator_user diff --git a/test/factories/post_disapproval.rb b/test/factories/post_disapproval.rb index 2a1f346c1..3f744ec36 100644 --- a/test/factories/post_disapproval.rb +++ b/test/factories/post_disapproval.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:post_disapproval) do reason { %w[borderline_quality borderline_relevancy other].sample } diff --git a/test/factories/post_flag.rb b/test/factories/post_flag.rb index ad912f12d..2ba2e5170 100644 --- a/test/factories/post_flag.rb +++ b/test/factories/post_flag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:post_flag) do post diff --git a/test/factories/post_replacement.rb b/test/factories/post_replacement.rb index 700b0afea..21cd4e27d 100644 --- a/test/factories/post_replacement.rb +++ b/test/factories/post_replacement.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:post_replacement) do creator_ip_addr { "127.0.0.1" } diff --git a/test/factories/post_report_reason.rb b/test/factories/post_report_reason.rb index 8c8371487..a26f35a52 100644 --- a/test/factories/post_report_reason.rb +++ b/test/factories/post_report_reason.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:post_report_reason) do reason { nil } diff --git a/test/factories/post_set.rb b/test/factories/post_set.rb index e3083e467..fa3df1c33 100644 --- a/test/factories/post_set.rb +++ b/test/factories/post_set.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:post_set) do creator diff --git a/test/factories/tag.rb b/test/factories/tag.rb index aa5dd4c25..a9c063ebe 100644 --- a/test/factories/tag.rb +++ b/test/factories/tag.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:tag) do sequence(:name) { |n| "tag_name_#{n}" } diff --git a/test/factories/tag_alias.rb b/test/factories/tag_alias.rb index 18e169e22..dfc000b43 100644 --- a/test/factories/tag_alias.rb +++ b/test/factories/tag_alias.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory :tag_alias do antecedent_name { "aaa" } diff --git a/test/factories/tag_implication.rb b/test/factories/tag_implication.rb index 3b0148f4d..fc85e30d2 100644 --- a/test/factories/tag_implication.rb +++ b/test/factories/tag_implication.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory :tag_implication do antecedent_name { "aaa" } diff --git a/test/factories/ticket.rb b/test/factories/ticket.rb index 235ab851b..b4e1730d7 100644 --- a/test/factories/ticket.rb +++ b/test/factories/ticket.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:ticket) do initialize_with { new(qtype: qtype) } diff --git a/test/factories/upload.rb b/test/factories/upload.rb index 6b33eeeb8..6a38cd427 100644 --- a/test/factories/upload.rb +++ b/test/factories/upload.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'fileutils' FactoryBot.define do diff --git a/test/factories/upload_whitelist.rb b/test/factories/upload_whitelist.rb index e25e3c293..c1d375c0d 100644 --- a/test/factories/upload_whitelist.rb +++ b/test/factories/upload_whitelist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:upload_whitelist) do end diff --git a/test/factories/user.rb b/test/factories/user.rb index 9691a6a9d..594502525 100644 --- a/test/factories/user.rb +++ b/test/factories/user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:user, aliases: [:creator, :updater]) do sequence :name do |n| diff --git a/test/factories/user_feedback.rb b/test/factories/user_feedback.rb index 304129214..6ac4e734b 100644 --- a/test/factories/user_feedback.rb +++ b/test/factories/user_feedback.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:user_feedback) do user diff --git a/test/factories/user_name_change_request.rb b/test/factories/user_name_change_request.rb index 195b72098..63d9e0b35 100644 --- a/test/factories/user_name_change_request.rb +++ b/test/factories/user_name_change_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:user_name_change_request) do sequence(:desired_name) { |n| "desired_name_#{n}" } diff --git a/test/factories/user_password_reset_nonce.rb b/test/factories/user_password_reset_nonce.rb index 03d1edc6a..61184409e 100644 --- a/test/factories/user_password_reset_nonce.rb +++ b/test/factories/user_password_reset_nonce.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:user_password_reset_nonce) end diff --git a/test/factories/wiki_page.rb b/test/factories/wiki_page.rb index 8e71e424d..f919b0061 100644 --- a/test/factories/wiki_page.rb +++ b/test/factories/wiki_page.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + FactoryBot.define do factory(:wiki_page) do creator factory: :user diff --git a/test/functional/admin/danger_zone_controller_test.rb b/test/functional/admin/danger_zone_controller_test.rb index b0fc4b197..d2f38623e 100644 --- a/test/functional/admin/danger_zone_controller_test.rb +++ b/test/functional/admin/danger_zone_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class Admin::DangerZoneControllerTest < ActionDispatch::IntegrationTest context "The danger zone controller" do diff --git a/test/functional/admin/dashboards_controller_test.rb b/test/functional/admin/dashboards_controller_test.rb index dae369dff..8a90c658e 100644 --- a/test/functional/admin/dashboards_controller_test.rb +++ b/test/functional/admin/dashboards_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class Admin::DashboardsControllerTest < ActionDispatch::IntegrationTest context "The admin dashboard controller" do diff --git a/test/functional/admin/users_controller_test.rb b/test/functional/admin/users_controller_test.rb index 488f91ea9..4a48c5339 100644 --- a/test/functional/admin/users_controller_test.rb +++ b/test/functional/admin/users_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class Admin::UsersControllerTest < ActionDispatch::IntegrationTest context "Admin::UsersController" do diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index be94b0609..62b3942e8 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ApplicationControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/artist_urls_controller_test.rb b/test/functional/artist_urls_controller_test.rb index e758e927f..d2f320fdf 100644 --- a/test/functional/artist_urls_controller_test.rb +++ b/test/functional/artist_urls_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ArtistUrlsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/artist_versions_controller_test.rb b/test/functional/artist_versions_controller_test.rb index 27a351e01..75ed2317d 100644 --- a/test/functional/artist_versions_controller_test.rb +++ b/test/functional/artist_versions_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ArtistVersionsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/artists_controller_test.rb b/test/functional/artists_controller_test.rb index b08fa5566..4a284f27e 100644 --- a/test/functional/artists_controller_test.rb +++ b/test/functional/artists_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ArtistsControllerTest < ActionDispatch::IntegrationTest context "An artists controller" do diff --git a/test/functional/bans_controller_test.rb b/test/functional/bans_controller_test.rb index 0cae61dbe..37ed6bfdb 100644 --- a/test/functional/bans_controller_test.rb +++ b/test/functional/bans_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class BansControllerTest < ActionDispatch::IntegrationTest context "A bans controller" do diff --git a/test/functional/bulk_update_requests_controller_test.rb b/test/functional/bulk_update_requests_controller_test.rb index c621dcf9f..2cf8b4b3d 100644 --- a/test/functional/bulk_update_requests_controller_test.rb +++ b/test/functional/bulk_update_requests_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class BulkUpdateRequestsControllerTest < ActionDispatch::IntegrationTest context "BulkUpdateRequestsController" do diff --git a/test/functional/comment_votes_controller_test.rb b/test/functional/comment_votes_controller_test.rb index e63a8a5e8..e799d07b1 100644 --- a/test/functional/comment_votes_controller_test.rb +++ b/test/functional/comment_votes_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class CommentVotesControllerTest < ActionDispatch::IntegrationTest context "A comment votes controller" do diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb index b0de0fe43..96df1b6c3 100644 --- a/test/functional/comments_controller_test.rb +++ b/test/functional/comments_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class CommentsControllerTest < ActionDispatch::IntegrationTest context "A comments controller" do diff --git a/test/functional/dmails_controller_test.rb b/test/functional/dmails_controller_test.rb index 5d0b936a9..3b3859a94 100644 --- a/test/functional/dmails_controller_test.rb +++ b/test/functional/dmails_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class DmailsControllerTest < ActionDispatch::IntegrationTest context "The dmails controller" do diff --git a/test/functional/dtext_previews_controller_test.rb b/test/functional/dtext_previews_controller_test.rb index 2d0e8726d..77d119227 100644 --- a/test/functional/dtext_previews_controller_test.rb +++ b/test/functional/dtext_previews_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class DtextPreviewsControllerTest < ActionDispatch::IntegrationTest context "The dtext previews controller" do diff --git a/test/functional/favorites_controller_test.rb b/test/functional/favorites_controller_test.rb index 0ed98fc26..ef9769a40 100644 --- a/test/functional/favorites_controller_test.rb +++ b/test/functional/favorites_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class FavoritesControllerTest < ActionDispatch::IntegrationTest context "The favorites controller" do diff --git a/test/functional/forum_posts_controller_test.rb b/test/functional/forum_posts_controller_test.rb index fc9550975..dd1aa425a 100644 --- a/test/functional/forum_posts_controller_test.rb +++ b/test/functional/forum_posts_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ForumPostsControllerTest < ActionDispatch::IntegrationTest context "The forum posts controller" do diff --git a/test/functional/forum_topics_controller_test.rb b/test/functional/forum_topics_controller_test.rb index 32b24825e..f6e6e53b9 100644 --- a/test/functional/forum_topics_controller_test.rb +++ b/test/functional/forum_topics_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ForumTopicsControllerTest < ActionDispatch::IntegrationTest context "The forum topics controller" do diff --git a/test/functional/help_controller_test.rb b/test/functional/help_controller_test.rb index 34b7e6277..3676975a1 100644 --- a/test/functional/help_controller_test.rb +++ b/test/functional/help_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class HelpControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/ip_bans_controller_test.rb b/test/functional/ip_bans_controller_test.rb index 2862eb36e..f5214dfdc 100644 --- a/test/functional/ip_bans_controller_test.rb +++ b/test/functional/ip_bans_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class IpBansControllerTest < ActionDispatch::IntegrationTest context "The ip bans controller" do diff --git a/test/functional/iqdb_queries_controller_test.rb b/test/functional/iqdb_queries_controller_test.rb index 264ccc0e3..1aeadc656 100644 --- a/test/functional/iqdb_queries_controller_test.rb +++ b/test/functional/iqdb_queries_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class IqdbQueriesControllerTest < ActionDispatch::IntegrationTest context "The iqdb controller" do diff --git a/test/functional/maintenance/user/api_keys_controller_test.rb b/test/functional/maintenance/user/api_keys_controller_test.rb index 57d802d33..61d1bdf0d 100644 --- a/test/functional/maintenance/user/api_keys_controller_test.rb +++ b/test/functional/maintenance/user/api_keys_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" module Maintenance module User diff --git a/test/functional/maintenance/user/deletions_controller_test.rb b/test/functional/maintenance/user/deletions_controller_test.rb index dc207486f..d9632f46f 100644 --- a/test/functional/maintenance/user/deletions_controller_test.rb +++ b/test/functional/maintenance/user/deletions_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Maintenance diff --git a/test/functional/maintenance/user/dmail_filters_controller_test.rb b/test/functional/maintenance/user/dmail_filters_controller_test.rb index 2ca6c8b56..4104cbc01 100644 --- a/test/functional/maintenance/user/dmail_filters_controller_test.rb +++ b/test/functional/maintenance/user/dmail_filters_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Maintenance diff --git a/test/functional/maintenance/user/email_changes_controller_test.rb b/test/functional/maintenance/user/email_changes_controller_test.rb index 2a2cbbd0b..be5a1ff3b 100644 --- a/test/functional/maintenance/user/email_changes_controller_test.rb +++ b/test/functional/maintenance/user/email_changes_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Maintenance diff --git a/test/functional/maintenance/user/login_reminders_controller_test.rb b/test/functional/maintenance/user/login_reminders_controller_test.rb index d9a30e780..5027aa125 100644 --- a/test/functional/maintenance/user/login_reminders_controller_test.rb +++ b/test/functional/maintenance/user/login_reminders_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Maintenance diff --git a/test/functional/maintenance/user/password_resets_controller_test.rb b/test/functional/maintenance/user/password_resets_controller_test.rb index 0c18fdb20..27f3849e3 100644 --- a/test/functional/maintenance/user/password_resets_controller_test.rb +++ b/test/functional/maintenance/user/password_resets_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Maintenance diff --git a/test/functional/meta_searches_controller_test.rb b/test/functional/meta_searches_controller_test.rb index b776778e4..d1ffe1868 100644 --- a/test/functional/meta_searches_controller_test.rb +++ b/test/functional/meta_searches_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class MetaSearchesControllerTest < ActionDispatch::IntegrationTest context "The meta searches controller" do diff --git a/test/functional/mod_actions_controller_test.rb b/test/functional/mod_actions_controller_test.rb index 28b156656..2c45cae25 100644 --- a/test/functional/mod_actions_controller_test.rb +++ b/test/functional/mod_actions_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ModActionsControllerTest < ActionDispatch::IntegrationTest context "The mod actions controller" do diff --git a/test/functional/moderator/dashboards_controller_test.rb b/test/functional/moderator/dashboards_controller_test.rb index 742528ca6..ce81bb32e 100644 --- a/test/functional/moderator/dashboards_controller_test.rb +++ b/test/functional/moderator/dashboards_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" module Moderator class DashboardsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/moderator/ip_addrs_controller_test.rb b/test/functional/moderator/ip_addrs_controller_test.rb index fda2eb871..fc55aeb3c 100644 --- a/test/functional/moderator/ip_addrs_controller_test.rb +++ b/test/functional/moderator/ip_addrs_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" module Moderator class IpAddrsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/moderator/post/approvals_controller_test.rb b/test/functional/moderator/post/approvals_controller_test.rb index a15688e6c..55ce673c6 100644 --- a/test/functional/moderator/post/approvals_controller_test.rb +++ b/test/functional/moderator/post/approvals_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Moderator diff --git a/test/functional/moderator/post/disapprovals_controller_test.rb b/test/functional/moderator/post/disapprovals_controller_test.rb index 7970a523d..2cd96e7f0 100644 --- a/test/functional/moderator/post/disapprovals_controller_test.rb +++ b/test/functional/moderator/post/disapprovals_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" module Moderator module Post diff --git a/test/functional/moderator/post/posts_controller_test.rb b/test/functional/moderator/post/posts_controller_test.rb index 640b6c5c0..09c194e50 100644 --- a/test/functional/moderator/post/posts_controller_test.rb +++ b/test/functional/moderator/post/posts_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" module Moderator module Post diff --git a/test/functional/news_updates_controller_test.rb b/test/functional/news_updates_controller_test.rb index 4c26d109d..a2fa86e93 100644 --- a/test/functional/news_updates_controller_test.rb +++ b/test/functional/news_updates_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class NewsUpdatesControllerTest < ActionDispatch::IntegrationTest context "the news updates controller" do diff --git a/test/functional/note_previews_controller_test.rb b/test/functional/note_previews_controller_test.rb index 5558f334d..5fbd38e77 100644 --- a/test/functional/note_previews_controller_test.rb +++ b/test/functional/note_previews_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class NotePreviewsControllerTest < ActionDispatch::IntegrationTest context "The note previews controller" do diff --git a/test/functional/note_versions_controller_test.rb b/test/functional/note_versions_controller_test.rb index 3ed4faf1d..1d6ff11c3 100644 --- a/test/functional/note_versions_controller_test.rb +++ b/test/functional/note_versions_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class NoteVersionsControllerTest < ActionDispatch::IntegrationTest context "The note versions controller" do diff --git a/test/functional/notes_controller_test.rb b/test/functional/notes_controller_test.rb index e096fc70f..eff0ac21b 100644 --- a/test/functional/notes_controller_test.rb +++ b/test/functional/notes_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class NotesControllerTest < ActionDispatch::IntegrationTest context "The notes controller" do diff --git a/test/functional/pool_elements_controller_test.rb b/test/functional/pool_elements_controller_test.rb index a3a96fa43..466cd5512 100644 --- a/test/functional/pool_elements_controller_test.rb +++ b/test/functional/pool_elements_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PoolElementsControllerTest < ActionDispatch::IntegrationTest context "The pools posts controller" do diff --git a/test/functional/pool_versions_controller_test.rb b/test/functional/pool_versions_controller_test.rb index 9d0987d54..510301198 100644 --- a/test/functional/pool_versions_controller_test.rb +++ b/test/functional/pool_versions_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PoolVersionsControllerTest < ActionDispatch::IntegrationTest context "The pool versions controller" do diff --git a/test/functional/pools_controller_test.rb b/test/functional/pools_controller_test.rb index 1a1e5dff2..825c2d551 100644 --- a/test/functional/pools_controller_test.rb +++ b/test/functional/pools_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PoolsControllerTest < ActionDispatch::IntegrationTest context "The pools controller" do diff --git a/test/functional/popular_controller_test.rb b/test/functional/popular_controller_test.rb index 86106662b..aec280757 100644 --- a/test/functional/popular_controller_test.rb +++ b/test/functional/popular_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class PopularControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/post_approvals_controller_test.rb b/test/functional/post_approvals_controller_test.rb index 6c971d4e3..50eaed5a7 100644 --- a/test/functional/post_approvals_controller_test.rb +++ b/test/functional/post_approvals_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostApprovalsControllerTest < ActionDispatch::IntegrationTest context "The post approvals controller" do diff --git a/test/functional/post_events_controller_test.rb b/test/functional/post_events_controller_test.rb index 01c9cdd55..ed3634d0c 100644 --- a/test/functional/post_events_controller_test.rb +++ b/test/functional/post_events_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostEventsControllerTest < ActionDispatch::IntegrationTest setup do diff --git a/test/functional/post_flags_controller_test.rb b/test/functional/post_flags_controller_test.rb index a1219ab9e..d93dc881f 100644 --- a/test/functional/post_flags_controller_test.rb +++ b/test/functional/post_flags_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostFlagsControllerTest < ActionDispatch::IntegrationTest context "The post flags controller" do diff --git a/test/functional/post_replacements_controller_test.rb b/test/functional/post_replacements_controller_test.rb index 52b966574..03201d8f5 100644 --- a/test/functional/post_replacements_controller_test.rb +++ b/test/functional/post_replacements_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostReplacementsControllerTest < ActionDispatch::IntegrationTest context "The post replacements controller" do diff --git a/test/functional/post_versions_controller_test.rb b/test/functional/post_versions_controller_test.rb index 8c322c1e4..47ac9abba 100644 --- a/test/functional/post_versions_controller_test.rb +++ b/test/functional/post_versions_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class PostVersionsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/post_votes_controller_test.rb b/test/functional/post_votes_controller_test.rb index c4c26f5e5..c2eee56d2 100644 --- a/test/functional/post_votes_controller_test.rb +++ b/test/functional/post_votes_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostVotesControllerTest < ActionDispatch::IntegrationTest context "The post vote controller" do diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index 75ac6ad55..ee5f8d580 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class PostsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/related_tags_controller_test.rb b/test/functional/related_tags_controller_test.rb index 2260ff035..45eb4b29b 100644 --- a/test/functional/related_tags_controller_test.rb +++ b/test/functional/related_tags_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class RelatedTagsControllerTest < ActionDispatch::IntegrationTest context "The related tags controller" do diff --git a/test/functional/sessions_controller_test.rb b/test/functional/sessions_controller_test.rb index 13f1ca95a..249a128c9 100644 --- a/test/functional/sessions_controller_test.rb +++ b/test/functional/sessions_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class SessionsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/tag_alias_requests_controller_test.rb b/test/functional/tag_alias_requests_controller_test.rb index b3d34ed92..a22e6aa91 100644 --- a/test/functional/tag_alias_requests_controller_test.rb +++ b/test/functional/tag_alias_requests_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagAliasRequestsControllerTest < ActionDispatch::IntegrationTest context "The tag alias request controller" do diff --git a/test/functional/tag_aliases_controller_test.rb b/test/functional/tag_aliases_controller_test.rb index f826f5c23..b3778167c 100644 --- a/test/functional/tag_aliases_controller_test.rb +++ b/test/functional/tag_aliases_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TagAliasesControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/tag_implication_requests_controller_test.rb b/test/functional/tag_implication_requests_controller_test.rb index 6d205f566..70a7f292e 100644 --- a/test/functional/tag_implication_requests_controller_test.rb +++ b/test/functional/tag_implication_requests_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagImplicationRequestsControllerTest < ActionDispatch::IntegrationTest context "The tag implication request controller" do diff --git a/test/functional/tag_implications_controller_test.rb b/test/functional/tag_implications_controller_test.rb index 84ca734fb..749f02236 100644 --- a/test/functional/tag_implications_controller_test.rb +++ b/test/functional/tag_implications_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TagImplicationsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/tags_controller_test.rb b/test/functional/tags_controller_test.rb index dfa5eeb2b..58dfc15e5 100644 --- a/test/functional/tags_controller_test.rb +++ b/test/functional/tags_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagsControllerTest < ActionDispatch::IntegrationTest context "The tags controller" do diff --git a/test/functional/tickets_controller_test.rb b/test/functional/tickets_controller_test.rb index c7f6851ca..804ca199f 100644 --- a/test/functional/tickets_controller_test.rb +++ b/test/functional/tickets_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TicketsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/uploads_controller_test.rb b/test/functional/uploads_controller_test.rb index 7dfc84346..e4d8db83e 100644 --- a/test/functional/uploads_controller_test.rb +++ b/test/functional/uploads_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UploadsControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/user_feedbacks_controller_test.rb b/test/functional/user_feedbacks_controller_test.rb index 87e6161f3..cea1a7b0a 100644 --- a/test/functional/user_feedbacks_controller_test.rb +++ b/test/functional/user_feedbacks_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UserFeedbacksControllerTest < ActionDispatch::IntegrationTest diff --git a/test/functional/user_name_change_requests_controller_test.rb b/test/functional/user_name_change_requests_controller_test.rb index 186d73a1c..08a9a08b7 100644 --- a/test/functional/user_name_change_requests_controller_test.rb +++ b/test/functional/user_name_change_requests_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class UserNameChangeRequestsControllerTest < ActionDispatch::IntegrationTest context "The user name change requests controller" do diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 183fea00f..232f836cb 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class UsersControllerTest < ActionDispatch::IntegrationTest context "The users controller" do diff --git a/test/functional/wiki_page_versions_controller_test.rb b/test/functional/wiki_page_versions_controller_test.rb index 9f651d01d..ac4108eb6 100644 --- a/test/functional/wiki_page_versions_controller_test.rb +++ b/test/functional/wiki_page_versions_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class WikiPageVersionsControllerTest < ActionDispatch::IntegrationTest context "The wiki page versions controller" do diff --git a/test/functional/wiki_pages_controller_test.rb b/test/functional/wiki_pages_controller_test.rb index 180956c2b..ca29c2462 100644 --- a/test/functional/wiki_pages_controller_test.rb +++ b/test/functional/wiki_pages_controller_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class WikiPagesControllerTest < ActionDispatch::IntegrationTest context "The wiki pages controller" do diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index b4d9c4bc4..da01895e3 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ApplicationHelperTest < ActionView::TestCase diff --git a/test/helpers/text_helper_test.rb b/test/helpers/text_helper_test.rb index 8371f8040..54cba63f4 100644 --- a/test/helpers/text_helper_test.rb +++ b/test/helpers/text_helper_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TextHelperTest < ActionView::TestCase diff --git a/test/jobs/tag_batch_job_test.rb b/test/jobs/tag_batch_job_test.rb index e4280ea6d..fe2793eae 100644 --- a/test/jobs/tag_batch_job_test.rb +++ b/test/jobs/tag_batch_job_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TagBatchJobTest < ActiveJob::TestCase diff --git a/test/jobs/tag_nuke_job_test.rb b/test/jobs/tag_nuke_job_test.rb index 2c5944540..15de0011c 100644 --- a/test/jobs/tag_nuke_job_test.rb +++ b/test/jobs/tag_nuke_job_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TagNukeJobTest < ActiveJob::TestCase diff --git a/test/mailers/previews/user_mailer_preview.rb b/test/mailers/previews/user_mailer_preview.rb index 326b665a5..67201f6c2 100644 --- a/test/mailers/previews/user_mailer_preview.rb +++ b/test/mailers/previews/user_mailer_preview.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserMailerPreview < ActionMailer::Preview def dmail_notice dmail = User.admins.first.dmails.first diff --git a/test/models/upload_service_test.rb b/test/models/upload_service_test.rb index 6683918c5..fe974ea0a 100644 --- a/test/models/upload_service_test.rb +++ b/test/models/upload_service_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class UploadServiceTest < ActiveSupport::TestCase setup do diff --git a/test/test_helper.rb b/test/test_helper.rb index 4b9e62760..be7d3c321 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ENV["RAILS_ENV"] ||= "test" ENV["MT_NO_EXPECTATIONS"] = "true" require_relative "../config/environment" diff --git a/test/unit/api_key_test.rb b/test/unit/api_key_test.rb index cccee51b0..b6bbf0b16 100644 --- a/test/unit/api_key_test.rb +++ b/test/unit/api_key_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ApiKeyTest < ActiveSupport::TestCase context "in all cases a user" do diff --git a/test/unit/apng_inspector_test.rb b/test/unit/apng_inspector_test.rb index 94f944eb4..e59a25122 100644 --- a/test/unit/apng_inspector_test.rb +++ b/test/unit/apng_inspector_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class DTextTest < ActiveSupport::TestCase diff --git a/test/unit/application_record.rb b/test/unit/application_record.rb index 4424f3da3..d69eccdaa 100644 --- a/test/unit/application_record.rb +++ b/test/unit/application_record.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ApplicationRecordTest < ActiveSupport::TestCase setup do diff --git a/test/unit/artist_test.rb b/test/unit/artist_test.rb index 41e13ecd0..18155e393 100644 --- a/test/unit/artist_test.rb +++ b/test/unit/artist_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ArtistTest < ActiveSupport::TestCase diff --git a/test/unit/artist_url_test.rb b/test/unit/artist_url_test.rb index a0d950838..ad99d3612 100644 --- a/test/unit/artist_url_test.rb +++ b/test/unit/artist_url_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ArtistUrlTest < ActiveSupport::TestCase def assert_search_equals(results, conditions) diff --git a/test/unit/ban_test.rb b/test/unit/ban_test.rb index c481d931d..b2f2d80f5 100644 --- a/test/unit/ban_test.rb +++ b/test/unit/ban_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class BanTest < ActiveSupport::TestCase context "A ban" do diff --git a/test/unit/blip_test.rb b/test/unit/blip_test.rb index 86f80be36..efa8e8d38 100644 --- a/test/unit/blip_test.rb +++ b/test/unit/blip_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class BlipTest < ActiveSupport::TestCase diff --git a/test/unit/bulk_update_importer_importer_test.rb b/test/unit/bulk_update_importer_importer_test.rb index 4ae1a1a6b..1d6f5b2f5 100644 --- a/test/unit/bulk_update_importer_importer_test.rb +++ b/test/unit/bulk_update_importer_importer_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class BulkUpdateRequestImporterTest < ActiveSupport::TestCase context "The alias and implication importer" do diff --git a/test/unit/bulk_update_request_test.rb b/test/unit/bulk_update_request_test.rb index fbf422583..759076ff3 100644 --- a/test/unit/bulk_update_request_test.rb +++ b/test/unit/bulk_update_request_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class BulkUpdateRequestTest < ActiveSupport::TestCase context "a bulk update request" do diff --git a/test/unit/cloudflare_service_test.rb b/test/unit/cloudflare_service_test.rb index 6e5dbe851..93db62190 100644 --- a/test/unit/cloudflare_service_test.rb +++ b/test/unit/cloudflare_service_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class CloudflareServiceTest < ActiveSupport::TestCase diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index acb35ed7b..ca50f6ca7 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class CommentTest < ActiveSupport::TestCase diff --git a/test/unit/current_user_test.rb b/test/unit/current_user_test.rb index 18ddd74a4..d9b4e9bff 100644 --- a/test/unit/current_user_test.rb +++ b/test/unit/current_user_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class CurrentUserTest < ActiveSupport::TestCase context "A scoped current user" do diff --git a/test/unit/dmail_filter_test.rb b/test/unit/dmail_filter_test.rb index 2b423dca3..290b3b788 100644 --- a/test/unit/dmail_filter_test.rb +++ b/test/unit/dmail_filter_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class DmailFilterTest < ActiveSupport::TestCase setup do diff --git a/test/unit/dmail_test.rb b/test/unit/dmail_test.rb index c2b1b0c6e..111265af6 100644 --- a/test/unit/dmail_test.rb +++ b/test/unit/dmail_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class DmailTest < ActiveSupport::TestCase diff --git a/test/unit/document_store/model_test.rb b/test/unit/document_store/model_test.rb index bbedef380..ec9ddf0b1 100644 --- a/test/unit/document_store/model_test.rb +++ b/test/unit/document_store/model_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module DocumentStore diff --git a/test/unit/downloads/file_test.rb b/test/unit/downloads/file_test.rb index e7d8e6fef..daca5385a 100644 --- a/test/unit/downloads/file_test.rb +++ b/test/unit/downloads/file_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Downloads diff --git a/test/unit/email_blacklist_test.rb b/test/unit/email_blacklist_test.rb index decf46036..07e78b0ac 100644 --- a/test/unit/email_blacklist_test.rb +++ b/test/unit/email_blacklist_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class EmailBlacklistTest < ActiveSupport::TestCase setup do diff --git a/test/unit/favorite_test.rb b/test/unit/favorite_test.rb index 95f30645f..2cb858760 100644 --- a/test/unit/favorite_test.rb +++ b/test/unit/favorite_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class FavoriteTest < ActiveSupport::TestCase setup do diff --git a/test/unit/forum_post_test.rb b/test/unit/forum_post_test.rb index abebf0f01..2099920d2 100644 --- a/test/unit/forum_post_test.rb +++ b/test/unit/forum_post_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ForumPostTest < ActiveSupport::TestCase diff --git a/test/unit/forum_topic_test.rb b/test/unit/forum_topic_test.rb index 713de315e..615cf9f63 100644 --- a/test/unit/forum_topic_test.rb +++ b/test/unit/forum_topic_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class ForumTopicTest < ActiveSupport::TestCase context "A forum topic" do diff --git a/test/unit/ip_ban_test.rb b/test/unit/ip_ban_test.rb index e4154ee76..659298fce 100644 --- a/test/unit/ip_ban_test.rb +++ b/test/unit/ip_ban_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class IpBanTest < ActiveSupport::TestCase setup do diff --git a/test/unit/maintenance/user/login_reminder_mailer_test.rb b/test/unit/maintenance/user/login_reminder_mailer_test.rb index 806e95051..fe21d4d96 100644 --- a/test/unit/maintenance/user/login_reminder_mailer_test.rb +++ b/test/unit/maintenance/user/login_reminder_mailer_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Maintenance diff --git a/test/unit/maintenance_test.rb b/test/unit/maintenance_test.rb index d2efa6303..cb014cc50 100644 --- a/test/unit/maintenance_test.rb +++ b/test/unit/maintenance_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class MaintenanceTest < ActiveSupport::TestCase context "daily maintenance" do diff --git a/test/unit/meta_searches/tag_test.rb b/test/unit/meta_searches/tag_test.rb index 4d57f31e8..26dab3cf9 100644 --- a/test/unit/meta_searches/tag_test.rb +++ b/test/unit/meta_searches/tag_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module MetaSearches diff --git a/test/unit/moderator/ip_addr_search_test.rb b/test/unit/moderator/ip_addr_search_test.rb index 97506db20..9cd775aff 100644 --- a/test/unit/moderator/ip_addr_search_test.rb +++ b/test/unit/moderator/ip_addr_search_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module Moderator diff --git a/test/unit/note_test.rb b/test/unit/note_test.rb index 78e0e9e66..133111131 100644 --- a/test/unit/note_test.rb +++ b/test/unit/note_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class NoteTest < ActiveSupport::TestCase context "In all cases" do diff --git a/test/unit/paginator_test.rb b/test/unit/paginator_test.rb index a76d16ea1..437505958 100644 --- a/test/unit/paginator_test.rb +++ b/test/unit/paginator_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class PaginatorTest < ActiveSupport::TestCase diff --git a/test/unit/parse_value_test.rb b/test/unit/parse_value_test.rb index c74a639be..e09de45b2 100644 --- a/test/unit/parse_value_test.rb +++ b/test/unit/parse_value_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ParseValueTest < ActiveSupport::TestCase diff --git a/test/unit/pool_test.rb b/test/unit/pool_test.rb index 06583c644..c3c6ea1fd 100644 --- a/test/unit/pool_test.rb +++ b/test/unit/pool_test.rb @@ -1,6 +1,6 @@ -# encoding: utf-8 +# frozen_string_literal: true -require 'test_helper' +require "test_helper" class PoolTest < ActiveSupport::TestCase setup do diff --git a/test/unit/post_approval_test.rb b/test/unit/post_approval_test.rb index 2cbd158f7..e8c283020 100644 --- a/test/unit/post_approval_test.rb +++ b/test/unit/post_approval_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostApprovalTest < ActiveSupport::TestCase context "a pending post" do diff --git a/test/unit/post_disapproval_test.rb b/test/unit/post_disapproval_test.rb index 82d62faa6..58530763b 100644 --- a/test/unit/post_disapproval_test.rb +++ b/test/unit/post_disapproval_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostDisapprovalTest < ActiveSupport::TestCase context "In all cases" do diff --git a/test/unit/post_event_test.rb b/test/unit/post_event_test.rb index 584f34418..12623cb5e 100644 --- a/test/unit/post_event_test.rb +++ b/test/unit/post_event_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostEventTest < ActiveSupport::TestCase setup do diff --git a/test/unit/post_flag_test.rb b/test/unit/post_flag_test.rb index a0b1764fe..e6d43f02b 100644 --- a/test/unit/post_flag_test.rb +++ b/test/unit/post_flag_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostFlagTest < ActiveSupport::TestCase context "In all cases" do diff --git a/test/unit/post_pruner_test.rb b/test/unit/post_pruner_test.rb index dcb8be196..de928ec5c 100644 --- a/test/unit/post_pruner_test.rb +++ b/test/unit/post_pruner_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostPrunerTest < ActiveSupport::TestCase setup do diff --git a/test/unit/post_replacement_test.rb b/test/unit/post_replacement_test.rb index f73c53b72..deb4e6b08 100644 --- a/test/unit/post_replacement_test.rb +++ b/test/unit/post_replacement_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostReplacementTest < ActiveSupport::TestCase setup do diff --git a/test/unit/post_sets/favorites_test.rb b/test/unit/post_sets/favorites_test.rb index e9ae9cf6d..d9dec38dd 100644 --- a/test/unit/post_sets/favorites_test.rb +++ b/test/unit/post_sets/favorites_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" module PostSets class FavoritesTest < ActiveSupport::TestCase diff --git a/test/unit/post_sets/pool_test.rb b/test/unit/post_sets/pool_test.rb index 773074e0b..639d6d5e8 100644 --- a/test/unit/post_sets/pool_test.rb +++ b/test/unit/post_sets/pool_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module PostSets diff --git a/test/unit/post_sets/post_test.rb b/test/unit/post_sets/post_test.rb index 0141532e1..af14f63c2 100644 --- a/test/unit/post_sets/post_test.rb +++ b/test/unit/post_sets/post_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" module PostSets diff --git a/test/unit/post_test.rb b/test/unit/post_test.rb index a31451c50..247db5c02 100644 --- a/test/unit/post_test.rb +++ b/test/unit/post_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostTest < ActiveSupport::TestCase def assert_tag_match(posts, query) diff --git a/test/unit/post_version_test.rb b/test/unit/post_version_test.rb index b4105a680..02216574c 100644 --- a/test/unit/post_version_test.rb +++ b/test/unit/post_version_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostVersionTest < ActiveSupport::TestCase context "A post" do diff --git a/test/unit/post_vote_test.rb b/test/unit/post_vote_test.rb index 2e80e48e1..d5a0d7a82 100644 --- a/test/unit/post_vote_test.rb +++ b/test/unit/post_vote_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class PostVoteTest < ActiveSupport::TestCase setup do diff --git a/test/unit/related_tag_calculator_test.rb b/test/unit/related_tag_calculator_test.rb index 889b27657..f6dd5fbe5 100644 --- a/test/unit/related_tag_calculator_test.rb +++ b/test/unit/related_tag_calculator_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class RelatedTagCalculatorTest < ActiveSupport::TestCase setup do diff --git a/test/unit/related_tag_query_test.rb b/test/unit/related_tag_query_test.rb index b21b859f1..f996bf13f 100644 --- a/test/unit/related_tag_query_test.rb +++ b/test/unit/related_tag_query_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class RelatedTagQueryTest < ActiveSupport::TestCase setup do diff --git a/test/unit/session_loader_test.rb b/test/unit/session_loader_test.rb index 89796345b..64a2e0290 100644 --- a/test/unit/session_loader_test.rb +++ b/test/unit/session_loader_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class SessionLoaderTest < ActiveSupport::TestCase context "SessionLoader" do diff --git a/test/unit/sources/null_test.rb b/test/unit/sources/null_test.rb index bd5bb1246..9223d6e52 100644 --- a/test/unit/sources/null_test.rb +++ b/test/unit/sources/null_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" module Sources class NullTest < ActiveSupport::TestCase diff --git a/test/unit/storage_manager_test.rb b/test/unit/storage_manager_test.rb index 1a24c237d..f26d43b5e 100644 --- a/test/unit/storage_manager_test.rb +++ b/test/unit/storage_manager_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class StorageManagerTest < ActiveSupport::TestCase BASE_DIR = "#{Rails.root}/tmp/test-storage" diff --git a/test/unit/string_test.rb b/test/unit/string_test.rb index 47224ba77..4fe0f817b 100644 --- a/test/unit/string_test.rb +++ b/test/unit/string_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class StringTest < ActiveSupport::TestCase context "String#to_escaped_for_sql_like" do diff --git a/test/unit/tag_alias_request_test.rb b/test/unit/tag_alias_request_test.rb index 814e293d0..47d87bed8 100644 --- a/test/unit/tag_alias_request_test.rb +++ b/test/unit/tag_alias_request_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagAliasRequestTest < ActiveSupport::TestCase context "A tag alias request" do diff --git a/test/unit/tag_alias_test.rb b/test/unit/tag_alias_test.rb index 36901cf5b..4db2df243 100644 --- a/test/unit/tag_alias_test.rb +++ b/test/unit/tag_alias_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagAliasTest < ActiveSupport::TestCase context "A tag alias" do diff --git a/test/unit/tag_implication_request_test.rb b/test/unit/tag_implication_request_test.rb index d61ba7da3..65d081c44 100644 --- a/test/unit/tag_implication_request_test.rb +++ b/test/unit/tag_implication_request_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagImplicationRequestTest < ActiveSupport::TestCase context "A tag implication request" do diff --git a/test/unit/tag_implication_test.rb b/test/unit/tag_implication_test.rb index d93ec5872..fd5184636 100644 --- a/test/unit/tag_implication_test.rb +++ b/test/unit/tag_implication_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagImplicationTest < ActiveSupport::TestCase context "A tag implication" do diff --git a/test/unit/tag_query_test.rb b/test/unit/tag_query_test.rb index 62a1bf59d..479de507a 100644 --- a/test/unit/tag_query_test.rb +++ b/test/unit/tag_query_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TagQueryTest < ActiveSupport::TestCase diff --git a/test/unit/tag_set_presenter_test.rb b/test/unit/tag_set_presenter_test.rb index 5a059e137..20b864e44 100644 --- a/test/unit/tag_set_presenter_test.rb +++ b/test/unit/tag_set_presenter_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class TagSetPresenterTest < ActiveSupport::TestCase diff --git a/test/unit/tag_test.rb b/test/unit/tag_test.rb index 46a32e673..9f5ff3ba8 100644 --- a/test/unit/tag_test.rb +++ b/test/unit/tag_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class TagTest < ActiveSupport::TestCase setup do diff --git a/test/unit/upload_test.rb b/test/unit/upload_test.rb index 0245eb21b..ed7282c79 100644 --- a/test/unit/upload_test.rb +++ b/test/unit/upload_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UploadTest < ActiveSupport::TestCase diff --git a/test/unit/upload_whitelist_test.rb b/test/unit/upload_whitelist_test.rb index d94bb3d0e..a4a9b01da 100644 --- a/test/unit/upload_whitelist_test.rb +++ b/test/unit/upload_whitelist_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UploadWhitelistTest < ActiveSupport::TestCase diff --git a/test/unit/user_deletion_test.rb b/test/unit/user_deletion_test.rb index 6e76354e6..487bd552c 100644 --- a/test/unit/user_deletion_test.rb +++ b/test/unit/user_deletion_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UserDeletionTest < ActiveSupport::TestCase diff --git a/test/unit/user_feedback_test.rb b/test/unit/user_feedback_test.rb index 0366b0a27..bcded2f2f 100644 --- a/test/unit/user_feedback_test.rb +++ b/test/unit/user_feedback_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class UserFeedbackTest < ActiveSupport::TestCase context "A user's feedback" do diff --git a/test/unit/user_name_change_request_test.rb b/test/unit/user_name_change_request_test.rb index c0fd54fc2..91630d97f 100644 --- a/test/unit/user_name_change_request_test.rb +++ b/test/unit/user_name_change_request_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UserNameChangeRequestTest < ActiveSupport::TestCase diff --git a/test/unit/user_password_reset_nonce_test.rb b/test/unit/user_password_reset_nonce_test.rb index cfa4d4944..b61c5e670 100644 --- a/test/unit/user_password_reset_nonce_test.rb +++ b/test/unit/user_password_reset_nonce_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class UserPasswordResetNonceTest < ActiveSupport::TestCase context "Creating a new nonce" do diff --git a/test/unit/user_revert_test.rb b/test/unit/user_revert_test.rb index 3d3dc8456..c8f36c7fa 100644 --- a/test/unit/user_revert_test.rb +++ b/test/unit/user_revert_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class UserRevertTest < ActiveSupport::TestCase diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index cd7846c85..403e4e7de 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class UserTest < ActiveSupport::TestCase context "A user" do diff --git a/test/unit/wiki_page_test.rb b/test/unit/wiki_page_test.rb index 092ee9502..e1586f4d0 100644 --- a/test/unit/wiki_page_test.rb +++ b/test/unit/wiki_page_test.rb @@ -1,4 +1,6 @@ -require 'test_helper' +# frozen_string_literal: true + +require "test_helper" class WikiPageTest < ActiveSupport::TestCase context "A wiki page" do diff --git a/test/unit/zeitwerk_test.rb b/test/unit/zeitwerk_test.rb index 87efc2db7..e1c9ad7ee 100644 --- a/test/unit/zeitwerk_test.rb +++ b/test/unit/zeitwerk_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "test_helper" class ZeitwerkTest < ActiveSupport::TestCase