diff --git a/.rubocop.yml b/.rubocop.yml
index 9d2e219e3c7..5c99bdcc02a 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -12,6 +12,9 @@ AllCops:
Style/AndOr:
Enabled: true
+Style/FrozenStringLiteralComment:
+ Enabled: true
+
# Do not use braces for hash literals when they are the last argument of a
# method call.
Style/BracesAroundHashParameters:
diff --git a/Brewfile b/Brewfile
index 89595137b60..424d53b965e 100644
--- a/Brewfile
+++ b/Brewfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Install development dependencies on Mac OS X using Homebrew (http://mxcl.github.com/homebrew)
# you probably already have git installed; ensure that it is the latest version
diff --git a/Dangerfile b/Dangerfile
index b8f84230358..72c02d7c78b 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if github.pr_json && (github.pr_json["additions"] || 0) > 250 || (github.pr_json["deletions"] || 0) > 250
warn("This pull request is big! We prefer smaller PRs whenever possible, as they are easier to review. Can this be split into a few smaller PRs?")
end
diff --git a/Gemfile b/Gemfile
index deb79382fce..b15625eb0ae 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
source 'https://rubygems.org'
# if there is a super emergency and rubygems is playing up, try
#source 'http://production.cf.rubygems.org'
diff --git a/Rakefile b/Rakefile
index 7a7f9ee44b3..dc7fdf2ecfd 100755
--- a/Rakefile
+++ b/Rakefile
@@ -1,4 +1,6 @@
#!/usr/bin/env rake
+# 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/controllers/about_controller.rb b/app/controllers/about_controller.rb
index 3408239865b..03336bdc004 100644
--- a/app/controllers/about_controller.rb
+++ b/app/controllers/about_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'rate_limiter'
class AboutController < ApplicationController
diff --git a/app/controllers/admin/emojis_controller.rb b/app/controllers/admin/emojis_controller.rb
index 649ebec8045..f8baa5dc39a 100644
--- a/app/controllers/admin/emojis_controller.rb
+++ b/app/controllers/admin/emojis_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'upload_creator'
class Admin::EmojisController < Admin::AdminController
diff --git a/app/controllers/admin/flagged_topics_controller.rb b/app/controllers/admin/flagged_topics_controller.rb
index 82e7b68b27f..10680b9ecea 100644
--- a/app/controllers/admin/flagged_topics_controller.rb
+++ b/app/controllers/admin/flagged_topics_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'flag_query'
class Admin::FlaggedTopicsController < Admin::AdminController
diff --git a/app/controllers/admin/flags_controller.rb b/app/controllers/admin/flags_controller.rb
index 75e97015779..9ede2f7c8f2 100644
--- a/app/controllers/admin/flags_controller.rb
+++ b/app/controllers/admin/flags_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'flag_query'
class Admin::FlagsController < Admin::AdminController
diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb
index c8a328000d0..8281655910d 100644
--- a/app/controllers/admin/groups_controller.rb
+++ b/app/controllers/admin/groups_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::GroupsController < Admin::AdminController
def bulk
end
diff --git a/app/controllers/admin/impersonate_controller.rb b/app/controllers/admin/impersonate_controller.rb
index 31727d0f267..8045f20d1e2 100644
--- a/app/controllers/admin/impersonate_controller.rb
+++ b/app/controllers/admin/impersonate_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::ImpersonateController < Admin::AdminController
def create
diff --git a/app/controllers/admin/permalinks_controller.rb b/app/controllers/admin/permalinks_controller.rb
index b00978f5259..4b042490597 100644
--- a/app/controllers/admin/permalinks_controller.rb
+++ b/app/controllers/admin/permalinks_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::PermalinksController < Admin::AdminController
before_action :fetch_permalink, only: [:destroy]
diff --git a/app/controllers/admin/plugins_controller.rb b/app/controllers/admin/plugins_controller.rb
index 9067fa9e8c9..8df6c9dd148 100644
--- a/app/controllers/admin/plugins_controller.rb
+++ b/app/controllers/admin/plugins_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::PluginsController < Admin::AdminController
def index
diff --git a/app/controllers/admin/reports_controller.rb b/app/controllers/admin/reports_controller.rb
index 8143d099f7b..fe99dd706a2 100644
--- a/app/controllers/admin/reports_controller.rb
+++ b/app/controllers/admin/reports_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'report'
class Admin::ReportsController < Admin::AdminController
diff --git a/app/controllers/admin/screened_emails_controller.rb b/app/controllers/admin/screened_emails_controller.rb
index 014a3844aae..b09eeccf2fe 100644
--- a/app/controllers/admin/screened_emails_controller.rb
+++ b/app/controllers/admin/screened_emails_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::ScreenedEmailsController < Admin::AdminController
def index
diff --git a/app/controllers/admin/screened_ip_addresses_controller.rb b/app/controllers/admin/screened_ip_addresses_controller.rb
index 59f77425221..ac3b1b8b98d 100644
--- a/app/controllers/admin/screened_ip_addresses_controller.rb
+++ b/app/controllers/admin/screened_ip_addresses_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'ip_addr'
class Admin::ScreenedIpAddressesController < Admin::AdminController
diff --git a/app/controllers/admin/screened_urls_controller.rb b/app/controllers/admin/screened_urls_controller.rb
index cc2e2d9d271..e730fbfe3fe 100644
--- a/app/controllers/admin/screened_urls_controller.rb
+++ b/app/controllers/admin/screened_urls_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::ScreenedUrlsController < Admin::AdminController
def index
diff --git a/app/controllers/admin/search_logs_controller.rb b/app/controllers/admin/search_logs_controller.rb
index 280121e9c86..1836df6b549 100644
--- a/app/controllers/admin/search_logs_controller.rb
+++ b/app/controllers/admin/search_logs_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::SearchLogsController < Admin::AdminController
def index
diff --git a/app/controllers/admin/site_settings_controller.rb b/app/controllers/admin/site_settings_controller.rb
index 3a894e1e2b7..546d7974f1f 100644
--- a/app/controllers/admin/site_settings_controller.rb
+++ b/app/controllers/admin/site_settings_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::SiteSettingsController < Admin::AdminController
rescue_from Discourse::InvalidParameters do |e|
render_json_error e.message, status: 422
diff --git a/app/controllers/admin/site_texts_controller.rb b/app/controllers/admin/site_texts_controller.rb
index fe235bff205..65e60629f71 100644
--- a/app/controllers/admin/site_texts_controller.rb
+++ b/app/controllers/admin/site_texts_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'seed_data/categories'
require_dependency 'seed_data/topics'
diff --git a/app/controllers/admin/staff_action_logs_controller.rb b/app/controllers/admin/staff_action_logs_controller.rb
index 46ad493da82..f51d60d3170 100644
--- a/app/controllers/admin/staff_action_logs_controller.rb
+++ b/app/controllers/admin/staff_action_logs_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::StaffActionLogsController < Admin::AdminController
def index
@@ -22,7 +24,7 @@ class Admin::StaffActionLogsController < Admin::AdminController
diff_fields = {}
- output = "
#{CGI.escapeHTML(cur["name"].to_s)}
"
+ output = +"#{CGI.escapeHTML(cur["name"].to_s)}
"
diff_fields["name"] = {
prev: prev["name"].to_s,
diff --git a/app/controllers/admin/themes_controller.rb b/app/controllers/admin/themes_controller.rb
index 042f5bcf2c3..5b4a4cb2b53 100644
--- a/app/controllers/admin/themes_controller.rb
+++ b/app/controllers/admin/themes_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'upload_creator'
require_dependency 'theme_store/tgz_exporter'
require 'base64'
diff --git a/app/controllers/admin/user_fields_controller.rb b/app/controllers/admin/user_fields_controller.rb
index 1139560a6b9..26fa6a51137 100644
--- a/app/controllers/admin/user_fields_controller.rb
+++ b/app/controllers/admin/user_fields_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::UserFieldsController < Admin::AdminController
def self.columns
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 4b77c5d0759..f4235e86539 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'user_destroyer'
require_dependency 'admin_user_index_query'
require_dependency 'admin_confirmation'
diff --git a/app/controllers/admin/versions_controller.rb b/app/controllers/admin/versions_controller.rb
index d92e8b1927e..94ec89be68d 100644
--- a/app/controllers/admin/versions_controller.rb
+++ b/app/controllers/admin/versions_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse_updates'
class Admin::VersionsController < Admin::AdminController
diff --git a/app/controllers/admin/watched_words_controller.rb b/app/controllers/admin/watched_words_controller.rb
index 3be2ea24c9a..534732d1d5d 100644
--- a/app/controllers/admin/watched_words_controller.rb
+++ b/app/controllers/admin/watched_words_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::WatchedWordsController < Admin::AdminController
def index
diff --git a/app/controllers/admin/web_hooks_controller.rb b/app/controllers/admin/web_hooks_controller.rb
index b77b56c5f4d..f5aa0c979c9 100644
--- a/app/controllers/admin/web_hooks_controller.rb
+++ b/app/controllers/admin/web_hooks_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Admin::WebHooksController < Admin::AdminController
before_action :fetch_web_hook, only: %i(show update destroy list_events bulk_events ping)
diff --git a/app/controllers/badges_controller.rb b/app/controllers/badges_controller.rb
index f4f43ffcead..f5c82ea3c1c 100644
--- a/app/controllers/badges_controller.rb
+++ b/app/controllers/badges_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgesController < ApplicationController
skip_before_action :check_xhr, only: [:index, :show]
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb
index b4f80364636..3ff059c2996 100644
--- a/app/controllers/categories_controller.rb
+++ b/app/controllers/categories_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'category_serializer'
class CategoriesController < ApplicationController
diff --git a/app/controllers/category_hashtags_controller.rb b/app/controllers/category_hashtags_controller.rb
index 4bbb85a4061..b08d7f23ae9 100644
--- a/app/controllers/category_hashtags_controller.rb
+++ b/app/controllers/category_hashtags_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryHashtagsController < ApplicationController
requires_login
diff --git a/app/controllers/clicks_controller.rb b/app/controllers/clicks_controller.rb
index c34c143a5b9..5b932484e7b 100644
--- a/app/controllers/clicks_controller.rb
+++ b/app/controllers/clicks_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ClicksController < ApplicationController
skip_before_action :check_xhr, :preload_json, :verify_authenticity_token
diff --git a/app/controllers/composer_controller.rb b/app/controllers/composer_controller.rb
index f5cb462ba47..0f54f282b72 100644
--- a/app/controllers/composer_controller.rb
+++ b/app/controllers/composer_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'html_to_markdown'
class ComposerController < ApplicationController
diff --git a/app/controllers/composer_messages_controller.rb b/app/controllers/composer_messages_controller.rb
index 26e879b109c..97d91a4d3e0 100644
--- a/app/controllers/composer_messages_controller.rb
+++ b/app/controllers/composer_messages_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'composer_messages_finder'
class ComposerMessagesController < ApplicationController
diff --git a/app/controllers/directory_items_controller.rb b/app/controllers/directory_items_controller.rb
index 50456602da5..8a0ce35fd27 100644
--- a/app/controllers/directory_items_controller.rb
+++ b/app/controllers/directory_items_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DirectoryItemsController < ApplicationController
PAGE_SIZE = 50
diff --git a/app/controllers/draft_controller.rb b/app/controllers/draft_controller.rb
index cd5a7ef09e0..95f62c862a2 100644
--- a/app/controllers/draft_controller.rb
+++ b/app/controllers/draft_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DraftController < ApplicationController
requires_login
diff --git a/app/controllers/drafts_controller.rb b/app/controllers/drafts_controller.rb
index 43def371853..6f70e769b9b 100644
--- a/app/controllers/drafts_controller.rb
+++ b/app/controllers/drafts_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DraftsController < ApplicationController
requires_login
diff --git a/app/controllers/email_controller.rb b/app/controllers/email_controller.rb
index 7f24d0fb95b..0e82707e365 100644
--- a/app/controllers/email_controller.rb
+++ b/app/controllers/email_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmailController < ApplicationController
layout 'no_ember'
diff --git a/app/controllers/embed_controller.rb b/app/controllers/embed_controller.rb
index 1199710e226..759e334d4fa 100644
--- a/app/controllers/embed_controller.rb
+++ b/app/controllers/embed_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmbedController < ApplicationController
skip_before_action :check_xhr, :preload_json, :verify_authenticity_token
diff --git a/app/controllers/exceptions_controller.rb b/app/controllers/exceptions_controller.rb
index 4c951e84b68..225c383d6cf 100644
--- a/app/controllers/exceptions_controller.rb
+++ b/app/controllers/exceptions_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ExceptionsController < ApplicationController
skip_before_action :check_xhr, :preload_json
before_action :hide_search
diff --git a/app/controllers/export_csv_controller.rb b/app/controllers/export_csv_controller.rb
index d55053630af..1f0e59ef068 100644
--- a/app/controllers/export_csv_controller.rb
+++ b/app/controllers/export_csv_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ExportCsvController < ApplicationController
skip_before_action :preload_json, :check_xhr, only: [:show]
diff --git a/app/controllers/finish_installation_controller.rb b/app/controllers/finish_installation_controller.rb
index 5683724cca7..580047adc44 100644
--- a/app/controllers/finish_installation_controller.rb
+++ b/app/controllers/finish_installation_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FinishInstallationController < ApplicationController
skip_before_action :check_xhr, :preload_json, :redirect_to_login_if_required
layout 'finish_installation'
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 0fb1694ac55..7a632eb8f6a 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupsController < ApplicationController
include ApplicationHelper
diff --git a/app/controllers/highlight_js_controller.rb b/app/controllers/highlight_js_controller.rb
index 31ba189e3bc..583ba86fe82 100644
--- a/app/controllers/highlight_js_controller.rb
+++ b/app/controllers/highlight_js_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class HighlightJsController < ApplicationController
skip_before_action :preload_json, :redirect_to_login_if_required, :check_xhr, :verify_authenticity_token, only: [:show]
diff --git a/app/controllers/inline_onebox_controller.rb b/app/controllers/inline_onebox_controller.rb
index 977537cd000..4fa1db159c9 100644
--- a/app/controllers/inline_onebox_controller.rb
+++ b/app/controllers/inline_onebox_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'inline_oneboxer'
class InlineOneboxController < ApplicationController
diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb
index 1fcde9ec11f..c17c4329a27 100644
--- a/app/controllers/invites_controller.rb
+++ b/app/controllers/invites_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'rate_limiter'
class InvitesController < ApplicationController
diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb
index 41db5922a67..17fcccdbe6b 100644
--- a/app/controllers/list_controller.rb
+++ b/app/controllers/list_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'topic_list_responder'
class ListController < ApplicationController
diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb
index 50d715933b2..2ec11b39c8e 100644
--- a/app/controllers/notifications_controller.rb
+++ b/app/controllers/notifications_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'notification_serializer'
class NotificationsController < ApplicationController
diff --git a/app/controllers/offline_controller.rb b/app/controllers/offline_controller.rb
index 9ca5ac84cc6..03990e8a5ff 100644
--- a/app/controllers/offline_controller.rb
+++ b/app/controllers/offline_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class OfflineController < ApplicationController
layout false
skip_before_action :preload_json, :check_xhr, :redirect_to_login_if_required
diff --git a/app/controllers/onebox_controller.rb b/app/controllers/onebox_controller.rb
index f093342c772..02fdabe65aa 100644
--- a/app/controllers/onebox_controller.rb
+++ b/app/controllers/onebox_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'oneboxer'
class OneboxController < ApplicationController
diff --git a/app/controllers/permalinks_controller.rb b/app/controllers/permalinks_controller.rb
index 65efdc7908e..260979614e2 100644
--- a/app/controllers/permalinks_controller.rb
+++ b/app/controllers/permalinks_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PermalinksController < ApplicationController
skip_before_action :check_xhr, :preload_json
diff --git a/app/controllers/post_action_users_controller.rb b/app/controllers/post_action_users_controller.rb
index e1bdf163dfb..642c40dd4e6 100644
--- a/app/controllers/post_action_users_controller.rb
+++ b/app/controllers/post_action_users_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse'
class PostActionUsersController < ApplicationController
diff --git a/app/controllers/post_actions_controller.rb b/app/controllers/post_actions_controller.rb
index f36249dbe72..e652fb4ce20 100644
--- a/app/controllers/post_actions_controller.rb
+++ b/app/controllers/post_actions_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse'
class PostActionsController < ApplicationController
diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb
index 45e4abab311..5f469c74504 100644
--- a/app/controllers/posts_controller.rb
+++ b/app/controllers/posts_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'new_post_manager'
require_dependency 'post_creator'
require_dependency 'post_action_destroyer'
@@ -762,7 +764,7 @@ class PostsController < ApplicationController
end
def signature_for(args)
- "post##" << Digest::SHA1.hexdigest(args
+ +"post##" << Digest::SHA1.hexdigest(args
.to_h
.to_a
.concat([["user", current_user.id]])
diff --git a/app/controllers/push_notification_controller.rb b/app/controllers/push_notification_controller.rb
index 8f7d340b06d..0b0a75b39d2 100644
--- a/app/controllers/push_notification_controller.rb
+++ b/app/controllers/push_notification_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PushNotificationController < ApplicationController
layout false
before_action :ensure_logged_in
diff --git a/app/controllers/queued_posts_controller.rb b/app/controllers/queued_posts_controller.rb
index d3ef8d2b9e8..02207905cd6 100644
--- a/app/controllers/queued_posts_controller.rb
+++ b/app/controllers/queued_posts_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'queued_post_serializer'
class QueuedPostsController < ApplicationController
diff --git a/app/controllers/qunit_controller.rb b/app/controllers/qunit_controller.rb
index 6f4b5f5b8f6..f042d0a634d 100644
--- a/app/controllers/qunit_controller.rb
+++ b/app/controllers/qunit_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class QunitController < ApplicationController
skip_before_action :check_xhr, :preload_json, :redirect_to_login_if_required
layout false
diff --git a/app/controllers/robots_txt_controller.rb b/app/controllers/robots_txt_controller.rb
index e9e1c1f4f8b..6d66579fa14 100644
--- a/app/controllers/robots_txt_controller.rb
+++ b/app/controllers/robots_txt_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RobotsTxtController < ApplicationController
layout false
skip_before_action :preload_json, :check_xhr, :redirect_to_login_if_required
diff --git a/app/controllers/safe_mode_controller.rb b/app/controllers/safe_mode_controller.rb
index 77e31a100fd..76a93ebf59b 100644
--- a/app/controllers/safe_mode_controller.rb
+++ b/app/controllers/safe_mode_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SafeModeController < ApplicationController
layout 'no_ember'
before_action :ensure_safe_mode_enabled
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 1502270235c..6e12b367da8 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'search'
class SearchController < ApplicationController
diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb
index 52594e27725..4bc982d9c0f 100644
--- a/app/controllers/session_controller.rb
+++ b/app/controllers/session_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'rate_limiter'
require_dependency 'single_sign_on'
require_dependency 'single_sign_on_provider'
diff --git a/app/controllers/similar_topics_controller.rb b/app/controllers/similar_topics_controller.rb
index e6249cb4d4f..b2a5809505b 100644
--- a/app/controllers/similar_topics_controller.rb
+++ b/app/controllers/similar_topics_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'similar_topic_serializer'
require_dependency 'search/grouped_search_results'
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb
index c2f4f3a19c1..8c1ed8d2deb 100644
--- a/app/controllers/site_controller.rb
+++ b/app/controllers/site_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'site_serializer'
class SiteController < ApplicationController
diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb
index 0276e6f72a6..7d6d37d2a3f 100644
--- a/app/controllers/static_controller.rb
+++ b/app/controllers/static_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'distributed_memoizer'
require_dependency 'file_helper'
@@ -35,7 +37,7 @@ class StaticController < ApplicationController
@page = 'faq' if @page == 'guidelines'
# Don't allow paths like ".." or "/" or anything hacky like that
- @page.gsub!(/[^a-z0-9\_\-]/, '')
+ @page = @page.gsub(/[^a-z0-9\_\-]/, '')
if map.has_key?(@page)
@topic = Topic.find_by_id(SiteSetting.get(map[@page][:topic_id]))
diff --git a/app/controllers/steps_controller.rb b/app/controllers/steps_controller.rb
index d2b9285c67d..5569841838e 100644
--- a/app/controllers/steps_controller.rb
+++ b/app/controllers/steps_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'wizard'
require_dependency 'wizard/builder'
require_dependency 'wizard/step_updater'
diff --git a/app/controllers/stylesheets_controller.rb b/app/controllers/stylesheets_controller.rb
index 364c3e58dce..aa25b78ec91 100644
--- a/app/controllers/stylesheets_controller.rb
+++ b/app/controllers/stylesheets_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class StylesheetsController < ApplicationController
skip_before_action :preload_json, :redirect_to_login_if_required, :check_xhr, :verify_authenticity_token, only: [:show, :show_source_map]
diff --git a/app/controllers/tag_groups_controller.rb b/app/controllers/tag_groups_controller.rb
index d0ee16587c4..f0677769c45 100644
--- a/app/controllers/tag_groups_controller.rb
+++ b/app/controllers/tag_groups_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TagGroupsController < ApplicationController
requires_login
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index 4c9bfc2a7f3..bd381bd1ae9 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'topic_list_responder'
require_dependency 'topics_bulk_action'
require_dependency 'topic_query'
diff --git a/app/controllers/themes_controller.rb b/app/controllers/themes_controller.rb
index 306badc48aa..573f787bb2e 100644
--- a/app/controllers/themes_controller.rb
+++ b/app/controllers/themes_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemesController < ::ApplicationController
def assets
theme_ids = params[:ids].to_s.split("-").map(&:to_i)
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb
index 220a75b5cf7..d2aec7a29a2 100644
--- a/app/controllers/topics_controller.rb
+++ b/app/controllers/topics_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'topic_view'
require_dependency 'promotion'
require_dependency 'url_helper'
diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb
index 1e8ca6be397..d970991ff0f 100644
--- a/app/controllers/uploads_controller.rb
+++ b/app/controllers/uploads_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mini_mime"
require_dependency 'upload_creator'
diff --git a/app/controllers/user_actions_controller.rb b/app/controllers/user_actions_controller.rb
index a66528dcee2..2745ce4da21 100644
--- a/app/controllers/user_actions_controller.rb
+++ b/app/controllers/user_actions_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserActionsController < ApplicationController
def index
diff --git a/app/controllers/user_api_keys_controller.rb b/app/controllers/user_api_keys_controller.rb
index ab80568668f..a30addfd32b 100644
--- a/app/controllers/user_api_keys_controller.rb
+++ b/app/controllers/user_api_keys_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserApiKeysController < ApplicationController
layout 'no_ember'
@@ -91,7 +93,7 @@ class UserApiKeysController < ApplicationController
end
if params[:auth_redirect]
- redirect_path = "#{params[:auth_redirect]}?payload=#{CGI.escape(@payload)}"
+ redirect_path = +"#{params[:auth_redirect]}?payload=#{CGI.escape(@payload)}"
redirect_path << "&oneTimePassword=#{CGI.escape(otp_payload)}" if scopes.include?("one_time_password")
redirect_to(redirect_path)
else
diff --git a/app/controllers/user_avatars_controller.rb b/app/controllers/user_avatars_controller.rb
index 8a61bfa825b..cac63e64e58 100644
--- a/app/controllers/user_avatars_controller.rb
+++ b/app/controllers/user_avatars_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'letter_avatar'
class UserAvatarsController < ApplicationController
diff --git a/app/controllers/user_badges_controller.rb b/app/controllers/user_badges_controller.rb
index 276f9906508..fe306f65ff4 100644
--- a/app/controllers/user_badges_controller.rb
+++ b/app/controllers/user_badges_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserBadgesController < ApplicationController
before_action :ensure_badges_enabled
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index 7c4b9694a18..f96b046d0ac 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -1,4 +1,6 @@
# -*- encoding : utf-8 -*-
+# frozen_string_literal: true
+
require_dependency 'email'
require_dependency 'enum'
require_dependency 'user_name_suggester'
@@ -58,7 +60,7 @@ class Users::OmniauthCallbacksController < ApplicationController
end
if parsed && (parsed.host == nil || parsed.host == Discourse.current_hostname)
- @origin = "#{parsed.path}"
+ @origin = +"#{parsed.path}"
@origin << "?#{parsed.query}" if parsed.query
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 1b60096e398..6693ab6eb90 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse_hub'
require_dependency 'user_name_suggester'
require_dependency 'rate_limiter'
diff --git a/app/controllers/users_email_controller.rb b/app/controllers/users_email_controller.rb
index 3caadf17b43..53d4cc28719 100644
--- a/app/controllers/users_email_controller.rb
+++ b/app/controllers/users_email_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'rate_limiter'
require_dependency 'email_validator'
require_dependency 'email_updater'
diff --git a/app/controllers/webhooks_controller.rb b/app/controllers/webhooks_controller.rb
index 6a1bd810c01..02bff441fb1 100644
--- a/app/controllers/webhooks_controller.rb
+++ b/app/controllers/webhooks_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "openssl"
class WebhooksController < ActionController::Base
diff --git a/app/controllers/wizard_controller.rb b/app/controllers/wizard_controller.rb
index 1bfa774f148..77c44055cc4 100644
--- a/app/controllers/wizard_controller.rb
+++ b/app/controllers/wizard_controller.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'wizard'
require_dependency 'wizard/builder'
diff --git a/app/helpers/common_helper.rb b/app/helpers/common_helper.rb
index 6e37098d2d8..5ce539b47d4 100644
--- a/app/helpers/common_helper.rb
+++ b/app/helpers/common_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module CommonHelper
def render_google_universal_analytics_code
if Rails.env.production? && SiteSetting.ga_universal_tracking_code.present?
diff --git a/app/helpers/email_helper.rb b/app/helpers/email_helper.rb
index 620f1fe94c8..9687138ecaa 100644
--- a/app/helpers/email_helper.rb
+++ b/app/helpers/email_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module EmailHelper
def mailing_list_topic(topic, post_count)
diff --git a/app/helpers/embed_helper.rb b/app/helpers/embed_helper.rb
index 3115f59e1f4..9db2fa5b9b8 100644
--- a/app/helpers/embed_helper.rb
+++ b/app/helpers/embed_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module EmbedHelper
def embed_post_date(dt)
diff --git a/app/helpers/list_helper.rb b/app/helpers/list_helper.rb
index 9839401f9ec..d99129b75eb 100644
--- a/app/helpers/list_helper.rb
+++ b/app/helpers/list_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ListHelper
def page_links(topic)
posts = topic.posts_count
diff --git a/app/helpers/topics_helper.rb b/app/helpers/topics_helper.rb
index b50b923bb87..48306aee5bb 100644
--- a/app/helpers/topics_helper.rb
+++ b/app/helpers/topics_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module TopicsHelper
include ApplicationHelper
diff --git a/app/helpers/user_notifications_helper.rb b/app/helpers/user_notifications_helper.rb
index 575635f13ab..a5cea9c8b1a 100644
--- a/app/helpers/user_notifications_helper.rb
+++ b/app/helpers/user_notifications_helper.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
module UserNotificationsHelper
include GlobalPath
def indent(text, by = 2)
spacer = " " * by
- result = ""
+ result = +""
text.each_line do |line|
result << spacer << line
end
@@ -32,7 +34,7 @@ module UserNotificationsHelper
def first_paragraphs_from(html)
doc = Nokogiri::HTML(html)
- result = ""
+ result = +""
length = 0
doc.css('body > p, aside.onebox, body > ul, body > blockquote').each do |node|
diff --git a/app/jobs/base.rb b/app/jobs/base.rb
index a5df165a0af..b34e3f1c2b0 100644
--- a/app/jobs/base.rb
+++ b/app/jobs/base.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
def self.queued
diff --git a/app/jobs/concerns/skippable.rb b/app/jobs/concerns/skippable.rb
index a8c14824606..30d176e2312 100644
--- a/app/jobs/concerns/skippable.rb
+++ b/app/jobs/concerns/skippable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Skippable
extend ActiveSupport::Concern
diff --git a/app/jobs/onceoff.rb b/app/jobs/onceoff.rb
index 284557ee553..def68e4e64e 100644
--- a/app/jobs/onceoff.rb
+++ b/app/jobs/onceoff.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Jobs::Onceoff < Jobs::Base
sidekiq_options retry: false
diff --git a/app/jobs/onceoff/clean_up_sidekiq_statistic.rb b/app/jobs/onceoff/clean_up_sidekiq_statistic.rb
index 69614a88276..c99a87656dc 100644
--- a/app/jobs/onceoff/clean_up_sidekiq_statistic.rb
+++ b/app/jobs/onceoff/clean_up_sidekiq_statistic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpSidekiqStatistic < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/clear_width_and_height.rb b/app/jobs/onceoff/clear_width_and_height.rb
index 226a863023a..070c16056a9 100644
--- a/app/jobs/onceoff/clear_width_and_height.rb
+++ b/app/jobs/onceoff/clear_width_and_height.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ClearWidthAndHeight < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/correct_missing_dualstack_urls.rb b/app/jobs/onceoff/correct_missing_dualstack_urls.rb
index 5634db3bec2..a8de7b4c69f 100644
--- a/app/jobs/onceoff/correct_missing_dualstack_urls.rb
+++ b/app/jobs/onceoff/correct_missing_dualstack_urls.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CorrectMissingDualstackUrls < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/create_tags_search_index.rb b/app/jobs/onceoff/create_tags_search_index.rb
index 4101aed0dc6..f683834e652 100644
--- a/app/jobs/onceoff/create_tags_search_index.rb
+++ b/app/jobs/onceoff/create_tags_search_index.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CreateTagsSearchIndex < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/fix_featured_link_for_topics.rb b/app/jobs/onceoff/fix_featured_link_for_topics.rb
index 205584d7a3b..4d3c48c9139 100644
--- a/app/jobs/onceoff/fix_featured_link_for_topics.rb
+++ b/app/jobs/onceoff/fix_featured_link_for_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class FixFeaturedLinkForTopics < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/fix_invalid_gravatar_uploads.rb b/app/jobs/onceoff/fix_invalid_gravatar_uploads.rb
index 397ad1b6c49..80fc0f1d271 100644
--- a/app/jobs/onceoff/fix_invalid_gravatar_uploads.rb
+++ b/app/jobs/onceoff/fix_invalid_gravatar_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class FixInvalidGravatarUploads < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/fix_invalid_upload_extensions.rb b/app/jobs/onceoff/fix_invalid_upload_extensions.rb
index 11a00fe35e0..8c62bdbfc18 100644
--- a/app/jobs/onceoff/fix_invalid_upload_extensions.rb
+++ b/app/jobs/onceoff/fix_invalid_upload_extensions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "upload_fixer"
module Jobs
diff --git a/app/jobs/onceoff/fix_out_of_sync_user_uploaded_avatar.rb b/app/jobs/onceoff/fix_out_of_sync_user_uploaded_avatar.rb
index 522ba9c0da7..1029edc9163 100644
--- a/app/jobs/onceoff/fix_out_of_sync_user_uploaded_avatar.rb
+++ b/app/jobs/onceoff/fix_out_of_sync_user_uploaded_avatar.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class FixOutOfSyncUserUploadedAvatar < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/fix_posts_read.rb b/app/jobs/onceoff/fix_posts_read.rb
index 0f8d97918ae..206b5bc41f9 100644
--- a/app/jobs/onceoff/fix_posts_read.rb
+++ b/app/jobs/onceoff/fix_posts_read.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class FixPostsRead < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/fix_primary_emails_for_staged_users.rb b/app/jobs/onceoff/fix_primary_emails_for_staged_users.rb
index c9516e36553..a60b1d6315c 100644
--- a/app/jobs/onceoff/fix_primary_emails_for_staged_users.rb
+++ b/app/jobs/onceoff/fix_primary_emails_for_staged_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'user_destroyer'
module Jobs
diff --git a/app/jobs/onceoff/fix_retro_anniversary.rb b/app/jobs/onceoff/fix_retro_anniversary.rb
index b141c890ff1..bec4d8d62f9 100644
--- a/app/jobs/onceoff/fix_retro_anniversary.rb
+++ b/app/jobs/onceoff/fix_retro_anniversary.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'jobs/scheduled/grant_anniversary_badges'
module Jobs
diff --git a/app/jobs/onceoff/fix_s3_etags.rb b/app/jobs/onceoff/fix_s3_etags.rb
index b2ae816fb99..13cc3b0670c 100644
--- a/app/jobs/onceoff/fix_s3_etags.rb
+++ b/app/jobs/onceoff/fix_s3_etags.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class FixS3Etags < Jobs::Onceoff
diff --git a/app/jobs/onceoff/grant_emoji.rb b/app/jobs/onceoff/grant_emoji.rb
index 39d9ececf8d..1b3b5d6a75d 100644
--- a/app/jobs/onceoff/grant_emoji.rb
+++ b/app/jobs/onceoff/grant_emoji.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class GrantEmoji < Jobs::Onceoff
diff --git a/app/jobs/onceoff/grant_first_reply_by_email.rb b/app/jobs/onceoff/grant_first_reply_by_email.rb
index ef8bcc6469d..7a9eb93361c 100644
--- a/app/jobs/onceoff/grant_first_reply_by_email.rb
+++ b/app/jobs/onceoff/grant_first_reply_by_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class GrantFirstReplyByEmail < Jobs::Onceoff
diff --git a/app/jobs/onceoff/grant_onebox.rb b/app/jobs/onceoff/grant_onebox.rb
index 259dfe97021..ad01a2832b4 100644
--- a/app/jobs/onceoff/grant_onebox.rb
+++ b/app/jobs/onceoff/grant_onebox.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class GrantOnebox < Jobs::Onceoff
diff --git a/app/jobs/onceoff/init_category_tag_stats.rb b/app/jobs/onceoff/init_category_tag_stats.rb
index e9f256d9b5c..a296880f339 100644
--- a/app/jobs/onceoff/init_category_tag_stats.rb
+++ b/app/jobs/onceoff/init_category_tag_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class InitCategoryTagStats < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/migrate_censored_words.rb b/app/jobs/onceoff/migrate_censored_words.rb
index 4f7a2201e72..25d49a1b7b4 100644
--- a/app/jobs/onceoff/migrate_censored_words.rb
+++ b/app/jobs/onceoff/migrate_censored_words.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class MigrateCensoredWords < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/migrate_custom_emojis.rb b/app/jobs/onceoff/migrate_custom_emojis.rb
index 72997c16133..8986aeb8964 100644
--- a/app/jobs/onceoff/migrate_custom_emojis.rb
+++ b/app/jobs/onceoff/migrate_custom_emojis.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'upload_creator'
module Jobs
diff --git a/app/jobs/onceoff/migrate_featured_links.rb b/app/jobs/onceoff/migrate_featured_links.rb
index 6d08826dfc1..e8da50f94d6 100644
--- a/app/jobs/onceoff/migrate_featured_links.rb
+++ b/app/jobs/onceoff/migrate_featured_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class MigrateFeaturedLinks < Jobs::Onceoff
diff --git a/app/jobs/onceoff/migrate_tagging_plugin.rb b/app/jobs/onceoff/migrate_tagging_plugin.rb
index 9d94b8e88f4..a9d2f710403 100644
--- a/app/jobs/onceoff/migrate_tagging_plugin.rb
+++ b/app/jobs/onceoff/migrate_tagging_plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class MigrateTaggingPlugin < Jobs::Onceoff
diff --git a/app/jobs/onceoff/migrate_upload_extensions.rb b/app/jobs/onceoff/migrate_upload_extensions.rb
index 38bcd3a1eab..e5d33660318 100644
--- a/app/jobs/onceoff/migrate_upload_extensions.rb
+++ b/app/jobs/onceoff/migrate_upload_extensions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class MigrateUploadExtensions < Jobs::Onceoff
diff --git a/app/jobs/onceoff/migrate_url_site_settings.rb b/app/jobs/onceoff/migrate_url_site_settings.rb
index 104793f9bdb..63df91a50fd 100644
--- a/app/jobs/onceoff/migrate_url_site_settings.rb
+++ b/app/jobs/onceoff/migrate_url_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class MigrateUrlSiteSettings < Jobs::Onceoff
SETTINGS = [
diff --git a/app/jobs/onceoff/post_uploads_recovery.rb b/app/jobs/onceoff/post_uploads_recovery.rb
index 9c5862e220c..4d92e402bcb 100644
--- a/app/jobs/onceoff/post_uploads_recovery.rb
+++ b/app/jobs/onceoff/post_uploads_recovery.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "upload_recovery"
module Jobs
diff --git a/app/jobs/onceoff/remove_old_auto_close_jobs.rb b/app/jobs/onceoff/remove_old_auto_close_jobs.rb
index 756cb26d048..90af80415d1 100644
--- a/app/jobs/onceoff/remove_old_auto_close_jobs.rb
+++ b/app/jobs/onceoff/remove_old_auto_close_jobs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class RemoveOldAutoCloseJobs < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/onceoff/retro_grant_anniversary.rb b/app/jobs/onceoff/retro_grant_anniversary.rb
index 9cbdddd8109..a4c9c98b2ae 100644
--- a/app/jobs/onceoff/retro_grant_anniversary.rb
+++ b/app/jobs/onceoff/retro_grant_anniversary.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'jobs/scheduled/grant_anniversary_badges'
module Jobs
diff --git a/app/jobs/onceoff/retro_recent_time_read.rb b/app/jobs/onceoff/retro_recent_time_read.rb
index b7bf3e7501a..0cf43669a34 100644
--- a/app/jobs/onceoff/retro_recent_time_read.rb
+++ b/app/jobs/onceoff/retro_recent_time_read.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class RetroRecentTimeRead < Jobs::Onceoff
def execute_onceoff(args)
diff --git a/app/jobs/regular/admin_confirmation_email.rb b/app/jobs/regular/admin_confirmation_email.rb
index dbebf609629..d525ea62c3c 100644
--- a/app/jobs/regular/admin_confirmation_email.rb
+++ b/app/jobs/regular/admin_confirmation_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/sender'
module Jobs
diff --git a/app/jobs/regular/anonymize_user.rb b/app/jobs/regular/anonymize_user.rb
index 3a6d6068e8f..90c855fd3fe 100644
--- a/app/jobs/regular/anonymize_user.rb
+++ b/app/jobs/regular/anonymize_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class AnonymizeUser < Jobs::Base
diff --git a/app/jobs/regular/automatic_group_membership.rb b/app/jobs/regular/automatic_group_membership.rb
index 2b53ffb49cc..9335b6e34a4 100644
--- a/app/jobs/regular/automatic_group_membership.rb
+++ b/app/jobs/regular/automatic_group_membership.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class AutomaticGroupMembership < Jobs::Base
diff --git a/app/jobs/regular/backup_chunks_merger.rb b/app/jobs/regular/backup_chunks_merger.rb
index 0fe070b801b..35695d10a8b 100644
--- a/app/jobs/regular/backup_chunks_merger.rb
+++ b/app/jobs/regular/backup_chunks_merger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "backup_restore/local_backup_store"
require_dependency "backup_restore/backup_store"
diff --git a/app/jobs/regular/bulk_grant_trust_level.rb b/app/jobs/regular/bulk_grant_trust_level.rb
index 9302dc6bc1f..886e604361b 100644
--- a/app/jobs/regular/bulk_grant_trust_level.rb
+++ b/app/jobs/regular/bulk_grant_trust_level.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class BulkGrantTrustLevel < Jobs::Base
diff --git a/app/jobs/regular/bulk_invite.rb b/app/jobs/regular/bulk_invite.rb
index 08b868cddb3..31f00df707b 100644
--- a/app/jobs/regular/bulk_invite.rb
+++ b/app/jobs/regular/bulk_invite.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'csv'
require_dependency 'system_message'
diff --git a/app/jobs/regular/bump_topic.rb b/app/jobs/regular/bump_topic.rb
index f4e21937541..e8176316b14 100644
--- a/app/jobs/regular/bump_topic.rb
+++ b/app/jobs/regular/bump_topic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class BumpTopic < Jobs::Base
diff --git a/app/jobs/regular/confirm_sns_subscription.rb b/app/jobs/regular/confirm_sns_subscription.rb
index 0d489c221ed..d37fdcfd799 100644
--- a/app/jobs/regular/confirm_sns_subscription.rb
+++ b/app/jobs/regular/confirm_sns_subscription.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ConfirmSnsSubscription < Jobs::Base
diff --git a/app/jobs/regular/crawl_topic_link.rb b/app/jobs/regular/crawl_topic_link.rb
index 54abf0a1108..edf3cceee89 100644
--- a/app/jobs/regular/crawl_topic_link.rb
+++ b/app/jobs/regular/crawl_topic_link.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'open-uri'
require 'nokogiri'
require 'excon'
diff --git a/app/jobs/regular/create_avatar_thumbnails.rb b/app/jobs/regular/create_avatar_thumbnails.rb
index 01bb21270be..aa9e4711c1e 100644
--- a/app/jobs/regular/create_avatar_thumbnails.rb
+++ b/app/jobs/regular/create_avatar_thumbnails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CreateAvatarThumbnails < Jobs::Base
diff --git a/app/jobs/regular/create_backup.rb b/app/jobs/regular/create_backup.rb
index f9327567c66..62c67575c12 100644
--- a/app/jobs/regular/create_backup.rb
+++ b/app/jobs/regular/create_backup.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "backup_restore/backup_restore"
module Jobs
diff --git a/app/jobs/regular/create_user_reviewable.rb b/app/jobs/regular/create_user_reviewable.rb
index 27fcaa76c60..f68902ec2b9 100644
--- a/app/jobs/regular/create_user_reviewable.rb
+++ b/app/jobs/regular/create_user_reviewable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Jobs::CreateUserReviewable < Jobs::Base
attr_reader :reviewable
diff --git a/app/jobs/regular/critical_user_email.rb b/app/jobs/regular/critical_user_email.rb
index 2ad08e35b59..7592c7244b4 100644
--- a/app/jobs/regular/critical_user_email.rb
+++ b/app/jobs/regular/critical_user_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# base.rb uses this style of require, so maintain usage of it here
require_dependency "#{Rails.root}/app/jobs/regular/user_email.rb"
diff --git a/app/jobs/regular/delete_topic.rb b/app/jobs/regular/delete_topic.rb
index bfb23f568cf..9b071668620 100644
--- a/app/jobs/regular/delete_topic.rb
+++ b/app/jobs/regular/delete_topic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DeleteTopic < Jobs::Base
diff --git a/app/jobs/regular/download_avatar_from_url.rb b/app/jobs/regular/download_avatar_from_url.rb
index be5f683986e..d87baf0e273 100644
--- a/app/jobs/regular/download_avatar_from_url.rb
+++ b/app/jobs/regular/download_avatar_from_url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DownloadAvatarFromUrl < Jobs::Base
diff --git a/app/jobs/regular/download_backup_email.rb b/app/jobs/regular/download_backup_email.rb
index 43b2d9cd8f7..73c31347c79 100644
--- a/app/jobs/regular/download_backup_email.rb
+++ b/app/jobs/regular/download_backup_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/sender'
require_dependency "email_backup_token"
diff --git a/app/jobs/regular/download_profile_background_from_url.rb b/app/jobs/regular/download_profile_background_from_url.rb
index 43414db9d11..554c7425c19 100644
--- a/app/jobs/regular/download_profile_background_from_url.rb
+++ b/app/jobs/regular/download_profile_background_from_url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DownloadProfileBackgroundFromUrl < Jobs::Base
diff --git a/app/jobs/regular/emit_web_hook_event.rb b/app/jobs/regular/emit_web_hook_event.rb
index 3b067609809..5160fd7dffe 100644
--- a/app/jobs/regular/emit_web_hook_event.rb
+++ b/app/jobs/regular/emit_web_hook_event.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'excon'
module Jobs
diff --git a/app/jobs/regular/enable_bootstrap_mode.rb b/app/jobs/regular/enable_bootstrap_mode.rb
index 34cc5e7165e..6deaef171bb 100644
--- a/app/jobs/regular/enable_bootstrap_mode.rb
+++ b/app/jobs/regular/enable_bootstrap_mode.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class EnableBootstrapMode < Jobs::Base
sidekiq_options queue: 'critical'
diff --git a/app/jobs/regular/export_csv_file.rb b/app/jobs/regular/export_csv_file.rb
index 76aa5dbc9c4..6474618d76e 100644
--- a/app/jobs/regular/export_csv_file.rb
+++ b/app/jobs/regular/export_csv_file.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'csv'
require_dependency 'system_message'
require_dependency 'upload_creator'
diff --git a/app/jobs/regular/feature_topic_users.rb b/app/jobs/regular/feature_topic_users.rb
index 702fb4f6c3b..8ab797d7c53 100644
--- a/app/jobs/regular/feature_topic_users.rb
+++ b/app/jobs/regular/feature_topic_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class FeatureTopicUsers < Jobs::Base
diff --git a/app/jobs/regular/invite_email.rb b/app/jobs/regular/invite_email.rb
index 09c2dd0dba8..0db080ce80d 100644
--- a/app/jobs/regular/invite_email.rb
+++ b/app/jobs/regular/invite_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/sender'
module Jobs
diff --git a/app/jobs/regular/invite_password_instructions_email.rb b/app/jobs/regular/invite_password_instructions_email.rb
index 4ab0df26f7b..009a6b3792e 100644
--- a/app/jobs/regular/invite_password_instructions_email.rb
+++ b/app/jobs/regular/invite_password_instructions_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/sender'
module Jobs
diff --git a/app/jobs/regular/notify_category_change.rb b/app/jobs/regular/notify_category_change.rb
index f3af9bce43b..c37cf442158 100644
--- a/app/jobs/regular/notify_category_change.rb
+++ b/app/jobs/regular/notify_category_change.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "post_alerter"
module Jobs
diff --git a/app/jobs/regular/notify_mailing_list_subscribers.rb b/app/jobs/regular/notify_mailing_list_subscribers.rb
index 6f9d01bed34..50230a380b5 100644
--- a/app/jobs/regular/notify_mailing_list_subscribers.rb
+++ b/app/jobs/regular/notify_mailing_list_subscribers.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'post'
module Jobs
diff --git a/app/jobs/regular/notify_moved_posts.rb b/app/jobs/regular/notify_moved_posts.rb
index 9916bab8e77..e12af831fec 100644
--- a/app/jobs/regular/notify_moved_posts.rb
+++ b/app/jobs/regular/notify_moved_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class NotifyMovedPosts < Jobs::Base
diff --git a/app/jobs/regular/notify_reviewable.rb b/app/jobs/regular/notify_reviewable.rb
index 110fef1c7a5..8bed238b542 100644
--- a/app/jobs/regular/notify_reviewable.rb
+++ b/app/jobs/regular/notify_reviewable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Jobs::NotifyReviewable < Jobs::Base
def execute(args)
diff --git a/app/jobs/regular/notify_tag_change.rb b/app/jobs/regular/notify_tag_change.rb
index ad3d36d0273..4e16d4eb6a5 100644
--- a/app/jobs/regular/notify_tag_change.rb
+++ b/app/jobs/regular/notify_tag_change.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "post_alerter"
module Jobs
diff --git a/app/jobs/regular/post_alert.rb b/app/jobs/regular/post_alert.rb
index 4b09bb3152e..4c28b95947b 100644
--- a/app/jobs/regular/post_alert.rb
+++ b/app/jobs/regular/post_alert.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'post_alerter'
module Jobs
diff --git a/app/jobs/regular/process_email.rb b/app/jobs/regular/process_email.rb
index 81acb4f8af7..d29b410dbbb 100644
--- a/app/jobs/regular/process_email.rb
+++ b/app/jobs/regular/process_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ProcessEmail < Jobs::Base
diff --git a/app/jobs/regular/process_post.rb b/app/jobs/regular/process_post.rb
index d6b3afa4d27..c2eea3e3ada 100644
--- a/app/jobs/regular/process_post.rb
+++ b/app/jobs/regular/process_post.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'image_sizer'
require_dependency 'cooked_post_processor'
diff --git a/app/jobs/regular/process_sns_notification.rb b/app/jobs/regular/process_sns_notification.rb
index fb8447d825c..be51110dd01 100644
--- a/app/jobs/regular/process_sns_notification.rb
+++ b/app/jobs/regular/process_sns_notification.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ProcessSnsNotification < Jobs::Base
diff --git a/app/jobs/regular/publish_topic_to_category.rb b/app/jobs/regular/publish_topic_to_category.rb
index 713f5d87bfc..7e26fdd8c61 100644
--- a/app/jobs/regular/publish_topic_to_category.rb
+++ b/app/jobs/regular/publish_topic_to_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'topic_publisher'
module Jobs
diff --git a/app/jobs/regular/pull_hotlinked_images.rb b/app/jobs/regular/pull_hotlinked_images.rb
index fd8a724568e..e76c4b6c302 100644
--- a/app/jobs/regular/pull_hotlinked_images.rb
+++ b/app/jobs/regular/pull_hotlinked_images.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'url_helper'
require_dependency 'file_helper'
require_dependency 'upload_creator'
diff --git a/app/jobs/regular/push_notification.rb b/app/jobs/regular/push_notification.rb
index 965acb963b3..3a16d626d63 100644
--- a/app/jobs/regular/push_notification.rb
+++ b/app/jobs/regular/push_notification.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class PushNotification < Jobs::Base
def execute(args)
diff --git a/app/jobs/regular/rebake_custom_emoji_posts.rb b/app/jobs/regular/rebake_custom_emoji_posts.rb
index e580601eea6..dbf8fdfbca4 100644
--- a/app/jobs/regular/rebake_custom_emoji_posts.rb
+++ b/app/jobs/regular/rebake_custom_emoji_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class RebakeCustomEmojiPosts < Jobs::Base
def execute(args)
diff --git a/app/jobs/regular/retrieve_topic.rb b/app/jobs/regular/retrieve_topic.rb
index 9d5d4e248cf..5c41ebf866f 100644
--- a/app/jobs/regular/retrieve_topic.rb
+++ b/app/jobs/regular/retrieve_topic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/sender'
require_dependency 'topic_retriever'
diff --git a/app/jobs/regular/run_heartbeat.rb b/app/jobs/regular/run_heartbeat.rb
index 226ac1934d5..364343d0434 100644
--- a/app/jobs/regular/run_heartbeat.rb
+++ b/app/jobs/regular/run_heartbeat.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class RunHeartbeat < Jobs::Base
diff --git a/app/jobs/regular/send_push_notification.rb b/app/jobs/regular/send_push_notification.rb
index 355e2465cbf..9eb072da767 100644
--- a/app/jobs/regular/send_push_notification.rb
+++ b/app/jobs/regular/send_push_notification.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class SendPushNotification < Jobs::Base
def execute(args)
diff --git a/app/jobs/regular/send_system_message.rb b/app/jobs/regular/send_system_message.rb
index 3eb9f002d7f..80fbc4e7e8b 100644
--- a/app/jobs/regular/send_system_message.rb
+++ b/app/jobs/regular/send_system_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'image_sizer'
require_dependency 'system_message'
diff --git a/app/jobs/regular/suspicious_login.rb b/app/jobs/regular/suspicious_login.rb
index ac4b6a8df7c..a2f15d32bcc 100644
--- a/app/jobs/regular/suspicious_login.rb
+++ b/app/jobs/regular/suspicious_login.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class SuspiciousLogin < Jobs::Base
diff --git a/app/jobs/regular/toggle_topic_closed.rb b/app/jobs/regular/toggle_topic_closed.rb
index bb3412fc2d6..96e631d066b 100644
--- a/app/jobs/regular/toggle_topic_closed.rb
+++ b/app/jobs/regular/toggle_topic_closed.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ToggleTopicClosed < Jobs::Base
def execute(args)
diff --git a/app/jobs/regular/topic_action_converter.rb b/app/jobs/regular/topic_action_converter.rb
index eb7a43ab1be..d047bc83617 100644
--- a/app/jobs/regular/topic_action_converter.rb
+++ b/app/jobs/regular/topic_action_converter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Jobs::TopicActionConverter < Jobs::Base
# Re-creating all the user actions could be very slow, so let's do it in a job
diff --git a/app/jobs/regular/topic_reminder.rb b/app/jobs/regular/topic_reminder.rb
index d2d1460a48e..5b63e11fd4d 100644
--- a/app/jobs/regular/topic_reminder.rb
+++ b/app/jobs/regular/topic_reminder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class TopicReminder < Jobs::Base
diff --git a/app/jobs/regular/truncate_user_flag_stats.rb b/app/jobs/regular/truncate_user_flag_stats.rb
index 9de009a7524..30dae8695af 100644
--- a/app/jobs/regular/truncate_user_flag_stats.rb
+++ b/app/jobs/regular/truncate_user_flag_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Jobs::TruncateUserFlagStats < Jobs::Base
def self.truncate_to
diff --git a/app/jobs/regular/unpin_topic.rb b/app/jobs/regular/unpin_topic.rb
index ff894ca6bc9..8dc0fe439b6 100644
--- a/app/jobs/regular/unpin_topic.rb
+++ b/app/jobs/regular/unpin_topic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class UnpinTopic < Jobs::Base
diff --git a/app/jobs/regular/update_gravatar.rb b/app/jobs/regular/update_gravatar.rb
index e993c0b3a7d..795018c57fd 100644
--- a/app/jobs/regular/update_gravatar.rb
+++ b/app/jobs/regular/update_gravatar.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class UpdateGravatar < Jobs::Base
diff --git a/app/jobs/regular/update_group_mentions.rb b/app/jobs/regular/update_group_mentions.rb
index 67ea356d3b0..a26151b0733 100644
--- a/app/jobs/regular/update_group_mentions.rb
+++ b/app/jobs/regular/update_group_mentions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class UpdateGroupMentions < Jobs::Base
diff --git a/app/jobs/regular/update_s3_inventory.rb b/app/jobs/regular/update_s3_inventory.rb
index 3791ad3f4c6..dae3b06a564 100644
--- a/app/jobs/regular/update_s3_inventory.rb
+++ b/app/jobs/regular/update_s3_inventory.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "s3_inventory"
module Jobs
diff --git a/app/jobs/regular/update_top_redirection.rb b/app/jobs/regular/update_top_redirection.rb
index 592dc6b8402..706fc2e6976 100644
--- a/app/jobs/regular/update_top_redirection.rb
+++ b/app/jobs/regular/update_top_redirection.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class UpdateTopRedirection < Jobs::Base
diff --git a/app/jobs/regular/update_username.rb b/app/jobs/regular/update_username.rb
index 150dec13554..6fdf60fa171 100644
--- a/app/jobs/regular/update_username.rb
+++ b/app/jobs/regular/update_username.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class UpdateUsername < Jobs::Base
diff --git a/app/jobs/regular/user_email.rb b/app/jobs/regular/user_email.rb
index 36eae216070..3c36f329c65 100644
--- a/app/jobs/regular/user_email.rb
+++ b/app/jobs/regular/user_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/sender'
require_dependency 'user_notifications'
diff --git a/app/jobs/scheduled/about_stats.rb b/app/jobs/scheduled/about_stats.rb
index 1ae2a0866ad..998acf1db5f 100644
--- a/app/jobs/scheduled/about_stats.rb
+++ b/app/jobs/scheduled/about_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class AboutStats < Jobs::Scheduled
every 30.minutes
diff --git a/app/jobs/scheduled/activation_reminder_emails.rb b/app/jobs/scheduled/activation_reminder_emails.rb
index b9f6c2e1935..5151bec7801 100644
--- a/app/jobs/scheduled/activation_reminder_emails.rb
+++ b/app/jobs/scheduled/activation_reminder_emails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ActivationReminderEmails < Jobs::Scheduled
every 2.hours
diff --git a/app/jobs/scheduled/auto_expire_user_api_keys.rb b/app/jobs/scheduled/auto_expire_user_api_keys.rb
index 23d5275644f..7217608ef45 100644
--- a/app/jobs/scheduled/auto_expire_user_api_keys.rb
+++ b/app/jobs/scheduled/auto_expire_user_api_keys.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class AutoExpireUserApiKeys < Jobs::Scheduled
diff --git a/app/jobs/scheduled/auto_queue_handler.rb b/app/jobs/scheduled/auto_queue_handler.rb
index 78d8a8af957..bf498ad6456 100644
--- a/app/jobs/scheduled/auto_queue_handler.rb
+++ b/app/jobs/scheduled/auto_queue_handler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This job will automatically act on records that have gone unhandled on a
# queue for a long time.
module Jobs
diff --git a/app/jobs/scheduled/badge_grant.rb b/app/jobs/scheduled/badge_grant.rb
index a9d9b915a78..ccddc6d582c 100644
--- a/app/jobs/scheduled/badge_grant.rb
+++ b/app/jobs/scheduled/badge_grant.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class BadgeGrant < Jobs::Scheduled
diff --git a/app/jobs/scheduled/category_stats.rb b/app/jobs/scheduled/category_stats.rb
index 030e8eb21e9..44843a67e39 100644
--- a/app/jobs/scheduled/category_stats.rb
+++ b/app/jobs/scheduled/category_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CategoryStats < Jobs::Scheduled
diff --git a/app/jobs/scheduled/check_out_of_date_themes.rb b/app/jobs/scheduled/check_out_of_date_themes.rb
index 8bd992f6e89..31f8b1547af 100644
--- a/app/jobs/scheduled/check_out_of_date_themes.rb
+++ b/app/jobs/scheduled/check_out_of_date_themes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CheckOutOfDateThemes < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/clean_up_associated_accounts.rb b/app/jobs/scheduled/clean_up_associated_accounts.rb
index 2d589cbcb38..0d009d2feef 100644
--- a/app/jobs/scheduled/clean_up_associated_accounts.rb
+++ b/app/jobs/scheduled/clean_up_associated_accounts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpAssociatedAccounts < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_crawler_stats.rb b/app/jobs/scheduled/clean_up_crawler_stats.rb
index 5fbf5d548a3..40dc386f8da 100644
--- a/app/jobs/scheduled/clean_up_crawler_stats.rb
+++ b/app/jobs/scheduled/clean_up_crawler_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpCrawlerStats < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_deprecated_url_site_settings.rb b/app/jobs/scheduled/clean_up_deprecated_url_site_settings.rb
index 47b62d62850..b7c4fc212d9 100644
--- a/app/jobs/scheduled/clean_up_deprecated_url_site_settings.rb
+++ b/app/jobs/scheduled/clean_up_deprecated_url_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpDeprecatedUrlSiteSettings < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/clean_up_email_logs.rb b/app/jobs/scheduled/clean_up_email_logs.rb
index b4e0fafa262..083f9b8b36f 100644
--- a/app/jobs/scheduled/clean_up_email_logs.rb
+++ b/app/jobs/scheduled/clean_up_email_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpEmailLogs < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_exports.rb b/app/jobs/scheduled/clean_up_exports.rb
index 667d165bfab..8352aa105a6 100644
--- a/app/jobs/scheduled/clean_up_exports.rb
+++ b/app/jobs/scheduled/clean_up_exports.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpExports < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/clean_up_inactive_users.rb b/app/jobs/scheduled/clean_up_inactive_users.rb
index bc2a306a947..f42fdc49671 100644
--- a/app/jobs/scheduled/clean_up_inactive_users.rb
+++ b/app/jobs/scheduled/clean_up_inactive_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpInactiveUsers < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_post_reply_keys.rb b/app/jobs/scheduled/clean_up_post_reply_keys.rb
index e308b079e95..a520061ebd5 100644
--- a/app/jobs/scheduled/clean_up_post_reply_keys.rb
+++ b/app/jobs/scheduled/clean_up_post_reply_keys.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpPostReplyKeys < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/clean_up_search_logs.rb b/app/jobs/scheduled/clean_up_search_logs.rb
index bd3bc2e04af..0f047641971 100644
--- a/app/jobs/scheduled/clean_up_search_logs.rb
+++ b/app/jobs/scheduled/clean_up_search_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpSearchLogs < Jobs::Scheduled
every 1.week
diff --git a/app/jobs/scheduled/clean_up_unmatched_emails.rb b/app/jobs/scheduled/clean_up_unmatched_emails.rb
index 4fff997ef81..6ce52992550 100644
--- a/app/jobs/scheduled/clean_up_unmatched_emails.rb
+++ b/app/jobs/scheduled/clean_up_unmatched_emails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpUnmatchedEmails < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_unmatched_ips.rb b/app/jobs/scheduled/clean_up_unmatched_ips.rb
index a9b4e4d5d33..f535f5b4509 100644
--- a/app/jobs/scheduled/clean_up_unmatched_ips.rb
+++ b/app/jobs/scheduled/clean_up_unmatched_ips.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpUnmatchedIPs < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_unsubscribe_keys.rb b/app/jobs/scheduled/clean_up_unsubscribe_keys.rb
index 606a13390ba..70f6b994736 100644
--- a/app/jobs/scheduled/clean_up_unsubscribe_keys.rb
+++ b/app/jobs/scheduled/clean_up_unsubscribe_keys.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpUnsubscribeKeys < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_unused_staged_users.rb b/app/jobs/scheduled/clean_up_unused_staged_users.rb
index ad4f1b20d40..292327a8b64 100644
--- a/app/jobs/scheduled/clean_up_unused_staged_users.rb
+++ b/app/jobs/scheduled/clean_up_unused_staged_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpUnusedStagedUsers < Jobs::Scheduled
diff --git a/app/jobs/scheduled/clean_up_uploads.rb b/app/jobs/scheduled/clean_up_uploads.rb
index 2367ae5e8a8..a6ff2e3a6b8 100644
--- a/app/jobs/scheduled/clean_up_uploads.rb
+++ b/app/jobs/scheduled/clean_up_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CleanUpUploads < Jobs::Scheduled
every 1.hour
diff --git a/app/jobs/scheduled/create_missing_avatars.rb b/app/jobs/scheduled/create_missing_avatars.rb
index d973e9a0be0..42e5365d41e 100644
--- a/app/jobs/scheduled/create_missing_avatars.rb
+++ b/app/jobs/scheduled/create_missing_avatars.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class CreateMissingAvatars < Jobs::Scheduled
every 1.hour
diff --git a/app/jobs/scheduled/dashboard_stats.rb b/app/jobs/scheduled/dashboard_stats.rb
index 905795d921c..26cc43afff5 100644
--- a/app/jobs/scheduled/dashboard_stats.rb
+++ b/app/jobs/scheduled/dashboard_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'admin_dashboard_data'
require_dependency 'group'
require_dependency 'group_message'
diff --git a/app/jobs/scheduled/destroy_old_deletion_stubs.rb b/app/jobs/scheduled/destroy_old_deletion_stubs.rb
index 49bf17075c2..8624b7ea48f 100644
--- a/app/jobs/scheduled/destroy_old_deletion_stubs.rb
+++ b/app/jobs/scheduled/destroy_old_deletion_stubs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
# various consistency checks
class DestroyOldDeletionStubs < Jobs::Scheduled
diff --git a/app/jobs/scheduled/destroy_old_hidden_posts.rb b/app/jobs/scheduled/destroy_old_hidden_posts.rb
index 8cb291d9ed5..ee7819240c5 100644
--- a/app/jobs/scheduled/destroy_old_hidden_posts.rb
+++ b/app/jobs/scheduled/destroy_old_hidden_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DestroyOldHiddenPosts < Jobs::Scheduled
diff --git a/app/jobs/scheduled/directory_refresh_daily.rb b/app/jobs/scheduled/directory_refresh_daily.rb
index ea28067454f..90311bbad24 100644
--- a/app/jobs/scheduled/directory_refresh_daily.rb
+++ b/app/jobs/scheduled/directory_refresh_daily.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DirectoryRefreshDaily < Jobs::Scheduled
every 1.hour
diff --git a/app/jobs/scheduled/directory_refresh_older.rb b/app/jobs/scheduled/directory_refresh_older.rb
index 93147d6c88a..523be14b2f4 100644
--- a/app/jobs/scheduled/directory_refresh_older.rb
+++ b/app/jobs/scheduled/directory_refresh_older.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DirectoryRefreshOlder < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/disable_bootstrap_mode.rb b/app/jobs/scheduled/disable_bootstrap_mode.rb
index 139e5721712..e41cf8577b5 100644
--- a/app/jobs/scheduled/disable_bootstrap_mode.rb
+++ b/app/jobs/scheduled/disable_bootstrap_mode.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DisableBootstrapMode < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/enqueue_digest_emails.rb b/app/jobs/scheduled/enqueue_digest_emails.rb
index 98a78878941..e8db948ca60 100644
--- a/app/jobs/scheduled/enqueue_digest_emails.rb
+++ b/app/jobs/scheduled/enqueue_digest_emails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class EnqueueDigestEmails < Jobs::Scheduled
diff --git a/app/jobs/scheduled/enqueue_onceoffs.rb b/app/jobs/scheduled/enqueue_onceoffs.rb
index 9afd19d1199..d529fad0625 100644
--- a/app/jobs/scheduled/enqueue_onceoffs.rb
+++ b/app/jobs/scheduled/enqueue_onceoffs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class EnqueueOnceoffs < Jobs::Scheduled
diff --git a/app/jobs/scheduled/ensure_db_consistency.rb b/app/jobs/scheduled/ensure_db_consistency.rb
index 4f0b6d6ce0b..de9f4e8cb67 100644
--- a/app/jobs/scheduled/ensure_db_consistency.rb
+++ b/app/jobs/scheduled/ensure_db_consistency.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
# various consistency checks
class EnsureDbConsistency < Jobs::Scheduled
diff --git a/app/jobs/scheduled/fix_user_usernames_and_groups_names_clash.rb b/app/jobs/scheduled/fix_user_usernames_and_groups_names_clash.rb
index 3ed7469db07..4158e2e7a23 100644
--- a/app/jobs/scheduled/fix_user_usernames_and_groups_names_clash.rb
+++ b/app/jobs/scheduled/fix_user_usernames_and_groups_names_clash.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class FixUserUsernamesAndGroupNamesClash < Jobs::Scheduled
every 1.week
diff --git a/app/jobs/scheduled/grant_anniversary_badges.rb b/app/jobs/scheduled/grant_anniversary_badges.rb
index 91094a192ea..a091c3032b6 100644
--- a/app/jobs/scheduled/grant_anniversary_badges.rb
+++ b/app/jobs/scheduled/grant_anniversary_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class GrantAnniversaryBadges < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb b/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb
index a14db0bbadc..fe550071954 100644
--- a/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb
+++ b/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'badge_granter'
module Jobs
diff --git a/app/jobs/scheduled/heartbeat.rb b/app/jobs/scheduled/heartbeat.rb
index 101a082ef77..c1b8a8cb24c 100644
--- a/app/jobs/scheduled/heartbeat.rb
+++ b/app/jobs/scheduled/heartbeat.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
# used to ensure at least 1 sidekiq is running correctly
diff --git a/app/jobs/scheduled/ignored_users_summary.rb b/app/jobs/scheduled/ignored_users_summary.rb
index b050d9b5f4c..c84122e0a2f 100644
--- a/app/jobs/scheduled/ignored_users_summary.rb
+++ b/app/jobs/scheduled/ignored_users_summary.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class IgnoredUsersSummary < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/invalidate_inactive_admins.rb b/app/jobs/scheduled/invalidate_inactive_admins.rb
index 78b73f7b7ac..fbe8929d045 100644
--- a/app/jobs/scheduled/invalidate_inactive_admins.rb
+++ b/app/jobs/scheduled/invalidate_inactive_admins.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class InvalidateInactiveAdmins < Jobs::Scheduled
diff --git a/app/jobs/scheduled/migrate_upload_scheme.rb b/app/jobs/scheduled/migrate_upload_scheme.rb
index 5516c710452..6d4683ccd5e 100644
--- a/app/jobs/scheduled/migrate_upload_scheme.rb
+++ b/app/jobs/scheduled/migrate_upload_scheme.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class MigrateUploadScheme < Jobs::Scheduled
diff --git a/app/jobs/scheduled/pending_queued_posts_reminder.rb b/app/jobs/scheduled/pending_queued_posts_reminder.rb
index 01e2156b50a..f0d36088892 100644
--- a/app/jobs/scheduled/pending_queued_posts_reminder.rb
+++ b/app/jobs/scheduled/pending_queued_posts_reminder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class PendingQueuedPostReminder < Jobs::Scheduled
diff --git a/app/jobs/scheduled/pending_reviewables_reminder.rb b/app/jobs/scheduled/pending_reviewables_reminder.rb
index 30a3ec7039b..a0b4c6597cc 100644
--- a/app/jobs/scheduled/pending_reviewables_reminder.rb
+++ b/app/jobs/scheduled/pending_reviewables_reminder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'flag_query'
module Jobs
diff --git a/app/jobs/scheduled/pending_users_reminder.rb b/app/jobs/scheduled/pending_users_reminder.rb
index 85bedc6781c..bf11df2900f 100644
--- a/app/jobs/scheduled/pending_users_reminder.rb
+++ b/app/jobs/scheduled/pending_users_reminder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'admin_user_index_query'
module Jobs
diff --git a/app/jobs/scheduled/periodical_updates.rb b/app/jobs/scheduled/periodical_updates.rb
index d607b96cd92..12c1414ef4b 100644
--- a/app/jobs/scheduled/periodical_updates.rb
+++ b/app/jobs/scheduled/periodical_updates.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'score_calculator'
module Jobs
diff --git a/app/jobs/scheduled/poll_feed.rb b/app/jobs/scheduled/poll_feed.rb
index 7567660a42d..54f47578b39 100644
--- a/app/jobs/scheduled/poll_feed.rb
+++ b/app/jobs/scheduled/poll_feed.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# Creates and Updates Topics based on an RSS or ATOM feed.
#
diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb
index d232f87c3de..9bf10f93c0e 100644
--- a/app/jobs/scheduled/poll_mailbox.rb
+++ b/app/jobs/scheduled/poll_mailbox.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'net/pop'
require_dependency 'email/receiver'
require_dependency 'email/processor'
diff --git a/app/jobs/scheduled/process_badge_backlog.rb b/app/jobs/scheduled/process_badge_backlog.rb
index 231c318829f..370165d4b21 100644
--- a/app/jobs/scheduled/process_badge_backlog.rb
+++ b/app/jobs/scheduled/process_badge_backlog.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ProcessBadgeBacklog < Jobs::Scheduled
every 1.minute
diff --git a/app/jobs/scheduled/purge_deleted_uploads.rb b/app/jobs/scheduled/purge_deleted_uploads.rb
index 312bce12853..56497f1ab5a 100644
--- a/app/jobs/scheduled/purge_deleted_uploads.rb
+++ b/app/jobs/scheduled/purge_deleted_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class PurgeDeletedUploads < Jobs::Scheduled
diff --git a/app/jobs/scheduled/purge_expired_ignored_users.rb b/app/jobs/scheduled/purge_expired_ignored_users.rb
index 06e872e21c6..abf360b66ac 100644
--- a/app/jobs/scheduled/purge_expired_ignored_users.rb
+++ b/app/jobs/scheduled/purge_expired_ignored_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class PurgeExpiredIgnoredUsers < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/purge_old_web_hook_events.rb b/app/jobs/scheduled/purge_old_web_hook_events.rb
index 4bb8c5b7ba8..53704bcaac4 100644
--- a/app/jobs/scheduled/purge_old_web_hook_events.rb
+++ b/app/jobs/scheduled/purge_old_web_hook_events.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class PurgeOldWebHookEvents < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/purge_unactivated.rb b/app/jobs/scheduled/purge_unactivated.rb
index 98798720552..c693822e3b2 100644
--- a/app/jobs/scheduled/purge_unactivated.rb
+++ b/app/jobs/scheduled/purge_unactivated.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class PurgeUnactivated < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/reindex_search.rb b/app/jobs/scheduled/reindex_search.rb
index 802379dff06..90f6a340f6d 100644
--- a/app/jobs/scheduled/reindex_search.rb
+++ b/app/jobs/scheduled/reindex_search.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
# if locale changes or search algorithm changes we may want to reindex stuff
class ReindexSearch < Jobs::Scheduled
diff --git a/app/jobs/scheduled/schedule_backup.rb b/app/jobs/scheduled/schedule_backup.rb
index b2e9129811a..a33cf3c34c5 100644
--- a/app/jobs/scheduled/schedule_backup.rb
+++ b/app/jobs/scheduled/schedule_backup.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Jobs
class ScheduleBackup < Jobs::Scheduled
diff --git a/app/jobs/scheduled/tl3_promotions.rb b/app/jobs/scheduled/tl3_promotions.rb
index f494638da10..2bd9613c595 100644
--- a/app/jobs/scheduled/tl3_promotions.rb
+++ b/app/jobs/scheduled/tl3_promotions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class Tl3Promotions < Jobs::Scheduled
diff --git a/app/jobs/scheduled/top_refresh_older.rb b/app/jobs/scheduled/top_refresh_older.rb
index 4a2c7471262..e24ec875877 100644
--- a/app/jobs/scheduled/top_refresh_older.rb
+++ b/app/jobs/scheduled/top_refresh_older.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class TopRefreshOlder < Jobs::Scheduled
every 1.day
diff --git a/app/jobs/scheduled/top_refresh_today.rb b/app/jobs/scheduled/top_refresh_today.rb
index a941a9302ef..4259a95241b 100644
--- a/app/jobs/scheduled/top_refresh_today.rb
+++ b/app/jobs/scheduled/top_refresh_today.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class TopRefreshToday < Jobs::Scheduled
every 1.hour
diff --git a/app/jobs/scheduled/unsilence_users.rb b/app/jobs/scheduled/unsilence_users.rb
index c609894fd52..94c343f4c21 100644
--- a/app/jobs/scheduled/unsilence_users.rb
+++ b/app/jobs/scheduled/unsilence_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class UnsilenceUsers < Jobs::Scheduled
every 15.minutes
diff --git a/app/jobs/scheduled/version_check.rb b/app/jobs/scheduled/version_check.rb
index 51b08d379d9..c52bb97d4bd 100644
--- a/app/jobs/scheduled/version_check.rb
+++ b/app/jobs/scheduled/version_check.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse_hub'
require_dependency 'discourse_updates'
diff --git a/app/jobs/scheduled/weekly.rb b/app/jobs/scheduled/weekly.rb
index d76b9f32f92..52905e2bf3f 100644
--- a/app/jobs/scheduled/weekly.rb
+++ b/app/jobs/scheduled/weekly.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'score_calculator'
module Jobs
diff --git a/app/mailers/admin_confirmation_mailer.rb b/app/mailers/admin_confirmation_mailer.rb
index 4f7679d4bf3..a546db497b5 100644
--- a/app/mailers/admin_confirmation_mailer.rb
+++ b/app/mailers/admin_confirmation_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/message_builder'
class AdminConfirmationMailer < ActionMailer::Base
diff --git a/app/mailers/download_backup_mailer.rb b/app/mailers/download_backup_mailer.rb
index 1eb47e7222c..fe291f0614b 100644
--- a/app/mailers/download_backup_mailer.rb
+++ b/app/mailers/download_backup_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/message_builder'
class DownloadBackupMailer < ActionMailer::Base
diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb
index df371b79a30..79157dc23e5 100644
--- a/app/mailers/invite_mailer.rb
+++ b/app/mailers/invite_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/message_builder'
class InviteMailer < ActionMailer::Base
diff --git a/app/mailers/rejection_mailer.rb b/app/mailers/rejection_mailer.rb
index 2821f9abf6a..f91b98c4d8a 100644
--- a/app/mailers/rejection_mailer.rb
+++ b/app/mailers/rejection_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/message_builder'
class RejectionMailer < ActionMailer::Base
diff --git a/app/mailers/subscription_mailer.rb b/app/mailers/subscription_mailer.rb
index d8ea40d2fb7..0b13cb6a51e 100644
--- a/app/mailers/subscription_mailer.rb
+++ b/app/mailers/subscription_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/message_builder'
class SubscriptionMailer < ActionMailer::Base
diff --git a/app/mailers/test_mailer.rb b/app/mailers/test_mailer.rb
index 1b16c4dc117..a9eba9e9e52 100644
--- a/app/mailers/test_mailer.rb
+++ b/app/mailers/test_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/message_builder'
class TestMailer < ActionMailer::Base
diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb
index 53392ccd757..9bd1e16901d 100644
--- a/app/mailers/user_notifications.rb
+++ b/app/mailers/user_notifications.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'markdown_linker'
require_dependency 'email/message_builder'
require_dependency 'age_words'
@@ -472,7 +474,7 @@ class UserNotifications < ActionMailer::Base
group_name = opts[:group_name]
locale = user_locale(user)
- template = "user_notifications.user_#{notification_type}"
+ template = +"user_notifications.user_#{notification_type}"
if post.topic.private_message?
template << "_pm"
@@ -561,7 +563,7 @@ class UserNotifications < ActionMailer::Base
).exists?
if opts[:use_invite_template]
- invite_template = "user_notifications.invited"
+ invite_template = +"user_notifications.invited"
invite_template << "_group" if group_name
invite_template <<
diff --git a/app/mailers/version_mailer.rb b/app/mailers/version_mailer.rb
index dad4dbd448c..4c12dffc173 100644
--- a/app/mailers/version_mailer.rb
+++ b/app/mailers/version_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/message_builder'
class VersionMailer < ActionMailer::Base
diff --git a/app/models/about.rb b/app/models/about.rb
index 126eeadcefd..783c6829b4d 100644
--- a/app/models/about.rb
+++ b/app/models/about.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class About
include ActiveModel::Serialization
include StatsCacheable
diff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rb
index a5926a2c9f9..0d260816280 100644
--- a/app/models/admin_dashboard_data.rb
+++ b/app/models/admin_dashboard_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'mem_info'
class AdminDashboardData
diff --git a/app/models/admin_dashboard_general_data.rb b/app/models/admin_dashboard_general_data.rb
index a54a17cd612..915ddd1a38a 100644
--- a/app/models/admin_dashboard_general_data.rb
+++ b/app/models/admin_dashboard_general_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminDashboardGeneralData < AdminDashboardData
def get_json
{
diff --git a/app/models/admin_dashboard_index_data.rb b/app/models/admin_dashboard_index_data.rb
index 4d2bfddba37..92da9f0087d 100644
--- a/app/models/admin_dashboard_index_data.rb
+++ b/app/models/admin_dashboard_index_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminDashboardIndexData < AdminDashboardData
def get_json
{
diff --git a/app/models/api_key.rb b/app/models/api_key.rb
index b3a8a68bf02..f6a48199ed2 100644
--- a/app/models/api_key.rb
+++ b/app/models/api_key.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ApiKey < ActiveRecord::Base
belongs_to :user
belongs_to :created_by, class_name: 'User'
diff --git a/app/models/auto_track_duration_site_setting.rb b/app/models/auto_track_duration_site_setting.rb
index b40ff6e0eb7..3659d81ce61 100644
--- a/app/models/auto_track_duration_site_setting.rb
+++ b/app/models/auto_track_duration_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class AutoTrackDurationSiteSetting < EnumSiteSetting
diff --git a/app/models/backup_file.rb b/app/models/backup_file.rb
index 86482f687d5..a8a09731a11 100644
--- a/app/models/backup_file.rb
+++ b/app/models/backup_file.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BackupFile
include ActiveModel::SerializerSupport
diff --git a/app/models/badge.rb b/app/models/badge.rb
index 33b5426edfa..561b562583f 100644
--- a/app/models/badge.rb
+++ b/app/models/badge.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'slug'
class Badge < ActiveRecord::Base
diff --git a/app/models/badge_grouping.rb b/app/models/badge_grouping.rb
index 4fdcef66e3a..b95c78f1c4e 100644
--- a/app/models/badge_grouping.rb
+++ b/app/models/badge_grouping.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgeGrouping < ActiveRecord::Base
GettingStarted = 1
diff --git a/app/models/badge_type.rb b/app/models/badge_type.rb
index b1d6e91edd9..80ae709f58e 100644
--- a/app/models/badge_type.rb
+++ b/app/models/badge_type.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgeType < ActiveRecord::Base
Gold = 1
Silver = 2
diff --git a/app/models/category_and_topic_lists.rb b/app/models/category_and_topic_lists.rb
index 60b8293cffb..ac4b9d6f0a7 100644
--- a/app/models/category_and_topic_lists.rb
+++ b/app/models/category_and_topic_lists.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryAndTopicLists
include ActiveModel::Serialization
diff --git a/app/models/category_custom_field.rb b/app/models/category_custom_field.rb
index 289846a6b95..988d00e9108 100644
--- a/app/models/category_custom_field.rb
+++ b/app/models/category_custom_field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryCustomField < ActiveRecord::Base
belongs_to :category
end
diff --git a/app/models/category_featured_topic.rb b/app/models/category_featured_topic.rb
index aef63075fad..9ffb283b18f 100644
--- a/app/models/category_featured_topic.rb
+++ b/app/models/category_featured_topic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryFeaturedTopic < ActiveRecord::Base
belongs_to :category
belongs_to :topic
diff --git a/app/models/category_group.rb b/app/models/category_group.rb
index ca7a8ec8500..a0cbb3f31e8 100644
--- a/app/models/category_group.rb
+++ b/app/models/category_group.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryGroup < ActiveRecord::Base
belongs_to :category
belongs_to :group
diff --git a/app/models/category_list.rb b/app/models/category_list.rb
index 5bb50132ad8..2d8bfb3d740 100644
--- a/app/models/category_list.rb
+++ b/app/models/category_list.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'pinned_check'
class CategoryList
diff --git a/app/models/category_page_style.rb b/app/models/category_page_style.rb
index c2bfc7bdaec..d1598380909 100644
--- a/app/models/category_page_style.rb
+++ b/app/models/category_page_style.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "enum_site_setting"
class CategoryPageStyle < EnumSiteSetting
diff --git a/app/models/category_search_data.rb b/app/models/category_search_data.rb
index bb2286ac0ca..60be25ddca8 100644
--- a/app/models/category_search_data.rb
+++ b/app/models/category_search_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategorySearchData < ActiveRecord::Base
include HasSearchData
end
diff --git a/app/models/category_tag.rb b/app/models/category_tag.rb
index 507d13e3845..1e21409c31d 100644
--- a/app/models/category_tag.rb
+++ b/app/models/category_tag.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryTag < ActiveRecord::Base
belongs_to :category
belongs_to :tag
diff --git a/app/models/category_tag_group.rb b/app/models/category_tag_group.rb
index c262539b961..06e64ad65ff 100644
--- a/app/models/category_tag_group.rb
+++ b/app/models/category_tag_group.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryTagGroup < ActiveRecord::Base
belongs_to :category
belongs_to :tag_group
diff --git a/app/models/category_tag_stat.rb b/app/models/category_tag_stat.rb
index f16e37e41cb..5f2b1410a1c 100644
--- a/app/models/category_tag_stat.rb
+++ b/app/models/category_tag_stat.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryTagStat < ActiveRecord::Base
belongs_to :category
belongs_to :tag
diff --git a/app/models/category_user.rb b/app/models/category_user.rb
index 5a87b68fe0e..974f09e8bfd 100644
--- a/app/models/category_user.rb
+++ b/app/models/category_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'notification_levels'
class CategoryUser < ActiveRecord::Base
diff --git a/app/models/child_theme.rb b/app/models/child_theme.rb
index c281f87f061..7ce4d0dc78b 100644
--- a/app/models/child_theme.rb
+++ b/app/models/child_theme.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ChildTheme < ActiveRecord::Base
belongs_to :parent_theme, class_name: 'Theme'
belongs_to :child_theme, class_name: 'Theme'
diff --git a/app/models/color_scheme_color.rb b/app/models/color_scheme_color.rb
index 51e0c4ae8d0..2822859b65b 100644
--- a/app/models/color_scheme_color.rb
+++ b/app/models/color_scheme_color.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ColorSchemeColor < ActiveRecord::Base
belongs_to :color_scheme
diff --git a/app/models/concerns/anon_cache_invalidator.rb b/app/models/concerns/anon_cache_invalidator.rb
index ac37eb69450..f87cada6c0e 100644
--- a/app/models/concerns/anon_cache_invalidator.rb
+++ b/app/models/concerns/anon_cache_invalidator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module AnonCacheInvalidator
extend ActiveSupport::Concern
diff --git a/app/models/concerns/cached_counting.rb b/app/models/concerns/cached_counting.rb
index 867c8fb250e..3c3b09cd407 100644
--- a/app/models/concerns/cached_counting.rb
+++ b/app/models/concerns/cached_counting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module CachedCounting
extend ActiveSupport::Concern
diff --git a/app/models/concerns/category_hashtag.rb b/app/models/concerns/category_hashtag.rb
index 8f2d807fbdc..8e61329b93e 100644
--- a/app/models/concerns/category_hashtag.rb
+++ b/app/models/concerns/category_hashtag.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module CategoryHashtag
extend ActiveSupport::Concern
diff --git a/app/models/concerns/has_custom_fields.rb b/app/models/concerns/has_custom_fields.rb
index d10f180d907..fb7ad83126a 100644
--- a/app/models/concerns/has_custom_fields.rb
+++ b/app/models/concerns/has_custom_fields.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module HasCustomFields
extend ActiveSupport::Concern
diff --git a/app/models/concerns/has_destroyed_web_hook.rb b/app/models/concerns/has_destroyed_web_hook.rb
index 233a80802ca..0b05f437a1c 100644
--- a/app/models/concerns/has_destroyed_web_hook.rb
+++ b/app/models/concerns/has_destroyed_web_hook.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module HasDestroyedWebHook
extend ActiveSupport::Concern
diff --git a/app/models/concerns/has_search_data.rb b/app/models/concerns/has_search_data.rb
index d93a73b900b..e997083019e 100644
--- a/app/models/concerns/has_search_data.rb
+++ b/app/models/concerns/has_search_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module HasSearchData
extend ActiveSupport::Concern
diff --git a/app/models/concerns/has_url.rb b/app/models/concerns/has_url.rb
index 7fcf82f785e..4e38d755f0e 100644
--- a/app/models/concerns/has_url.rb
+++ b/app/models/concerns/has_url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module HasUrl
extend ActiveSupport::Concern
diff --git a/app/models/concerns/limited_edit.rb b/app/models/concerns/limited_edit.rb
index 8e91315bd12..cbe15543870 100644
--- a/app/models/concerns/limited_edit.rb
+++ b/app/models/concerns/limited_edit.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module LimitedEdit
extend ActiveSupport::Concern
diff --git a/app/models/concerns/positionable.rb b/app/models/concerns/positionable.rb
index 0860d60f92f..d353e306375 100644
--- a/app/models/concerns/positionable.rb
+++ b/app/models/concerns/positionable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Positionable
extend ActiveSupport::Concern
diff --git a/app/models/concerns/roleable.rb b/app/models/concerns/roleable.rb
index 51c50dc49c7..86598092264 100644
--- a/app/models/concerns/roleable.rb
+++ b/app/models/concerns/roleable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Roleable
extend ActiveSupport::Concern
diff --git a/app/models/concerns/searchable.rb b/app/models/concerns/searchable.rb
index 09fc8f2a4e0..ed01ecff8e9 100644
--- a/app/models/concerns/searchable.rb
+++ b/app/models/concerns/searchable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Searchable
extend ActiveSupport::Concern
diff --git a/app/models/concerns/second_factor_manager.rb b/app/models/concerns/second_factor_manager.rb
index 67e160d7949..1d88fa9b2fe 100644
--- a/app/models/concerns/second_factor_manager.rb
+++ b/app/models/concerns/second_factor_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SecondFactorManager
extend ActiveSupport::Concern
diff --git a/app/models/concerns/stats_cacheable.rb b/app/models/concerns/stats_cacheable.rb
index 150c2a7b205..22968ab31a9 100644
--- a/app/models/concerns/stats_cacheable.rb
+++ b/app/models/concerns/stats_cacheable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module StatsCacheable
extend ActiveSupport::Concern
diff --git a/app/models/concerns/trashable.rb b/app/models/concerns/trashable.rb
index 0aa7bed3c24..1caf0de7659 100644
--- a/app/models/concerns/trashable.rb
+++ b/app/models/concerns/trashable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Trashable
extend ActiveSupport::Concern
diff --git a/app/models/custom_emoji.rb b/app/models/custom_emoji.rb
index aa9f4b0e7af..8a9d3c9236a 100644
--- a/app/models/custom_emoji.rb
+++ b/app/models/custom_emoji.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CustomEmoji < ActiveRecord::Base
belongs_to :upload
diff --git a/app/models/developer.rb b/app/models/developer.rb
index aba24eb5d5f..db0958303a5 100644
--- a/app/models/developer.rb
+++ b/app/models/developer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'distributed_cache'
class Developer < ActiveRecord::Base
diff --git a/app/models/digest_email_site_setting.rb b/app/models/digest_email_site_setting.rb
index e2dee400920..d0cc1be9138 100644
--- a/app/models/digest_email_site_setting.rb
+++ b/app/models/digest_email_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class DigestEmailSiteSetting < EnumSiteSetting
diff --git a/app/models/discourse_single_sign_on.rb b/app/models/discourse_single_sign_on.rb
index 00d4bad0495..e0cdd315674 100644
--- a/app/models/discourse_single_sign_on.rb
+++ b/app/models/discourse_single_sign_on.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'single_sign_on'
class DiscourseSingleSignOn < SingleSignOn
diff --git a/app/models/discourse_version_check.rb b/app/models/discourse_version_check.rb
index 084c8dc6da6..8a3b914bae9 100644
--- a/app/models/discourse_version_check.rb
+++ b/app/models/discourse_version_check.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiscourseVersionCheck
include ActiveModel::Model
diff --git a/app/models/draft_sequence.rb b/app/models/draft_sequence.rb
index 9629e8402c0..eeb5520fcc5 100644
--- a/app/models/draft_sequence.rb
+++ b/app/models/draft_sequence.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DraftSequence < ActiveRecord::Base
def self.next!(user, key)
user_id = user
diff --git a/app/models/email_change_request.rb b/app/models/email_change_request.rb
index 9778e84be3a..b9f9e7bfeba 100644
--- a/app/models/email_change_request.rb
+++ b/app/models/email_change_request.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email_validator'
class EmailChangeRequest < ActiveRecord::Base
diff --git a/app/models/email_level_site_setting.rb b/app/models/email_level_site_setting.rb
index 3e368736a2d..a3eccdf11c8 100644
--- a/app/models/email_level_site_setting.rb
+++ b/app/models/email_level_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class EmailLevelSiteSetting < EnumSiteSetting
diff --git a/app/models/email_log.rb b/app/models/email_log.rb
index 8ea894cc75c..26bc096ca10 100644
--- a/app/models/email_log.rb
+++ b/app/models/email_log.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'distributed_mutex'
class EmailLog < ActiveRecord::Base
diff --git a/app/models/email_token.rb b/app/models/email_token.rb
index 7d592b73626..673c88432a1 100644
--- a/app/models/email_token.rb
+++ b/app/models/email_token.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmailToken < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/embeddable_host.rb b/app/models/embeddable_host.rb
index 84ce201cea8..545eeba5f20 100644
--- a/app/models/embeddable_host.rb
+++ b/app/models/embeddable_host.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'url_helper'
class EmbeddableHost < ActiveRecord::Base
diff --git a/app/models/embedding.rb b/app/models/embedding.rb
index bba8538097f..3b67a418581 100644
--- a/app/models/embedding.rb
+++ b/app/models/embedding.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'has_errors'
class Embedding < OpenStruct
diff --git a/app/models/emoji.rb b/app/models/emoji.rb
index db3261aeda6..632dc45b0e7 100644
--- a/app/models/emoji.rb
+++ b/app/models/emoji.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Emoji
# update this to clear the cache
EMOJI_VERSION = "9"
diff --git a/app/models/emoji_set_site_setting.rb b/app/models/emoji_set_site_setting.rb
index fcc3759b0c2..8437e0a3076 100644
--- a/app/models/emoji_set_site_setting.rb
+++ b/app/models/emoji_set_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'enum_site_setting'
class EmojiSetSiteSetting < EnumSiteSetting
diff --git a/app/models/github_user_info.rb b/app/models/github_user_info.rb
index 8e776f33ab1..ca088c0cb14 100644
--- a/app/models/github_user_info.rb
+++ b/app/models/github_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GithubUserInfo < ActiveRecord::Base
belongs_to :user
end
diff --git a/app/models/given_daily_like.rb b/app/models/given_daily_like.rb
index ccc29742377..e5483ce3600 100644
--- a/app/models/given_daily_like.rb
+++ b/app/models/given_daily_like.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GivenDailyLike < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/global_setting.rb b/app/models/global_setting.rb
index a630b135785..da9e1f0d108 100644
--- a/app/models/global_setting.rb
+++ b/app/models/global_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GlobalSetting
def self.register(key, default)
@@ -225,7 +227,7 @@ class GlobalSetting
class EnvProvider < BaseProvider
def lookup(key, default)
- var = ENV["DISCOURSE_" << key.to_s.upcase]
+ var = ENV["DISCOURSE_" + key.to_s.upcase]
resolve(var , var.nil? ? default : nil)
end
diff --git a/app/models/group_archived_message.rb b/app/models/group_archived_message.rb
index 729ad8b82ad..1715a57585f 100644
--- a/app/models/group_archived_message.rb
+++ b/app/models/group_archived_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupArchivedMessage < ActiveRecord::Base
belongs_to :user
belongs_to :topic
diff --git a/app/models/group_custom_field.rb b/app/models/group_custom_field.rb
index 302f0493d17..6cc32953355 100644
--- a/app/models/group_custom_field.rb
+++ b/app/models/group_custom_field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupCustomField < ActiveRecord::Base
belongs_to :group
end
diff --git a/app/models/group_history.rb b/app/models/group_history.rb
index 338cf75575a..83583824a6c 100644
--- a/app/models/group_history.rb
+++ b/app/models/group_history.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupHistory < ActiveRecord::Base
belongs_to :group
belongs_to :acting_user, class_name: 'User'
diff --git a/app/models/group_manager.rb b/app/models/group_manager.rb
index 009f07446db..b8c94b4f4ff 100644
--- a/app/models/group_manager.rb
+++ b/app/models/group_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupManager < ActiveRecord::Base
belongs_to :group
belongs_to :manager, class_name: "User", foreign_key: :user_id
diff --git a/app/models/group_mention.rb b/app/models/group_mention.rb
index 3cef10dd735..9d4d4ddb0eb 100644
--- a/app/models/group_mention.rb
+++ b/app/models/group_mention.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupMention < ActiveRecord::Base
belongs_to :post
belongs_to :group
diff --git a/app/models/group_request.rb b/app/models/group_request.rb
index 57aafb41936..706fcceab97 100644
--- a/app/models/group_request.rb
+++ b/app/models/group_request.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupRequest < ActiveRecord::Base
belongs_to :group
belongs_to :user
diff --git a/app/models/group_user.rb b/app/models/group_user.rb
index 7d4a1c2610e..456cbfbc42b 100644
--- a/app/models/group_user.rb
+++ b/app/models/group_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'notification_levels'
class GroupUser < ActiveRecord::Base
diff --git a/app/models/ignored_user.rb b/app/models/ignored_user.rb
index a0810b03a28..e298fd316d6 100644
--- a/app/models/ignored_user.rb
+++ b/app/models/ignored_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IgnoredUser < ActiveRecord::Base
belongs_to :user
belongs_to :ignored_user, class_name: "User"
diff --git a/app/models/incoming_domain.rb b/app/models/incoming_domain.rb
index 07fac926d72..ced37023d7d 100644
--- a/app/models/incoming_domain.rb
+++ b/app/models/incoming_domain.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncomingDomain < ActiveRecord::Base
def self.add!(uri)
name = uri.host
diff --git a/app/models/incoming_email.rb b/app/models/incoming_email.rb
index e985deb2b1f..aa73e0e5ddd 100644
--- a/app/models/incoming_email.rb
+++ b/app/models/incoming_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncomingEmail < ActiveRecord::Base
belongs_to :user
belongs_to :topic
diff --git a/app/models/incoming_link.rb b/app/models/incoming_link.rb
index 8a852dd1cdc..d595eea04d0 100644
--- a/app/models/incoming_link.rb
+++ b/app/models/incoming_link.rb
@@ -80,7 +80,7 @@ class IncomingLink < ActiveRecord::Base
def referer
if self.incoming_referer
- self.incoming_referer.incoming_domain.to_url << self.incoming_referer.path
+ self.incoming_referer.incoming_domain.to_url + self.incoming_referer.path
end
end
diff --git a/app/models/incoming_links_report.rb b/app/models/incoming_links_report.rb
index a6de05f32af..d791a65903e 100644
--- a/app/models/incoming_links_report.rb
+++ b/app/models/incoming_links_report.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncomingLinksReport
attr_accessor :type, :data, :y_titles, :start_date, :end_date, :limit, :category_id
diff --git a/app/models/incoming_referer.rb b/app/models/incoming_referer.rb
index 343ac5cf655..f4f0f8dfcab 100644
--- a/app/models/incoming_referer.rb
+++ b/app/models/incoming_referer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncomingReferer < ActiveRecord::Base
belongs_to :incoming_domain
diff --git a/app/models/instagram_user_info.rb b/app/models/instagram_user_info.rb
index d2ac28ffcd4..404876aa2a3 100644
--- a/app/models/instagram_user_info.rb
+++ b/app/models/instagram_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class InstagramUserInfo < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/invite.rb b/app/models/invite.rb
index 837402633e7..fdd0f9ba8e9 100644
--- a/app/models/invite.rb
+++ b/app/models/invite.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'rate_limiter'
class Invite < ActiveRecord::Base
diff --git a/app/models/invite_redeemer.rb b/app/models/invite_redeemer.rb
index ce80b21bff9..97cd194208d 100644
--- a/app/models/invite_redeemer.rb
+++ b/app/models/invite_redeemer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
InviteRedeemer = Struct.new(:invite, :username, :name, :password, :user_custom_fields, :ip_address) do
def redeem
diff --git a/app/models/invited_group.rb b/app/models/invited_group.rb
index 79fcff8b416..063dbf4e209 100644
--- a/app/models/invited_group.rb
+++ b/app/models/invited_group.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class InvitedGroup < ActiveRecord::Base
belongs_to :group
belongs_to :invite
diff --git a/app/models/like_notification_frequency_site_setting.rb b/app/models/like_notification_frequency_site_setting.rb
index 33f009af576..80cdf1c8827 100644
--- a/app/models/like_notification_frequency_site_setting.rb
+++ b/app/models/like_notification_frequency_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class LikeNotificationFrequencySiteSetting < EnumSiteSetting
diff --git a/app/models/locale_site_setting.rb b/app/models/locale_site_setting.rb
index ae3c02d3ccd..5f3d7f1abe2 100644
--- a/app/models/locale_site_setting.rb
+++ b/app/models/locale_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class LocaleSiteSetting < EnumSiteSetting
diff --git a/app/models/mailing_list_mode_site_setting.rb b/app/models/mailing_list_mode_site_setting.rb
index ea0161de827..3d7d4881bca 100644
--- a/app/models/mailing_list_mode_site_setting.rb
+++ b/app/models/mailing_list_mode_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class MailingListModeSiteSetting < EnumSiteSetting
diff --git a/app/models/muted_user.rb b/app/models/muted_user.rb
index 1ba464105d0..4be90200cd3 100644
--- a/app/models/muted_user.rb
+++ b/app/models/muted_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MutedUser < ActiveRecord::Base
belongs_to :user
belongs_to :muted_user, class_name: 'User'
diff --git a/app/models/new_topic_duration_site_setting.rb b/app/models/new_topic_duration_site_setting.rb
index ccc091a8b66..e2a944f8775 100644
--- a/app/models/new_topic_duration_site_setting.rb
+++ b/app/models/new_topic_duration_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class NewTopicDurationSiteSetting < EnumSiteSetting
diff --git a/app/models/notification.rb b/app/models/notification.rb
index 60ffd7f26c9..03160cddaa9 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum'
require_dependency 'notification_emailer'
diff --git a/app/models/notification_level_when_replying_site_setting.rb b/app/models/notification_level_when_replying_site_setting.rb
index 296c7c066f9..97e444a984b 100644
--- a/app/models/notification_level_when_replying_site_setting.rb
+++ b/app/models/notification_level_when_replying_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
require_dependency 'notification_levels'
diff --git a/app/models/oauth2_user_info.rb b/app/models/oauth2_user_info.rb
index 5b27d0cf710..ed9f217caa1 100644
--- a/app/models/oauth2_user_info.rb
+++ b/app/models/oauth2_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Oauth2UserInfo < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/onceoff_log.rb b/app/models/onceoff_log.rb
index 12ce7377c51..cdedc8819c3 100644
--- a/app/models/onceoff_log.rb
+++ b/app/models/onceoff_log.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class OnceoffLog < ActiveRecord::Base
end
diff --git a/app/models/optimized_image.rb b/app/models/optimized_image.rb
index 768c7325d0a..1f5b287f4d2 100644
--- a/app/models/optimized_image.rb
+++ b/app/models/optimized_image.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "file_helper"
require_dependency "url_helper"
require_dependency "db_helper"
diff --git a/app/models/permalink.rb b/app/models/permalink.rb
index 6b3799a554a..c6c28026ee9 100644
--- a/app/models/permalink.rb
+++ b/app/models/permalink.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Permalink < ActiveRecord::Base
belongs_to :topic
belongs_to :post
@@ -21,8 +23,8 @@ class Permalink < ActiveRecord::Base
return unless rule =~ /\/.*\//
escaping = false
- regex = ""
- sub = ""
+ regex = +""
+ sub = +""
c = 0
rule.chars.each do |l|
diff --git a/app/models/plugin_store.rb b/app/models/plugin_store.rb
index 3626141d533..ed8dd6dc000 100644
--- a/app/models/plugin_store.rb
+++ b/app/models/plugin_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# API to wrap up plugin store rows
class PluginStore
attr_reader :plugin_name
diff --git a/app/models/plugin_store_row.rb b/app/models/plugin_store_row.rb
index d9bb1c05db6..c9f56fe9233 100644
--- a/app/models/plugin_store_row.rb
+++ b/app/models/plugin_store_row.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PluginStoreRow < ActiveRecord::Base
end
diff --git a/app/models/post.rb b/app/models/post.rb
index 383cf4886bb..df85b4c7642 100644
--- a/app/models/post.rb
+++ b/app/models/post.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'pretty_text'
require_dependency 'rate_limiter'
require_dependency 'post_revisor'
@@ -545,8 +547,8 @@ class Post < ActiveRecord::Base
def self.url(slug, topic_id, post_number, opts = nil)
opts ||= {}
- result = "/t/"
- result << "#{slug}/" unless !!opts[:without_slug]
+ result = +"/t/"
+ result << "#{slug}/" if !opts[:without_slug]
"#{result}#{topic_id}/#{post_number}"
end
diff --git a/app/models/post_action.rb b/app/models/post_action.rb
index 32b3c50cca3..bf79a2a16ea 100644
--- a/app/models/post_action.rb
+++ b/app/models/post_action.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'rate_limiter'
require_dependency 'system_message'
require_dependency 'post_action_creator'
@@ -80,7 +82,7 @@ class PostAction < ActiveRecord::Base
return if !SiteSetting.auto_respond_to_flag_actions
return if related_post.nil? || related_post.topic.nil?
return if staff_already_replied?(related_post.topic)
- message_key = "flags_dispositions.#{disposition}"
+ message_key = +"flags_dispositions.#{disposition}"
message_key << "_and_deleted" if delete_post
I18n.with_locale(SiteSetting.default_locale) do
diff --git a/app/models/post_action_type.rb b/app/models/post_action_type.rb
index 92c1702b14f..121db590aa3 100644
--- a/app/models/post_action_type.rb
+++ b/app/models/post_action_type.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum'
require_dependency 'distributed_cache'
require_dependency 'flag_settings'
diff --git a/app/models/post_analyzer.rb b/app/models/post_analyzer.rb
index a194ea1f648..a9540320f14 100644
--- a/app/models/post_analyzer.rb
+++ b/app/models/post_analyzer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'oneboxer'
require_dependency 'email_cook'
diff --git a/app/models/post_custom_field.rb b/app/models/post_custom_field.rb
index 4f133f01e47..44b3cc4baf6 100644
--- a/app/models/post_custom_field.rb
+++ b/app/models/post_custom_field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostCustomField < ActiveRecord::Base
belongs_to :post
end
diff --git a/app/models/post_detail.rb b/app/models/post_detail.rb
index c43219749cc..56fbed2ac5f 100644
--- a/app/models/post_detail.rb
+++ b/app/models/post_detail.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostDetail < ActiveRecord::Base
belongs_to :post
diff --git a/app/models/post_mover.rb b/app/models/post_mover.rb
index c33449cc222..72792524aa1 100644
--- a/app/models/post_mover.rb
+++ b/app/models/post_mover.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostMover
attr_reader :original_topic, :destination_topic, :user, :post_ids
diff --git a/app/models/post_reply.rb b/app/models/post_reply.rb
index f4cba4f0449..37654e67537 100644
--- a/app/models/post_reply.rb
+++ b/app/models/post_reply.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostReply < ActiveRecord::Base
belongs_to :post
belongs_to :reply, class_name: 'Post'
diff --git a/app/models/post_reply_key.rb b/app/models/post_reply_key.rb
index b82eceaac6d..996f18a66aa 100644
--- a/app/models/post_reply_key.rb
+++ b/app/models/post_reply_key.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostReplyKey < ActiveRecord::Base
belongs_to :post
belongs_to :user
diff --git a/app/models/post_revision.rb b/app/models/post_revision.rb
index b91f50765a2..d4961eb8650 100644
--- a/app/models/post_revision.rb
+++ b/app/models/post_revision.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "discourse_diff"
class PostRevision < ActiveRecord::Base
diff --git a/app/models/post_search_data.rb b/app/models/post_search_data.rb
index 7a873a505d5..8adc69b1169 100644
--- a/app/models/post_search_data.rb
+++ b/app/models/post_search_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostSearchData < ActiveRecord::Base
include HasSearchData
end
diff --git a/app/models/post_stat.rb b/app/models/post_stat.rb
index 9de208b538d..e2b684666f3 100644
--- a/app/models/post_stat.rb
+++ b/app/models/post_stat.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostStat < ActiveRecord::Base
belongs_to :post
end
diff --git a/app/models/post_upload.rb b/app/models/post_upload.rb
index ea7ece7327f..f13780e1011 100644
--- a/app/models/post_upload.rb
+++ b/app/models/post_upload.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostUpload < ActiveRecord::Base
belongs_to :post
belongs_to :upload
diff --git a/app/models/previous_replies_site_setting.rb b/app/models/previous_replies_site_setting.rb
index eac55ae5232..85f273cc703 100644
--- a/app/models/previous_replies_site_setting.rb
+++ b/app/models/previous_replies_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class PreviousRepliesSiteSetting < EnumSiteSetting
diff --git a/app/models/push_subscription.rb b/app/models/push_subscription.rb
index 0367e5638bf..1c012d84522 100644
--- a/app/models/push_subscription.rb
+++ b/app/models/push_subscription.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PushSubscription < ActiveRecord::Base
belongs_to :user
end
diff --git a/app/models/quoted_post.rb b/app/models/quoted_post.rb
index 7a7111f3dd9..ad07877ac89 100644
--- a/app/models/quoted_post.rb
+++ b/app/models/quoted_post.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class QuotedPost < ActiveRecord::Base
belongs_to :post
belongs_to :quoted_post, class_name: 'Post'
diff --git a/app/models/remote_theme.rb b/app/models/remote_theme.rb
index c15f71c8840..86d78030d2e 100644
--- a/app/models/remote_theme.rb
+++ b/app/models/remote_theme.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'theme_store/git_importer'
require_dependency 'theme_store/tgz_importer'
require_dependency 'upload_creator'
diff --git a/app/models/report.rb b/app/models/report.rb
index ffbaa4f4a69..f4f023bc3b0 100644
--- a/app/models/report.rb
+++ b/app/models/report.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'topic_subtype'
class Report
diff --git a/app/models/reports/bookmarks.rb b/app/models/reports/bookmarks.rb
index 2a98071c3fa..f4728e1f58f 100644
--- a/app/models/reports/bookmarks.rb
+++ b/app/models/reports/bookmarks.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('bookmarks') do |report|
report.icon = 'bookmark'
diff --git a/app/models/reports/consolidated_page_views.rb b/app/models/reports/consolidated_page_views.rb
index 52403b4d226..44fee1fc0c6 100644
--- a/app/models/reports/consolidated_page_views.rb
+++ b/app/models/reports/consolidated_page_views.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("consolidated_page_views") do |report|
filters = %w[
page_view_logged_in
diff --git a/app/models/reports/daily_engaged_users.rb b/app/models/reports/daily_engaged_users.rb
index 0b26e91cebc..65bab0543c6 100644
--- a/app/models/reports/daily_engaged_users.rb
+++ b/app/models/reports/daily_engaged_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("daily_engaged_users") do |report|
report.average = true
diff --git a/app/models/reports/dau_by_mau.rb b/app/models/reports/dau_by_mau.rb
index 6fc75124241..8c4a98f13aa 100644
--- a/app/models/reports/dau_by_mau.rb
+++ b/app/models/reports/dau_by_mau.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("dau_by_mau") do |report|
report.labels = [
{
diff --git a/app/models/reports/emails.rb b/app/models/reports/emails.rb
index 6ccb593cdeb..99bbed46b4b 100644
--- a/app/models/reports/emails.rb
+++ b/app/models/reports/emails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("emails") do |report|
report_about report, EmailLog
end
diff --git a/app/models/reports/flags.rb b/app/models/reports/flags.rb
index 0241089b16f..682fa4f4dc3 100644
--- a/app/models/reports/flags.rb
+++ b/app/models/reports/flags.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('flags') do |report|
category_filter = report.filters.dig(:category)
report.add_filter('category', default: category_filter)
diff --git a/app/models/reports/flags_status.rb b/app/models/reports/flags_status.rb
index 885b37b7f14..dc48d824050 100644
--- a/app/models/reports/flags_status.rb
+++ b/app/models/reports/flags_status.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("flags_status") do |report|
report.modes = [:table]
diff --git a/app/models/reports/likes.rb b/app/models/reports/likes.rb
index 37f7ea3176e..bc21b6685cc 100644
--- a/app/models/reports/likes.rb
+++ b/app/models/reports/likes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("likes") do |report|
report.icon = 'heart'
diff --git a/app/models/reports/moderator_warning_private_messages.rb b/app/models/reports/moderator_warning_private_messages.rb
index cfb5dcec778..ba74b8042d0 100644
--- a/app/models/reports/moderator_warning_private_messages.rb
+++ b/app/models/reports/moderator_warning_private_messages.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("moderator_warning_private_messages") do |report|
report.icon = 'envelope'
private_messages_report report, TopicSubtype.moderator_warning
diff --git a/app/models/reports/moderators_activity.rb b/app/models/reports/moderators_activity.rb
index 08b50337aed..a00b7894f04 100644
--- a/app/models/reports/moderators_activity.rb
+++ b/app/models/reports/moderators_activity.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("moderators_activity") do |report|
report.labels = [
{
diff --git a/app/models/reports/new_contributors.rb b/app/models/reports/new_contributors.rb
index 4619e33dced..4016ba89821 100644
--- a/app/models/reports/new_contributors.rb
+++ b/app/models/reports/new_contributors.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("new_contributors") do |report|
report.data = []
diff --git a/app/models/reports/notify_moderators_private_messages.rb b/app/models/reports/notify_moderators_private_messages.rb
index 55e1cf9ae99..bf5b10e98d4 100644
--- a/app/models/reports/notify_moderators_private_messages.rb
+++ b/app/models/reports/notify_moderators_private_messages.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("notify_moderators_private_messages") do |report|
report.icon = 'envelope'
private_messages_report report, TopicSubtype.notify_moderators
diff --git a/app/models/reports/notify_user_private_messages.rb b/app/models/reports/notify_user_private_messages.rb
index 900fbd3e1a6..3c374b3b0e1 100644
--- a/app/models/reports/notify_user_private_messages.rb
+++ b/app/models/reports/notify_user_private_messages.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("notify_user_private_messages") do |report|
report.icon = 'envelope'
private_messages_report report, TopicSubtype.notify_user
diff --git a/app/models/reports/post_edits.rb b/app/models/reports/post_edits.rb
index 4d24f782cee..be303d9f9ee 100644
--- a/app/models/reports/post_edits.rb
+++ b/app/models/reports/post_edits.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('post_edits') do |report|
category_filter = report.filters.dig(:category)
report.add_filter('category', default: category_filter)
diff --git a/app/models/reports/posts.rb b/app/models/reports/posts.rb
index 51ecdcd8b9a..03175996874 100644
--- a/app/models/reports/posts.rb
+++ b/app/models/reports/posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('posts') do |report|
report.modes = [:table, :chart]
diff --git a/app/models/reports/profile_views.rb b/app/models/reports/profile_views.rb
index 029740d71ec..564ff198d0d 100644
--- a/app/models/reports/profile_views.rb
+++ b/app/models/reports/profile_views.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('profile_views') do |report|
group_filter = report.filters.dig(:group)
report.add_filter('group', default: group_filter)
diff --git a/app/models/reports/signups.rb b/app/models/reports/signups.rb
index 0531557325e..79dcc041478 100644
--- a/app/models/reports/signups.rb
+++ b/app/models/reports/signups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('signups') do |report|
report.icon = 'user-plus'
diff --git a/app/models/reports/staff_logins.rb b/app/models/reports/staff_logins.rb
index f41b3aa98dd..16b4411c7c6 100644
--- a/app/models/reports/staff_logins.rb
+++ b/app/models/reports/staff_logins.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("staff_logins") do |report|
report.modes = [:table]
diff --git a/app/models/reports/storage_stats.rb b/app/models/reports/storage_stats.rb
index d178d84e328..9e7995954f9 100644
--- a/app/models/reports/storage_stats.rb
+++ b/app/models/reports/storage_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("storage_stats") do |report|
backup_stats = begin
BackupRestore::BackupStore.create.stats
diff --git a/app/models/reports/suspicious_logins.rb b/app/models/reports/suspicious_logins.rb
index d805ba138f4..232d1f4b92d 100644
--- a/app/models/reports/suspicious_logins.rb
+++ b/app/models/reports/suspicious_logins.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("suspicious_logins") do |report|
report.modes = [:table]
diff --git a/app/models/reports/system_private_messages.rb b/app/models/reports/system_private_messages.rb
index 98d2dbfa70e..8a9ebe83d2f 100644
--- a/app/models/reports/system_private_messages.rb
+++ b/app/models/reports/system_private_messages.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("system_private_messages") do |report|
report.icon = 'envelope'
private_messages_report report, TopicSubtype.system_message
diff --git a/app/models/reports/time_to_first_response.rb b/app/models/reports/time_to_first_response.rb
index d5c9ebf298a..7f361ef3383 100644
--- a/app/models/reports/time_to_first_response.rb
+++ b/app/models/reports/time_to_first_response.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('time_to_first_response') do |report|
category_filter = report.filters.dig(:category)
report.add_filter('category', default: category_filter)
diff --git a/app/models/reports/top_ignored_users.rb b/app/models/reports/top_ignored_users.rb
index befb4420cbf..2049e28857f 100644
--- a/app/models/reports/top_ignored_users.rb
+++ b/app/models/reports/top_ignored_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("top_ignored_users") do |report|
report.modes = [:table]
diff --git a/app/models/reports/top_referred_topics.rb b/app/models/reports/top_referred_topics.rb
index a818215ff86..6b8abf84e25 100644
--- a/app/models/reports/top_referred_topics.rb
+++ b/app/models/reports/top_referred_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('top_referred_topics') do |report|
category_filter = report.filters.dig(:category)
report.add_filter('category', default: category_filter)
diff --git a/app/models/reports/top_referrers.rb b/app/models/reports/top_referrers.rb
index 4175cd1dab6..623703fb1c4 100644
--- a/app/models/reports/top_referrers.rb
+++ b/app/models/reports/top_referrers.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("top_referrers") do |report|
report.modes = [:table]
diff --git a/app/models/reports/top_traffic_sources.rb b/app/models/reports/top_traffic_sources.rb
index 90fcb92ce5a..f32130dc058 100644
--- a/app/models/reports/top_traffic_sources.rb
+++ b/app/models/reports/top_traffic_sources.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('top_traffic_sources') do |report|
category_filter = report.filters.dig(:category)
report.add_filter('category', default: category_filter)
diff --git a/app/models/reports/top_uploads.rb b/app/models/reports/top_uploads.rb
index cae4284f8a9..b8978678f39 100644
--- a/app/models/reports/top_uploads.rb
+++ b/app/models/reports/top_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('top_uploads') do |report|
report.modes = [:table]
diff --git a/app/models/reports/topics.rb b/app/models/reports/topics.rb
index 6994ae0f12b..7fd181afa09 100644
--- a/app/models/reports/topics.rb
+++ b/app/models/reports/topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('topics') do |report|
category_filter = report.filters.dig(:category)
report.add_filter('category', default: category_filter)
diff --git a/app/models/reports/topics_with_no_response.rb b/app/models/reports/topics_with_no_response.rb
index 123da140b0e..1cc0f17e3e1 100644
--- a/app/models/reports/topics_with_no_response.rb
+++ b/app/models/reports/topics_with_no_response.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('topics_with_no_response') do |report|
category_filter = report.filters.dig(:category)
report.add_filter('category', default: category_filter)
diff --git a/app/models/reports/trending_search.rb b/app/models/reports/trending_search.rb
index 85b9173e072..e320c427942 100644
--- a/app/models/reports/trending_search.rb
+++ b/app/models/reports/trending_search.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("trending_search") do |report|
report.labels = [
{
diff --git a/app/models/reports/user_flagging_ratio.rb b/app/models/reports/user_flagging_ratio.rb
index bd67590e19f..403304e9efd 100644
--- a/app/models/reports/user_flagging_ratio.rb
+++ b/app/models/reports/user_flagging_ratio.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("user_flagging_ratio") do |report|
report.data = []
diff --git a/app/models/reports/user_to_user_private_messages.rb b/app/models/reports/user_to_user_private_messages.rb
index 9fdc8410718..753d4f07462 100644
--- a/app/models/reports/user_to_user_private_messages.rb
+++ b/app/models/reports/user_to_user_private_messages.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("user_to_user_private_messages") do |report|
report.icon = 'envelope'
private_messages_report report, TopicSubtype.user_to_user
diff --git a/app/models/reports/user_to_user_private_messages_with_replies.rb b/app/models/reports/user_to_user_private_messages_with_replies.rb
index 65891e67a87..b1b91ad175f 100644
--- a/app/models/reports/user_to_user_private_messages_with_replies.rb
+++ b/app/models/reports/user_to_user_private_messages_with_replies.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("user_to_user_private_messages_with_replies") do |report|
report.icon = 'envelope'
topic_subtype = TopicSubtype.user_to_user
diff --git a/app/models/reports/users_by_trust_level.rb b/app/models/reports/users_by_trust_level.rb
index 5252be50559..7c8a0dc7788 100644
--- a/app/models/reports/users_by_trust_level.rb
+++ b/app/models/reports/users_by_trust_level.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("users_by_trust_level") do |report|
report.data = []
diff --git a/app/models/reports/users_by_type.rb b/app/models/reports/users_by_type.rb
index a14f59804d1..065b6cb57d4 100644
--- a/app/models/reports/users_by_type.rb
+++ b/app/models/reports/users_by_type.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("users_by_type") do |report|
report.data = []
diff --git a/app/models/reports/visits.rb b/app/models/reports/visits.rb
index 9e38b032b25..472c0117bc4 100644
--- a/app/models/reports/visits.rb
+++ b/app/models/reports/visits.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('visits') do |report|
group_filter = report.filters.dig(:group)
report.add_filter('group', default: group_filter)
diff --git a/app/models/reports/visits_mobile.rb b/app/models/reports/visits_mobile.rb
index c31adbe3010..30fb48c9888 100644
--- a/app/models/reports/visits_mobile.rb
+++ b/app/models/reports/visits_mobile.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report("mobile_visits") do |report|
basic_report_about report, UserVisit, :mobile_by_day, report.start_date, report.end_date
report.total = UserVisit.where(mobile: true).count
diff --git a/app/models/reports/web_crawlers.rb b/app/models/reports/web_crawlers.rb
index c3d9da9b45d..0b244b596bf 100644
--- a/app/models/reports/web_crawlers.rb
+++ b/app/models/reports/web_crawlers.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Report.add_report('web_crawlers') do |report|
report.labels = [
{
diff --git a/app/models/reviewable.rb b/app/models/reviewable.rb
index e8c8f0d97c2..bbbd3a626c7 100644
--- a/app/models/reviewable.rb
+++ b/app/models/reviewable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum'
require_dependency 'reviewable/actions'
require_dependency 'reviewable/conversation'
diff --git a/app/models/reviewable_flagged_post.rb b/app/models/reviewable_flagged_post.rb
index ae23fe2a71d..5c00228f8e3 100644
--- a/app/models/reviewable_flagged_post.rb
+++ b/app/models/reviewable_flagged_post.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'reviewable'
class ReviewableFlaggedPost < Reviewable
diff --git a/app/models/reviewable_history.rb b/app/models/reviewable_history.rb
index 9159d86de08..1c0eebc5f77 100644
--- a/app/models/reviewable_history.rb
+++ b/app/models/reviewable_history.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableHistory < ActiveRecord::Base
belongs_to :reviewable
belongs_to :created_by, class_name: 'User'
diff --git a/app/models/reviewable_queued_post.rb b/app/models/reviewable_queued_post.rb
index 11084d58bd6..2255452a29d 100644
--- a/app/models/reviewable_queued_post.rb
+++ b/app/models/reviewable_queued_post.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'reviewable'
require_dependency 'user_destroyer'
diff --git a/app/models/reviewable_score.rb b/app/models/reviewable_score.rb
index 1d3af75f4ad..0063e2458a2 100644
--- a/app/models/reviewable_score.rb
+++ b/app/models/reviewable_score.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableScore < ActiveRecord::Base
belongs_to :reviewable
belongs_to :user
diff --git a/app/models/reviewable_user.rb b/app/models/reviewable_user.rb
index 7cc4b0d2656..31b8776ef8a 100644
--- a/app/models/reviewable_user.rb
+++ b/app/models/reviewable_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'reviewable'
class ReviewableUser < Reviewable
diff --git a/app/models/s3_region_site_setting.rb b/app/models/s3_region_site_setting.rb
index 9f195d4a908..5d892d31924 100644
--- a/app/models/s3_region_site_setting.rb
+++ b/app/models/s3_region_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class S3RegionSiteSetting < EnumSiteSetting
diff --git a/app/models/screened_email.rb b/app/models/screened_email.rb
index a0dec7f12f1..316d898fba8 100644
--- a/app/models/screened_email.rb
+++ b/app/models/screened_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'screening_model'
# A ScreenedEmail record represents an email address that is being watched,
diff --git a/app/models/screened_ip_address.rb b/app/models/screened_ip_address.rb
index 29729e622e2..e4d89e51184 100644
--- a/app/models/screened_ip_address.rb
+++ b/app/models/screened_ip_address.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'screening_model'
require_dependency 'ip_addr'
diff --git a/app/models/screened_url.rb b/app/models/screened_url.rb
index 47e6e949db6..a5bbaec4976 100644
--- a/app/models/screened_url.rb
+++ b/app/models/screened_url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'screening_model'
# A ScreenedUrl record represents a URL that is being watched.
diff --git a/app/models/search_log.rb b/app/models/search_log.rb
index b0774b93f73..c6285242384 100644
--- a/app/models/search_log.rb
+++ b/app/models/search_log.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum'
class SearchLog < ActiveRecord::Base
diff --git a/app/models/shared_draft.rb b/app/models/shared_draft.rb
index 9fdac77dcbb..0369c3b0e22 100644
--- a/app/models/shared_draft.rb
+++ b/app/models/shared_draft.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SharedDraft < ActiveRecord::Base
belongs_to :topic
belongs_to :category
diff --git a/app/models/single_sign_on_record.rb b/app/models/single_sign_on_record.rb
index 417a5f35902..bba3feaac78 100644
--- a/app/models/single_sign_on_record.rb
+++ b/app/models/single_sign_on_record.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SingleSignOnRecord < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/site.rb b/app/models/site.rb
index a37944eb8e9..622a6d6658d 100644
--- a/app/models/site.rb
+++ b/app/models/site.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# A class we can use to serialize the site data
require_dependency 'score_calculator'
require_dependency 'trust_level'
diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb
index 88201bbdcad..19c4d2e1e55 100644
--- a/app/models/site_setting.rb
+++ b/app/models/site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'site_setting_extension'
require_dependency 'global_path'
require_dependency 'site_settings/yaml_loader'
diff --git a/app/models/skipped_email_log.rb b/app/models/skipped_email_log.rb
index 04682a6ea12..90c5e152f03 100644
--- a/app/models/skipped_email_log.rb
+++ b/app/models/skipped_email_log.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SkippedEmailLog < ActiveRecord::Base
belongs_to :email_log
diff --git a/app/models/slug_setting.rb b/app/models/slug_setting.rb
index 86dc666d918..2feec4bd2a0 100644
--- a/app/models/slug_setting.rb
+++ b/app/models/slug_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class SlugSetting < EnumSiteSetting
diff --git a/app/models/stylesheet_cache.rb b/app/models/stylesheet_cache.rb
index b25fc51fa26..ee0b021909b 100644
--- a/app/models/stylesheet_cache.rb
+++ b/app/models/stylesheet_cache.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class StylesheetCache < ActiveRecord::Base
self.table_name = 'stylesheet_cache'
diff --git a/app/models/tag.rb b/app/models/tag.rb
index 4e77af16d45..375832614da 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Tag < ActiveRecord::Base
include Searchable
include HasDestroyedWebHook
diff --git a/app/models/tag_group.rb b/app/models/tag_group.rb
index 124a487f9e3..3771b80a797 100644
--- a/app/models/tag_group.rb
+++ b/app/models/tag_group.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TagGroup < ActiveRecord::Base
validates_uniqueness_of :name, case_sensitive: false
diff --git a/app/models/tag_group_membership.rb b/app/models/tag_group_membership.rb
index 3bc5610e278..55fa5df46a5 100644
--- a/app/models/tag_group_membership.rb
+++ b/app/models/tag_group_membership.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TagGroupMembership < ActiveRecord::Base
belongs_to :tag
belongs_to :tag_group
diff --git a/app/models/tag_group_permission.rb b/app/models/tag_group_permission.rb
index 90ba02e1be0..881921d36cc 100644
--- a/app/models/tag_group_permission.rb
+++ b/app/models/tag_group_permission.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Who can see and use tags belonging to a tag group.
class TagGroupPermission < ActiveRecord::Base
belongs_to :tag_group
diff --git a/app/models/tag_search_data.rb b/app/models/tag_search_data.rb
index 01d8678fbcb..fcfbf338d94 100644
--- a/app/models/tag_search_data.rb
+++ b/app/models/tag_search_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TagSearchData < ActiveRecord::Base
include HasSearchData
end
diff --git a/app/models/tag_user.rb b/app/models/tag_user.rb
index b0697fa30d8..dc0164ebb11 100644
--- a/app/models/tag_user.rb
+++ b/app/models/tag_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'notification_levels'
class TagUser < ActiveRecord::Base
diff --git a/app/models/theme_field.rb b/app/models/theme_field.rb
index f906fb83e60..447a3467215 100644
--- a/app/models/theme_field.rb
+++ b/app/models/theme_field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'theme_settings_parser'
require_dependency 'theme_translation_parser'
require_dependency 'theme_javascript_compiler'
diff --git a/app/models/theme_setting.rb b/app/models/theme_setting.rb
index cfb68445774..b34fd5fbefa 100644
--- a/app/models/theme_setting.rb
+++ b/app/models/theme_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeSetting < ActiveRecord::Base
belongs_to :theme
diff --git a/app/models/theme_translation_override.rb b/app/models/theme_translation_override.rb
index 516483aae47..93ba1f2bca9 100644
--- a/app/models/theme_translation_override.rb
+++ b/app/models/theme_translation_override.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeTranslationOverride < ActiveRecord::Base
belongs_to :theme
diff --git a/app/models/top_lists.rb b/app/models/top_lists.rb
index 220473a71e8..70159f9d37d 100644
--- a/app/models/top_lists.rb
+++ b/app/models/top_lists.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopLists
include ActiveModel::Serialization
diff --git a/app/models/top_menu_item.rb b/app/models/top_menu_item.rb
index 302a26452b3..fad4c9b1ad1 100644
--- a/app/models/top_menu_item.rb
+++ b/app/models/top_menu_item.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Public: Instances of TopMenuItem should be instantiated from segments contained in SiteSetting.top_menu.
# Exposes relevant properties and methods that dictate which query methods should be called from the ListController.
# Segment data should start with a route fragment in one of the following formats:
diff --git a/app/models/top_topic.rb b/app/models/top_topic.rb
index 00362226285..33933779c89 100644
--- a/app/models/top_topic.rb
+++ b/app/models/top_topic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "distributed_memoizer"
class TopTopic < ActiveRecord::Base
diff --git a/app/models/topic.rb b/app/models/topic.rb
index 8b38756ec59..1314bf99a74 100644
--- a/app/models/topic.rb
+++ b/app/models/topic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'slug'
require_dependency 'avatar_lookup'
require_dependency 'topic_view'
@@ -1009,7 +1011,7 @@ class Topic < ActiveRecord::Base
end
def self.relative_url(id, slug, post_number = nil)
- url = "#{Discourse.base_uri}/t/"
+ url = +"#{Discourse.base_uri}/t/"
url << "#{slug}/" if slug.present?
url << id.to_s
url << "/#{post_number}" if post_number.to_i > 1
diff --git a/app/models/topic_allowed_group.rb b/app/models/topic_allowed_group.rb
index 670bc208054..d5ee5e5d63d 100644
--- a/app/models/topic_allowed_group.rb
+++ b/app/models/topic_allowed_group.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicAllowedGroup < ActiveRecord::Base
belongs_to :topic
belongs_to :group
diff --git a/app/models/topic_allowed_user.rb b/app/models/topic_allowed_user.rb
index 4bb981d226c..cc497d1a842 100644
--- a/app/models/topic_allowed_user.rb
+++ b/app/models/topic_allowed_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicAllowedUser < ActiveRecord::Base
belongs_to :topic
belongs_to :user
diff --git a/app/models/topic_converter.rb b/app/models/topic_converter.rb
index ef80dbc5e33..d0ce8dacf03 100644
--- a/app/models/topic_converter.rb
+++ b/app/models/topic_converter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicConverter
attr_reader :topic
diff --git a/app/models/topic_custom_field.rb b/app/models/topic_custom_field.rb
index e539bb90f63..ba5767084e5 100644
--- a/app/models/topic_custom_field.rb
+++ b/app/models/topic_custom_field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicCustomField < ActiveRecord::Base
belongs_to :topic
end
diff --git a/app/models/topic_embed.rb b/app/models/topic_embed.rb
index 5258eac2635..bf551fe63e6 100644
--- a/app/models/topic_embed.rb
+++ b/app/models/topic_embed.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'nokogiri'
require_dependency 'url_helper'
@@ -131,7 +133,7 @@ class TopicEmbed < ActiveRecord::Base
read_doc = Readability::Document.new(html, opts)
- title = raw_doc.title || ''
+ title = +(raw_doc.title || '')
title.strip!
if SiteSetting.embed_title_scrubber.present?
@@ -215,7 +217,7 @@ class TopicEmbed < ActiveRecord::Base
def self.first_paragraph_from(html)
doc = Nokogiri::HTML(html)
- result = ""
+ result = +""
doc.css('p').each do |p|
if p.text.present?
result << p.to_s
diff --git a/app/models/topic_featured_users.rb b/app/models/topic_featured_users.rb
index 7b442423b24..3cd3c7fda31 100644
--- a/app/models/topic_featured_users.rb
+++ b/app/models/topic_featured_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicFeaturedUsers
attr_reader :topic
diff --git a/app/models/topic_invite.rb b/app/models/topic_invite.rb
index d6896c6502c..52f63070c7a 100644
--- a/app/models/topic_invite.rb
+++ b/app/models/topic_invite.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicInvite < ActiveRecord::Base
belongs_to :topic
belongs_to :invite
diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb
index a45c7e1c366..cdd0cc4a2de 100644
--- a/app/models/topic_link.rb
+++ b/app/models/topic_link.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'uri'
require_dependency 'slug'
require_dependency 'discourse'
@@ -191,7 +193,7 @@ class TopicLink < ActiveRecord::Base
topic_id = nil unless topic
if topic.present?
- url = "#{Discourse.base_url_no_prefix}#{topic.relative_url}"
+ url = +"#{Discourse.base_url_no_prefix}#{topic.relative_url}"
url << "/#{post_number}" if post_number.to_i > 1
end
end
diff --git a/app/models/topic_link_click.rb b/app/models/topic_link_click.rb
index 6caaff82d4a..452fb709f3f 100644
--- a/app/models/topic_link_click.rb
+++ b/app/models/topic_link_click.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse'
require 'ipaddr'
require 'url_helper'
diff --git a/app/models/topic_list.rb b/app/models/topic_list.rb
index 5aae90f7782..69cedff1346 100644
--- a/app/models/topic_list.rb
+++ b/app/models/topic_list.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'avatar_lookup'
require_dependency 'primary_group_lookup'
diff --git a/app/models/topic_notifier.rb b/app/models/topic_notifier.rb
index 46d43c3755b..2bcc6beb1c0 100644
--- a/app/models/topic_notifier.rb
+++ b/app/models/topic_notifier.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicNotifier
def initialize(topic)
@topic = topic
diff --git a/app/models/topic_participants_summary.rb b/app/models/topic_participants_summary.rb
index d461eb31e6e..51ecfa15cca 100644
--- a/app/models/topic_participants_summary.rb
+++ b/app/models/topic_participants_summary.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This is used on a topic page
class TopicParticipantsSummary
attr_reader :topic, :options
diff --git a/app/models/topic_poster.rb b/app/models/topic_poster.rb
index 32eef2d58c0..09750995817 100644
--- a/app/models/topic_poster.rb
+++ b/app/models/topic_poster.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicPoster < OpenStruct
include ActiveModel::Serialization
diff --git a/app/models/topic_posters_summary.rb b/app/models/topic_posters_summary.rb
index 5fa5b2cefcd..a8bc292c802 100644
--- a/app/models/topic_posters_summary.rb
+++ b/app/models/topic_posters_summary.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This is used in topic lists
require_dependency 'topic_poster'
@@ -21,7 +23,7 @@ class TopicPostersSummary
topic_poster.description = descriptions_for(user)
topic_poster.primary_group = primary_group_lookup[user.id]
if topic.last_post_user_id == user.id
- topic_poster.extras = 'latest'
+ topic_poster.extras = +'latest'
topic_poster.extras << ' single' if user_ids.uniq.size == 1
end
end
diff --git a/app/models/topic_search_data.rb b/app/models/topic_search_data.rb
index 115570c2098..7a37bef9005 100644
--- a/app/models/topic_search_data.rb
+++ b/app/models/topic_search_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicSearchData < ActiveRecord::Base
include HasSearchData
end
diff --git a/app/models/topic_tag.rb b/app/models/topic_tag.rb
index 22edeebad0c..60943b393ca 100644
--- a/app/models/topic_tag.rb
+++ b/app/models/topic_tag.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicTag < ActiveRecord::Base
belongs_to :topic
belongs_to :tag
diff --git a/app/models/topic_timer.rb b/app/models/topic_timer.rb
index 28dbba8d0cc..c6213a164e7 100644
--- a/app/models/topic_timer.rb
+++ b/app/models/topic_timer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicTimer < ActiveRecord::Base
include Trashable
diff --git a/app/models/topic_user.rb b/app/models/topic_user.rb
index 8a7125340de..5b83e66f5f9 100644
--- a/app/models/topic_user.rb
+++ b/app/models/topic_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'notification_levels'
class TopicUser < ActiveRecord::Base
diff --git a/app/models/topic_view_item.rb b/app/models/topic_view_item.rb
index 9fbb9aa98a0..60edba453c7 100644
--- a/app/models/topic_view_item.rb
+++ b/app/models/topic_view_item.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'ipaddr'
# awkward TopicView is taken
@@ -9,7 +11,7 @@ class TopicViewItem < ActiveRecord::Base
def self.add(topic_id, ip, user_id = nil, at = nil, skip_redis = false)
# Only store a view once per day per thing per (user || ip)
at ||= Date.today
- redis_key = "view:#{topic_id}:#{at}"
+ redis_key = +"view:#{topic_id}:#{at}"
if user_id
redis_key << ":user-#{user_id}"
else
diff --git a/app/models/translation_override.rb b/app/models/translation_override.rb
index 5cd047be2e7..3d205f1d62d 100644
--- a/app/models/translation_override.rb
+++ b/app/models/translation_override.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "i18n/i18n_interpolation_keys_finder"
class TranslationOverride < ActiveRecord::Base
diff --git a/app/models/trust_level3_requirements.rb b/app/models/trust_level3_requirements.rb
index 7b856905087..0690a582acd 100644
--- a/app/models/trust_level3_requirements.rb
+++ b/app/models/trust_level3_requirements.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This class performs calculations to determine if a user qualifies for
# the Leader (3) trust level.
class TrustLevel3Requirements
diff --git a/app/models/trust_level_and_staff_setting.rb b/app/models/trust_level_and_staff_setting.rb
index 49d46ce039c..2795de8266f 100644
--- a/app/models/trust_level_and_staff_setting.rb
+++ b/app/models/trust_level_and_staff_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class TrustLevelAndStaffSetting < TrustLevelSetting
diff --git a/app/models/trust_level_setting.rb b/app/models/trust_level_setting.rb
index ad48613fe9e..a7d887c7478 100644
--- a/app/models/trust_level_setting.rb
+++ b/app/models/trust_level_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum_site_setting'
class TrustLevelSetting < EnumSiteSetting
diff --git a/app/models/unsubscribe_key.rb b/app/models/unsubscribe_key.rb
index 7f5ee933cba..308d2d5205f 100644
--- a/app/models/unsubscribe_key.rb
+++ b/app/models/unsubscribe_key.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UnsubscribeKey < ActiveRecord::Base
belongs_to :user
belongs_to :post
diff --git a/app/models/upload.rb b/app/models/upload.rb
index 545a29bb8f6..6a32afcc58a 100644
--- a/app/models/upload.rb
+++ b/app/models/upload.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "digest/sha1"
require_dependency "file_helper"
require_dependency "url_helper"
diff --git a/app/models/user.rb b/app/models/user.rb
index 6e155dde28b..7db7e2639e3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'jobs/base'
require_dependency 'email'
require_dependency 'email_token'
@@ -752,7 +754,7 @@ class User < ActiveRecord::Base
# TODO it may be worth caching this in a distributed cache, should be benched
if SiteSetting.external_system_avatars_enabled
url = SiteSetting.external_system_avatars_url.dup
- url = "#{Discourse::base_uri}#{url}" unless url =~ /^https?:\/\//
+ url = +"#{Discourse::base_uri}#{url}" unless url =~ /^https?:\/\//
url.gsub! "{color}", letter_avatar_color(normalized_username)
url.gsub! "{username}", CGI.escape(username)
url.gsub! "{first_letter}", CGI.escape(normalized_username.grapheme_clusters.first)
diff --git a/app/models/user_action.rb b/app/models/user_action.rb
index bd84eaadbb5..d660fa53d33 100644
--- a/app/models/user_action.rb
+++ b/app/models/user_action.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserAction < ActiveRecord::Base
self.ignored_columns = %w{
diff --git a/app/models/user_api_key.rb b/app/models/user_api_key.rb
index 0895d2c0b7d..dbd6c528628 100644
--- a/app/models/user_api_key.rb
+++ b/app/models/user_api_key.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserApiKey < ActiveRecord::Base
SCOPES = {
diff --git a/app/models/user_archived_message.rb b/app/models/user_archived_message.rb
index 6c2c604042f..7a51c2c8601 100644
--- a/app/models/user_archived_message.rb
+++ b/app/models/user_archived_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserArchivedMessage < ActiveRecord::Base
belongs_to :user
belongs_to :topic
diff --git a/app/models/user_associated_account.rb b/app/models/user_associated_account.rb
index b20c9ad2804..55618aee4f6 100644
--- a/app/models/user_associated_account.rb
+++ b/app/models/user_associated_account.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserAssociatedAccount < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/user_auth_token_log.rb b/app/models/user_auth_token_log.rb
index 8d17e9cb703..3b585805a70 100644
--- a/app/models/user_auth_token_log.rb
+++ b/app/models/user_auth_token_log.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserAuthTokenLog < ActiveRecord::Base
belongs_to :user
end
diff --git a/app/models/user_avatar.rb b/app/models/user_avatar.rb
index ddb3c6af890..b5baafda83f 100644
--- a/app/models/user_avatar.rb
+++ b/app/models/user_avatar.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'letter_avatar'
require_dependency 'upload_creator'
diff --git a/app/models/user_badge.rb b/app/models/user_badge.rb
index bbac4024058..e915a7c6e24 100644
--- a/app/models/user_badge.rb
+++ b/app/models/user_badge.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserBadge < ActiveRecord::Base
belongs_to :badge
belongs_to :user
diff --git a/app/models/user_badges.rb b/app/models/user_badges.rb
index bd68c4c037b..4b0f8588307 100644
--- a/app/models/user_badges.rb
+++ b/app/models/user_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# view model for user badges
class UserBadges
alias :read_attribute_for_serialization :send
diff --git a/app/models/user_custom_field.rb b/app/models/user_custom_field.rb
index 3b383d6b3ca..0fb77e5f634 100644
--- a/app/models/user_custom_field.rb
+++ b/app/models/user_custom_field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserCustomField < ActiveRecord::Base
belongs_to :user
end
diff --git a/app/models/user_email.rb b/app/models/user_email.rb
index fca7a28967f..8b3729f1fbc 100644
--- a/app/models/user_email.rb
+++ b/app/models/user_email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email_validator'
class UserEmail < ActiveRecord::Base
diff --git a/app/models/user_export.rb b/app/models/user_export.rb
index 1438386385d..4884b84377d 100644
--- a/app/models/user_export.rb
+++ b/app/models/user_export.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserExport < ActiveRecord::Base
belongs_to :user
belongs_to :upload, dependent: :destroy
diff --git a/app/models/user_field.rb b/app/models/user_field.rb
index 65dcc6236a6..1fcbd0ed564 100644
--- a/app/models/user_field.rb
+++ b/app/models/user_field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserField < ActiveRecord::Base
include AnonCacheInvalidator
diff --git a/app/models/user_field_option.rb b/app/models/user_field_option.rb
index a4412553425..8a2d53ec7ce 100644
--- a/app/models/user_field_option.rb
+++ b/app/models/user_field_option.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserFieldOption < ActiveRecord::Base
end
diff --git a/app/models/user_history.rb b/app/models/user_history.rb
index 2c37510d75d..7beaf1e537a 100644
--- a/app/models/user_history.rb
+++ b/app/models/user_history.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# UserHistory stores information about actions that users have taken,
# like deleting users, changing site settings, dimissing notifications, etc.
# Use other classes, like StaffActionLogger, to log records to this table.
diff --git a/app/models/user_open_id.rb b/app/models/user_open_id.rb
index 188a04ef150..934b0ef48cc 100644
--- a/app/models/user_open_id.rb
+++ b/app/models/user_open_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserOpenId < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/user_option.rb b/app/models/user_option.rb
index 9cdfc36030a..7cf837e3b87 100644
--- a/app/models/user_option.rb
+++ b/app/models/user_option.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserOption < ActiveRecord::Base
self.primary_key = :user_id
belongs_to :user
diff --git a/app/models/user_profile.rb b/app/models/user_profile.rb
index 3bf7ec71b26..13ab947ca04 100644
--- a/app/models/user_profile.rb
+++ b/app/models/user_profile.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'upload_creator'
class UserProfile < ActiveRecord::Base
self.ignored_columns = %w{
diff --git a/app/models/user_profile_view.rb b/app/models/user_profile_view.rb
index 6864b571793..ef8d37b0b76 100644
--- a/app/models/user_profile_view.rb
+++ b/app/models/user_profile_view.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserProfileView < ActiveRecord::Base
validates_presence_of :user_profile_id, :viewed_at
@@ -5,7 +7,7 @@ class UserProfileView < ActiveRecord::Base
def self.add(user_profile_id, ip, user_id = nil, at = nil, skip_redis = false)
at ||= Time.zone.now
- redis_key = "user-profile-view:#{user_profile_id}:#{at.to_date}"
+ redis_key = +"user-profile-view:#{user_profile_id}:#{at.to_date}"
if user_id
return if user_id < 1
redis_key << ":user-#{user_id}"
diff --git a/app/models/user_search.rb b/app/models/user_search.rb
index 98855b585ec..8881f2aa3bf 100644
--- a/app/models/user_search.rb
+++ b/app/models/user_search.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Searches for a user by username or full text or name (if enabled in SiteSettings)
require_dependency 'search'
diff --git a/app/models/user_search_data.rb b/app/models/user_search_data.rb
index ce61e991fa9..87a6caea821 100644
--- a/app/models/user_search_data.rb
+++ b/app/models/user_search_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserSearchData < ActiveRecord::Base
include HasSearchData
end
diff --git a/app/models/user_second_factor.rb b/app/models/user_second_factor.rb
index 7ad41b95ea7..7388751976b 100644
--- a/app/models/user_second_factor.rb
+++ b/app/models/user_second_factor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserSecondFactor < ActiveRecord::Base
belongs_to :user
diff --git a/app/models/user_summary.rb b/app/models/user_summary.rb
index 8b7f68597dc..4d7af5149de 100644
--- a/app/models/user_summary.rb
+++ b/app/models/user_summary.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# ViewModel used on Summary tab on User page
class UserSummary
diff --git a/app/models/user_upload.rb b/app/models/user_upload.rb
index ee839ac8681..3243b093d74 100644
--- a/app/models/user_upload.rb
+++ b/app/models/user_upload.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserUpload < ActiveRecord::Base
belongs_to :upload
belongs_to :user
diff --git a/app/models/user_visit.rb b/app/models/user_visit.rb
index 6fe21eae7bb..ca08bc67477 100644
--- a/app/models/user_visit.rb
+++ b/app/models/user_visit.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserVisit < ActiveRecord::Base
def self.counts_by_day_query(start_date, end_date, group_id = nil)
result = where('visited_at >= ? and visited_at <= ?', start_date.to_date, end_date.to_date)
diff --git a/app/models/user_warning.rb b/app/models/user_warning.rb
index 612406ac0e9..b11bff29949 100644
--- a/app/models/user_warning.rb
+++ b/app/models/user_warning.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserWarning < ActiveRecord::Base
belongs_to :user
belongs_to :topic
diff --git a/app/models/username_validator.rb b/app/models/username_validator.rb
index 3e6ea7c423a..1f2e9b97993 100644
--- a/app/models/username_validator.rb
+++ b/app/models/username_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'user'
class UsernameValidator
diff --git a/app/models/watched_word.rb b/app/models/watched_word.rb
index 73a3f661166..959dfb011df 100644
--- a/app/models/watched_word.rb
+++ b/app/models/watched_word.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum'
class WatchedWord < ActiveRecord::Base
diff --git a/app/models/web_crawler_request.rb b/app/models/web_crawler_request.rb
index 2c0048e0369..fb61f95b105 100644
--- a/app/models/web_crawler_request.rb
+++ b/app/models/web_crawler_request.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebCrawlerRequest < ActiveRecord::Base
include CachedCounting
diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb
index 17bbb29e07b..c9cf902bb70 100644
--- a/app/models/web_hook.rb
+++ b/app/models/web_hook.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHook < ActiveRecord::Base
has_and_belongs_to_many :web_hook_event_types
has_and_belongs_to_many :groups
diff --git a/app/models/web_hook_event.rb b/app/models/web_hook_event.rb
index 2ab764f161a..9e7ac9cc601 100644
--- a/app/models/web_hook_event.rb
+++ b/app/models/web_hook_event.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHookEvent < ActiveRecord::Base
belongs_to :web_hook
diff --git a/app/models/web_hook_event_type.rb b/app/models/web_hook_event_type.rb
index fe0dce46d00..297c11776ff 100644
--- a/app/models/web_hook_event_type.rb
+++ b/app/models/web_hook_event_type.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHookEventType < ActiveRecord::Base
TOPIC = 1
POST = 2
diff --git a/app/serializers/about_serializer.rb b/app/serializers/about_serializer.rb
index ebcac25650f..af78559b6a3 100644
--- a/app/serializers/about_serializer.rb
+++ b/app/serializers/about_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AboutSerializer < ApplicationSerializer
class UserAboutSerializer < BasicUserSerializer
diff --git a/app/serializers/admin_badge_serializer.rb b/app/serializers/admin_badge_serializer.rb
index 4f57896d90e..15f354ef5a4 100644
--- a/app/serializers/admin_badge_serializer.rb
+++ b/app/serializers/admin_badge_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminBadgeSerializer < BadgeSerializer
attributes :query, :trigger, :target_posts, :auto_revoke, :show_posts
diff --git a/app/serializers/admin_badges_serializer.rb b/app/serializers/admin_badges_serializer.rb
index eedf6fd464d..b2ea3edeee9 100644
--- a/app/serializers/admin_badges_serializer.rb
+++ b/app/serializers/admin_badges_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminBadgesSerializer < ApplicationSerializer
attributes :protected_system_fields, :triggers
has_many :badges, serializer: AdminBadgeSerializer
diff --git a/app/serializers/admin_detailed_user_serializer.rb b/app/serializers/admin_detailed_user_serializer.rb
index e0ad2abcfc7..abe0d137736 100644
--- a/app/serializers/admin_detailed_user_serializer.rb
+++ b/app/serializers/admin_detailed_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminDetailedUserSerializer < AdminUserSerializer
attributes :moderator,
diff --git a/app/serializers/admin_email_template_serializer.rb b/app/serializers/admin_email_template_serializer.rb
index 0a670091ed9..d0e36bd9e58 100644
--- a/app/serializers/admin_email_template_serializer.rb
+++ b/app/serializers/admin_email_template_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminEmailTemplateSerializer < ApplicationSerializer
attributes :id, :title, :subject, :body, :can_revert?
diff --git a/app/serializers/admin_plugin_serializer.rb b/app/serializers/admin_plugin_serializer.rb
index b1150714968..3b8fc0e323c 100644
--- a/app/serializers/admin_plugin_serializer.rb
+++ b/app/serializers/admin_plugin_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminPluginSerializer < ApplicationSerializer
attributes :id,
:name,
diff --git a/app/serializers/admin_user_action_serializer.rb b/app/serializers/admin_user_action_serializer.rb
index 4bc1db5f5a3..497f472ffe3 100644
--- a/app/serializers/admin_user_action_serializer.rb
+++ b/app/serializers/admin_user_action_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'post_item_excerpt'
class AdminUserActionSerializer < ApplicationSerializer
diff --git a/app/serializers/admin_user_list_serializer.rb b/app/serializers/admin_user_list_serializer.rb
index d9156edcaa1..e670cd767f4 100644
--- a/app/serializers/admin_user_list_serializer.rb
+++ b/app/serializers/admin_user_list_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminUserListSerializer < BasicUserSerializer
attributes :email,
diff --git a/app/serializers/admin_user_serializer.rb b/app/serializers/admin_user_serializer.rb
index 97d587ba81a..fed45ea7321 100644
--- a/app/serializers/admin_user_serializer.rb
+++ b/app/serializers/admin_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'admin_user_list_serializer'
class AdminUserSerializer < AdminUserListSerializer
diff --git a/app/serializers/admin_web_hook_event_serializer.rb b/app/serializers/admin_web_hook_event_serializer.rb
index 14ff7248839..579bdd78725 100644
--- a/app/serializers/admin_web_hook_event_serializer.rb
+++ b/app/serializers/admin_web_hook_event_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminWebHookEventSerializer < ApplicationSerializer
attributes :id,
:web_hook_id,
diff --git a/app/serializers/admin_web_hook_serializer.rb b/app/serializers/admin_web_hook_serializer.rb
index bd67cac7f3d..cf3134188b2 100644
--- a/app/serializers/admin_web_hook_serializer.rb
+++ b/app/serializers/admin_web_hook_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminWebHookSerializer < ApplicationSerializer
attributes :id,
:payload_url,
diff --git a/app/serializers/api_key_serializer.rb b/app/serializers/api_key_serializer.rb
index 2fe1bb757d9..bb807269b85 100644
--- a/app/serializers/api_key_serializer.rb
+++ b/app/serializers/api_key_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ApiKeySerializer < ApplicationSerializer
attributes :id,
diff --git a/app/serializers/application_serializer.rb b/app/serializers/application_serializer.rb
index 29c42994d9f..95abe6277f3 100644
--- a/app/serializers/application_serializer.rb
+++ b/app/serializers/application_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'distributed_cache'
class ApplicationSerializer < ActiveModel::Serializer
diff --git a/app/serializers/archetype_serializer.rb b/app/serializers/archetype_serializer.rb
index 2b89a1a0053..469b1195f3b 100644
--- a/app/serializers/archetype_serializer.rb
+++ b/app/serializers/archetype_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ArchetypeSerializer < ApplicationSerializer
attributes :id, :name, :options
diff --git a/app/serializers/auth_provider_serializer.rb b/app/serializers/auth_provider_serializer.rb
index 82310b7bd9f..404e3d9425b 100644
--- a/app/serializers/auth_provider_serializer.rb
+++ b/app/serializers/auth_provider_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AuthProviderSerializer < ApplicationSerializer
attributes :name, :custom_url, :pretty_name_override, :title_override, :message_override,
diff --git a/app/serializers/backup_file_serializer.rb b/app/serializers/backup_file_serializer.rb
index f4cada57082..1ccab21a15a 100644
--- a/app/serializers/backup_file_serializer.rb
+++ b/app/serializers/backup_file_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BackupFileSerializer < ApplicationSerializer
attributes :filename,
:size,
diff --git a/app/serializers/badge_grouping_serializer.rb b/app/serializers/badge_grouping_serializer.rb
index 79abba78c07..0f8b1b0f925 100644
--- a/app/serializers/badge_grouping_serializer.rb
+++ b/app/serializers/badge_grouping_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgeGroupingSerializer < ApplicationSerializer
attributes :id, :name, :description, :position, :system
diff --git a/app/serializers/badge_index_serializer.rb b/app/serializers/badge_index_serializer.rb
index 85c013a4b94..81e58b3d9e0 100644
--- a/app/serializers/badge_index_serializer.rb
+++ b/app/serializers/badge_index_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgeIndexSerializer < BadgeSerializer
attributes :has_badge
has_one :badge_grouping
diff --git a/app/serializers/badge_serializer.rb b/app/serializers/badge_serializer.rb
index 3f7929b328c..d75ef6e1c9d 100644
--- a/app/serializers/badge_serializer.rb
+++ b/app/serializers/badge_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgeSerializer < ApplicationSerializer
attributes :id, :name, :description, :grant_count, :allow_title,
:multiple_grant, :icon, :image, :listable, :enabled, :badge_grouping_id,
diff --git a/app/serializers/badge_type_serializer.rb b/app/serializers/badge_type_serializer.rb
index 278315a284c..a8a87fc58a9 100644
--- a/app/serializers/badge_type_serializer.rb
+++ b/app/serializers/badge_type_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgeTypeSerializer < ApplicationSerializer
attributes :id, :name, :sort_order
diff --git a/app/serializers/basic_category_serializer.rb b/app/serializers/basic_category_serializer.rb
index 417eab26c25..abf681437c9 100644
--- a/app/serializers/basic_category_serializer.rb
+++ b/app/serializers/basic_category_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BasicCategorySerializer < ApplicationSerializer
attributes :id,
diff --git a/app/serializers/basic_group_history_serializer.rb b/app/serializers/basic_group_history_serializer.rb
index f413dfb8cae..afd1c60f709 100644
--- a/app/serializers/basic_group_history_serializer.rb
+++ b/app/serializers/basic_group_history_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BasicGroupHistorySerializer < ApplicationSerializer
attributes :action,
:subject,
diff --git a/app/serializers/basic_group_serializer.rb b/app/serializers/basic_group_serializer.rb
index 084a3916608..e2dcce3604c 100644
--- a/app/serializers/basic_group_serializer.rb
+++ b/app/serializers/basic_group_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BasicGroupSerializer < ApplicationSerializer
attributes :id,
:automatic,
diff --git a/app/serializers/basic_group_user_serializer.rb b/app/serializers/basic_group_user_serializer.rb
index 3b402724709..0d61d5d790a 100644
--- a/app/serializers/basic_group_user_serializer.rb
+++ b/app/serializers/basic_group_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BasicGroupUserSerializer < ApplicationSerializer
attributes :group_id, :user_id, :notification_level, :owner
diff --git a/app/serializers/basic_post_serializer.rb b/app/serializers/basic_post_serializer.rb
index bcc75f776e1..564236878a4 100644
--- a/app/serializers/basic_post_serializer.rb
+++ b/app/serializers/basic_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# The most basic attributes of a topic that we need to create a link for it.
class BasicPostSerializer < ApplicationSerializer
attributes :id,
diff --git a/app/serializers/basic_topic_serializer.rb b/app/serializers/basic_topic_serializer.rb
index 5e2cf2c23ca..782925e99c1 100644
--- a/app/serializers/basic_topic_serializer.rb
+++ b/app/serializers/basic_topic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# The most basic attributes of a topic that we need to create a link for it.
class BasicTopicSerializer < ApplicationSerializer
attributes :id, :title, :fancy_title, :slug, :posts_count
diff --git a/app/serializers/basic_user_badge_serializer.rb b/app/serializers/basic_user_badge_serializer.rb
index 5add50db591..510f23b5e65 100644
--- a/app/serializers/basic_user_badge_serializer.rb
+++ b/app/serializers/basic_user_badge_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BasicUserBadgeSerializer < ApplicationSerializer
attributes :id, :granted_at, :count, :grouping_position
diff --git a/app/serializers/basic_user_serializer.rb b/app/serializers/basic_user_serializer.rb
index c7eaa384829..ca979f82d83 100644
--- a/app/serializers/basic_user_serializer.rb
+++ b/app/serializers/basic_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BasicUserSerializer < ApplicationSerializer
attributes :id, :username, :name, :avatar_template
diff --git a/app/serializers/category_and_topic_lists_serializer.rb b/app/serializers/category_and_topic_lists_serializer.rb
index 173b417d463..568ac1255ad 100644
--- a/app/serializers/category_and_topic_lists_serializer.rb
+++ b/app/serializers/category_and_topic_lists_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryAndTopicListsSerializer < ApplicationSerializer
has_one :category_list, serializer: CategoryListSerializer, embed: :objects
has_one :topic_list, serializer: TopicListSerializer, embed: :objects
diff --git a/app/serializers/category_detailed_serializer.rb b/app/serializers/category_detailed_serializer.rb
index 60187e4cd3e..1d9d355299d 100644
--- a/app/serializers/category_detailed_serializer.rb
+++ b/app/serializers/category_detailed_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryDetailedSerializer < BasicCategorySerializer
attributes :topic_count,
diff --git a/app/serializers/category_list_serializer.rb b/app/serializers/category_list_serializer.rb
index d7b3296a819..275108bae92 100644
--- a/app/serializers/category_list_serializer.rb
+++ b/app/serializers/category_list_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryListSerializer < ApplicationSerializer
attributes :can_create_category,
diff --git a/app/serializers/category_serializer.rb b/app/serializers/category_serializer.rb
index e3e7e5d4c46..aa3e46a65ff 100644
--- a/app/serializers/category_serializer.rb
+++ b/app/serializers/category_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategorySerializer < BasicCategorySerializer
attributes :read_restricted,
diff --git a/app/serializers/category_upload_serializer.rb b/app/serializers/category_upload_serializer.rb
index 72ab9885cf7..c2a09db8ea8 100644
--- a/app/serializers/category_upload_serializer.rb
+++ b/app/serializers/category_upload_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategoryUploadSerializer < ApplicationSerializer
attributes :id, :url, :width, :height
end
diff --git a/app/serializers/color_scheme_color_serializer.rb b/app/serializers/color_scheme_color_serializer.rb
index 3e99c06cf20..fdc0e796ad3 100644
--- a/app/serializers/color_scheme_color_serializer.rb
+++ b/app/serializers/color_scheme_color_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ColorSchemeColorSerializer < ApplicationSerializer
attributes :name, :hex, :default_hex
diff --git a/app/serializers/color_scheme_serializer.rb b/app/serializers/color_scheme_serializer.rb
index bbdee26f6c3..7c5237f97fa 100644
--- a/app/serializers/color_scheme_serializer.rb
+++ b/app/serializers/color_scheme_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ColorSchemeSerializer < ApplicationSerializer
attributes :id, :name, :is_base, :base_scheme_id, :theme_id, :theme_name
has_many :colors, serializer: ColorSchemeColorSerializer, embed: :objects
diff --git a/app/serializers/concerns/email_logs_mixin.rb b/app/serializers/concerns/email_logs_mixin.rb
index 1e3470e2b73..f0fe239309a 100644
--- a/app/serializers/concerns/email_logs_mixin.rb
+++ b/app/serializers/concerns/email_logs_mixin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module EmailLogsMixin
def self.included(klass)
klass.attributes :id,
diff --git a/app/serializers/concerns/topic_tags_mixin.rb b/app/serializers/concerns/topic_tags_mixin.rb
index 28f96a3da5d..58841188b07 100644
--- a/app/serializers/concerns/topic_tags_mixin.rb
+++ b/app/serializers/concerns/topic_tags_mixin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module TopicTagsMixin
def self.included(klass)
klass.attributes :tags
diff --git a/app/serializers/concerns/user_auth_tokens_mixin.rb b/app/serializers/concerns/user_auth_tokens_mixin.rb
index 4cb432d86c5..a5d88a0c197 100644
--- a/app/serializers/concerns/user_auth_tokens_mixin.rb
+++ b/app/serializers/concerns/user_auth_tokens_mixin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'browser_detection'
require_dependency 'discourse_ip_info'
diff --git a/app/serializers/concerns/user_primary_group_mixin.rb b/app/serializers/concerns/user_primary_group_mixin.rb
index 43f7d90e25f..78b921a1a93 100644
--- a/app/serializers/concerns/user_primary_group_mixin.rb
+++ b/app/serializers/concerns/user_primary_group_mixin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module UserPrimaryGroupMixin
def self.included(klass)
diff --git a/app/serializers/current_user_serializer.rb b/app/serializers/current_user_serializer.rb
index 20bad77d006..ad2501a64d4 100644
--- a/app/serializers/current_user_serializer.rb
+++ b/app/serializers/current_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'new_post_manager'
class CurrentUserSerializer < BasicUserSerializer
diff --git a/app/serializers/detailed_user_badge_serializer.rb b/app/serializers/detailed_user_badge_serializer.rb
index 91c52562dfd..ec84bac004f 100644
--- a/app/serializers/detailed_user_badge_serializer.rb
+++ b/app/serializers/detailed_user_badge_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DetailedUserBadgeSerializer < BasicUserBadgeSerializer
has_one :granted_by, serializer: UserBadgeSerializer::UserSerializer
diff --git a/app/serializers/directory_item_serializer.rb b/app/serializers/directory_item_serializer.rb
index a81430b22c9..80187cabb6d 100644
--- a/app/serializers/directory_item_serializer.rb
+++ b/app/serializers/directory_item_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DirectoryItemSerializer < ApplicationSerializer
class UserSerializer < UserNameSerializer
diff --git a/app/serializers/directory_serializer.rb b/app/serializers/directory_serializer.rb
index 415d9b7bf60..320e525a0e2 100644
--- a/app/serializers/directory_serializer.rb
+++ b/app/serializers/directory_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DirectorySerializer < ApplicationSerializer
attributes :id
has_many :directory_items, serializer: DirectoryItemSerializer, embed: :objects
diff --git a/app/serializers/discourse_version_check_serializer.rb b/app/serializers/discourse_version_check_serializer.rb
index e6f38e8698d..42b2c32daf4 100644
--- a/app/serializers/discourse_version_check_serializer.rb
+++ b/app/serializers/discourse_version_check_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiscourseVersionCheckSerializer < ApplicationSerializer
attributes :latest_version,
:critical_updates,
diff --git a/app/serializers/draft_serializer.rb b/app/serializers/draft_serializer.rb
index 52399d3588d..1d19f0d18b6 100644
--- a/app/serializers/draft_serializer.rb
+++ b/app/serializers/draft_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'post_item_excerpt'
class DraftSerializer < ApplicationSerializer
diff --git a/app/serializers/email_log_serializer.rb b/app/serializers/email_log_serializer.rb
index 8b4897ba517..2744d19a317 100644
--- a/app/serializers/email_log_serializer.rb
+++ b/app/serializers/email_log_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmailLogSerializer < ApplicationSerializer
include EmailLogsMixin
diff --git a/app/serializers/embeddable_host_serializer.rb b/app/serializers/embeddable_host_serializer.rb
index 1d51c9fc8b2..c06b7151425 100644
--- a/app/serializers/embeddable_host_serializer.rb
+++ b/app/serializers/embeddable_host_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmbeddableHostSerializer < ApplicationSerializer
TO_SERIALIZE = [:id, :host, :path_whitelist, :class_name, :category_id]
diff --git a/app/serializers/embedding_serializer.rb b/app/serializers/embedding_serializer.rb
index 9ab41895359..dcb546d8db1 100644
--- a/app/serializers/embedding_serializer.rb
+++ b/app/serializers/embedding_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmbeddingSerializer < ApplicationSerializer
attributes :id, :fields, :base_url
attributes *Embedding.settings
diff --git a/app/serializers/emoji_serializer.rb b/app/serializers/emoji_serializer.rb
index c17520490e4..2e45b034151 100644
--- a/app/serializers/emoji_serializer.rb
+++ b/app/serializers/emoji_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmojiSerializer < ApplicationSerializer
attributes :name, :url
end
diff --git a/app/serializers/flagged_topic_serializer.rb b/app/serializers/flagged_topic_serializer.rb
index bf6bcf4df01..a4390b7e3ea 100644
--- a/app/serializers/flagged_topic_serializer.rb
+++ b/app/serializers/flagged_topic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FlaggedTopicSerializer < ActiveModel::Serializer
attributes :id,
:title,
diff --git a/app/serializers/flagged_topic_summary_serializer.rb b/app/serializers/flagged_topic_summary_serializer.rb
index f29c365a468..0679e1ac4b0 100644
--- a/app/serializers/flagged_topic_summary_serializer.rb
+++ b/app/serializers/flagged_topic_summary_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FlaggedTopicSummarySerializer < ActiveModel::Serializer
attributes(
diff --git a/app/serializers/flagged_user_serializer.rb b/app/serializers/flagged_user_serializer.rb
index d7c703e0fe7..51fc0b83283 100644
--- a/app/serializers/flagged_user_serializer.rb
+++ b/app/serializers/flagged_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FlaggedUserSerializer < BasicUserSerializer
attributes :can_delete_all_posts,
:can_be_deleted,
diff --git a/app/serializers/gap_serializer.rb b/app/serializers/gap_serializer.rb
index eabaee11097..6b950ffa0fc 100644
--- a/app/serializers/gap_serializer.rb
+++ b/app/serializers/gap_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GapSerializer < ApplicationSerializer
attributes :before, :after
diff --git a/app/serializers/group_post_serializer.rb b/app/serializers/group_post_serializer.rb
index f21802cfbda..29584bb8a63 100644
--- a/app/serializers/group_post_serializer.rb
+++ b/app/serializers/group_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'post_item_excerpt'
class GroupPostSerializer < ApplicationSerializer
diff --git a/app/serializers/group_post_user_serializer.rb b/app/serializers/group_post_user_serializer.rb
index 5a69f23fbc5..308535bfb6a 100644
--- a/app/serializers/group_post_user_serializer.rb
+++ b/app/serializers/group_post_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupPostUserSerializer < BasicUserSerializer
attributes :title, :name
end
diff --git a/app/serializers/group_requester_serializer.rb b/app/serializers/group_requester_serializer.rb
index 4fda1153e3a..967232339e8 100644
--- a/app/serializers/group_requester_serializer.rb
+++ b/app/serializers/group_requester_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupRequesterSerializer < BasicUserSerializer
attributes :reason, :requested_at
end
diff --git a/app/serializers/group_show_serializer.rb b/app/serializers/group_show_serializer.rb
index 2772e08c4fa..f1440c1e9df 100644
--- a/app/serializers/group_show_serializer.rb
+++ b/app/serializers/group_show_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupShowSerializer < BasicGroupSerializer
attributes :is_group_user, :is_group_owner, :is_group_owner_display, :mentionable, :messageable
diff --git a/app/serializers/group_user_serializer.rb b/app/serializers/group_user_serializer.rb
index 43f7fbc0624..4b79988877a 100644
--- a/app/serializers/group_user_serializer.rb
+++ b/app/serializers/group_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupUserSerializer < BasicUserSerializer
include UserPrimaryGroupMixin
diff --git a/app/serializers/grouped_screened_url_serializer.rb b/app/serializers/grouped_screened_url_serializer.rb
index c57bb8c30a9..9e2a4a1ff71 100644
--- a/app/serializers/grouped_screened_url_serializer.rb
+++ b/app/serializers/grouped_screened_url_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupedScreenedUrlSerializer < ApplicationSerializer
attributes :domain,
:action,
diff --git a/app/serializers/grouped_search_result_serializer.rb b/app/serializers/grouped_search_result_serializer.rb
index b6dac302143..15d2436cc7d 100644
--- a/app/serializers/grouped_search_result_serializer.rb
+++ b/app/serializers/grouped_search_result_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupedSearchResultSerializer < ApplicationSerializer
has_many :posts, serializer: SearchPostSerializer
has_many :users, serializer: SearchResultUserSerializer
diff --git a/app/serializers/hidden_profile_serializer.rb b/app/serializers/hidden_profile_serializer.rb
index fc48024cf03..f2a04db807b 100644
--- a/app/serializers/hidden_profile_serializer.rb
+++ b/app/serializers/hidden_profile_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class HiddenProfileSerializer < BasicUserSerializer
attributes(
:profile_hidden?,
diff --git a/app/serializers/incoming_email_details_serializer.rb b/app/serializers/incoming_email_details_serializer.rb
index 68959ebb1fa..420951bb8bb 100644
--- a/app/serializers/incoming_email_details_serializer.rb
+++ b/app/serializers/incoming_email_details_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncomingEmailDetailsSerializer < ApplicationSerializer
attributes :error,
diff --git a/app/serializers/incoming_email_serializer.rb b/app/serializers/incoming_email_serializer.rb
index 006ea9c3306..54830995a12 100644
--- a/app/serializers/incoming_email_serializer.rb
+++ b/app/serializers/incoming_email_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncomingEmailSerializer < ApplicationSerializer
attributes :id,
diff --git a/app/serializers/invite_serializer.rb b/app/serializers/invite_serializer.rb
index 4180eda4ee0..26b5c1794fb 100644
--- a/app/serializers/invite_serializer.rb
+++ b/app/serializers/invite_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class InviteSerializer < ApplicationSerializer
attributes :email, :created_at, :redeemed_at, :expired, :user
diff --git a/app/serializers/invited_user_serializer.rb b/app/serializers/invited_user_serializer.rb
index 3c1cb69d3cd..f793871f49b 100644
--- a/app/serializers/invited_user_serializer.rb
+++ b/app/serializers/invited_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class InvitedUserSerializer < BasicUserSerializer
attributes :topics_entered,
diff --git a/app/serializers/listable_topic_serializer.rb b/app/serializers/listable_topic_serializer.rb
index c7938f5d63e..0d4208c5bfd 100644
--- a/app/serializers/listable_topic_serializer.rb
+++ b/app/serializers/listable_topic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'pinned_check'
class ListableTopicSerializer < BasicTopicSerializer
diff --git a/app/serializers/new_post_result_serializer.rb b/app/serializers/new_post_result_serializer.rb
index 39da1ecfe25..3031348da70 100644
--- a/app/serializers/new_post_result_serializer.rb
+++ b/app/serializers/new_post_result_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'application_serializer'
class NewPostResultSerializer < ApplicationSerializer
diff --git a/app/serializers/notification_serializer.rb b/app/serializers/notification_serializer.rb
index 960b65f91e1..34780b86a6e 100644
--- a/app/serializers/notification_serializer.rb
+++ b/app/serializers/notification_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NotificationSerializer < ApplicationSerializer
attributes :id,
diff --git a/app/serializers/penalty_counts_serializer.rb b/app/serializers/penalty_counts_serializer.rb
index 94f5722ee0d..d5b49772a19 100644
--- a/app/serializers/penalty_counts_serializer.rb
+++ b/app/serializers/penalty_counts_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PenaltyCountsSerializer < ApplicationSerializer
attributes :silenced, :suspended, :total
diff --git a/app/serializers/permalink_serializer.rb b/app/serializers/permalink_serializer.rb
index 467e07c5864..89189100c44 100644
--- a/app/serializers/permalink_serializer.rb
+++ b/app/serializers/permalink_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PermalinkSerializer < ApplicationSerializer
attributes :id, :url, :topic_id, :topic_title, :topic_url,
:post_id, :post_url, :post_number, :post_topic_title,
diff --git a/app/serializers/post_action_type_serializer.rb b/app/serializers/post_action_type_serializer.rb
index ecb9d6ecff1..f6aec434994 100644
--- a/app/serializers/post_action_type_serializer.rb
+++ b/app/serializers/post_action_type_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'configurable_urls'
class PostActionTypeSerializer < ApplicationSerializer
diff --git a/app/serializers/post_action_user_serializer.rb b/app/serializers/post_action_user_serializer.rb
index 7a63768f00a..c1413c40459 100644
--- a/app/serializers/post_action_user_serializer.rb
+++ b/app/serializers/post_action_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostActionUserSerializer < BasicUserSerializer
attributes :post_url,
:username_lower
diff --git a/app/serializers/post_item_excerpt.rb b/app/serializers/post_item_excerpt.rb
index 7f0cc6322b2..e7f9f004153 100644
--- a/app/serializers/post_item_excerpt.rb
+++ b/app/serializers/post_item_excerpt.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module PostItemExcerpt
def self.included(base)
diff --git a/app/serializers/post_revision_serializer.rb b/app/serializers/post_revision_serializer.rb
index 4278f52dad4..415999e8e95 100644
--- a/app/serializers/post_revision_serializer.rb
+++ b/app/serializers/post_revision_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostRevisionSerializer < ApplicationSerializer
attributes :created_at,
diff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rb
index ea40b605055..2221359aafd 100644
--- a/app/serializers/post_serializer.rb
+++ b/app/serializers/post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostSerializer < BasicPostSerializer
# To pass in additional information we might need
diff --git a/app/serializers/post_stream_serializer_mixin.rb b/app/serializers/post_stream_serializer_mixin.rb
index efe69a9285d..794b1bffb44 100644
--- a/app/serializers/post_stream_serializer_mixin.rb
+++ b/app/serializers/post_stream_serializer_mixin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'gap_serializer'
require_dependency 'post_serializer'
require_dependency 'timeline_lookup'
diff --git a/app/serializers/post_wordpress_serializer.rb b/app/serializers/post_wordpress_serializer.rb
index a7bee3708e2..a415d225833 100644
--- a/app/serializers/post_wordpress_serializer.rb
+++ b/app/serializers/post_wordpress_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# The most basic attributes of a topic that we need to create a link for it.
class PostWordpressSerializer < BasicPostSerializer
attributes :post_number
diff --git a/app/serializers/primary_group_serializer.rb b/app/serializers/primary_group_serializer.rb
index c9f7130e4e0..b46d389f8ab 100644
--- a/app/serializers/primary_group_serializer.rb
+++ b/app/serializers/primary_group_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PrimaryGroupSerializer < ApplicationSerializer
attributes :id, :name, :flair_url, :flair_bg_color, :flair_color
end
diff --git a/app/serializers/queued_post_serializer.rb b/app/serializers/queued_post_serializer.rb
index 4b5f25550b6..a0e51ab133e 100644
--- a/app/serializers/queued_post_serializer.rb
+++ b/app/serializers/queued_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Deprecated, should be removed once users have sufficient opportunity to do so
class QueuedPostSerializer < ApplicationSerializer
diff --git a/app/serializers/reviewable_action_serializer.rb b/app/serializers/reviewable_action_serializer.rb
index 6942ccd0f59..6fd1f889ac5 100644
--- a/app/serializers/reviewable_action_serializer.rb
+++ b/app/serializers/reviewable_action_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableActionSerializer < ApplicationSerializer
attributes :id, :icon, :label, :confirm_message, :description, :client_action
diff --git a/app/serializers/reviewable_bundled_action_serializer.rb b/app/serializers/reviewable_bundled_action_serializer.rb
index ecce2fae472..45875ac2bdb 100644
--- a/app/serializers/reviewable_bundled_action_serializer.rb
+++ b/app/serializers/reviewable_bundled_action_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableBundledActionSerializer < ApplicationSerializer
attributes :id, :icon, :label
has_many :actions, serializer: ReviewableActionSerializer, root: 'actions'
diff --git a/app/serializers/reviewable_conversation_post_serializer.rb b/app/serializers/reviewable_conversation_post_serializer.rb
index 026289ed6cf..cccd746b364 100644
--- a/app/serializers/reviewable_conversation_post_serializer.rb
+++ b/app/serializers/reviewable_conversation_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableConversationPostSerializer < ApplicationSerializer
attributes :id, :excerpt
has_one :user, serializer: BasicUserSerializer, root: 'users'
diff --git a/app/serializers/reviewable_conversation_serializer.rb b/app/serializers/reviewable_conversation_serializer.rb
index d31d0fccdaa..6f3248f086a 100644
--- a/app/serializers/reviewable_conversation_serializer.rb
+++ b/app/serializers/reviewable_conversation_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableConversationSerializer < ApplicationSerializer
attributes :id, :permalink, :has_more
has_many :conversation_posts, serializer: ReviewableConversationPostSerializer
diff --git a/app/serializers/reviewable_editable_field_serializer.rb b/app/serializers/reviewable_editable_field_serializer.rb
index d169b69c599..df66dbdfeae 100644
--- a/app/serializers/reviewable_editable_field_serializer.rb
+++ b/app/serializers/reviewable_editable_field_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableEditableFieldSerializer < ApplicationSerializer
attributes :id, :type
end
diff --git a/app/serializers/reviewable_flagged_post_serializer.rb b/app/serializers/reviewable_flagged_post_serializer.rb
index d4e8c8111ce..9a0e28c72e1 100644
--- a/app/serializers/reviewable_flagged_post_serializer.rb
+++ b/app/serializers/reviewable_flagged_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableFlaggedPostSerializer < ReviewableSerializer
target_attributes :cooked, :raw, :reply_count
attributes :blank_post, :post_updated_at, :post_version
diff --git a/app/serializers/reviewable_history_serializer.rb b/app/serializers/reviewable_history_serializer.rb
index afd937ecaa9..16733219ce7 100644
--- a/app/serializers/reviewable_history_serializer.rb
+++ b/app/serializers/reviewable_history_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableHistorySerializer < ApplicationSerializer
attributes :id, :reviewable_history_type, :status, :created_at
diff --git a/app/serializers/reviewable_perform_result_serializer.rb b/app/serializers/reviewable_perform_result_serializer.rb
index d48964a40f7..e0a7695eb18 100644
--- a/app/serializers/reviewable_perform_result_serializer.rb
+++ b/app/serializers/reviewable_perform_result_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewablePerformResultSerializer < ApplicationSerializer
attributes(
diff --git a/app/serializers/reviewable_queued_post_serializer.rb b/app/serializers/reviewable_queued_post_serializer.rb
index a6e97f7d26a..fa29213ff31 100644
--- a/app/serializers/reviewable_queued_post_serializer.rb
+++ b/app/serializers/reviewable_queued_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableQueuedPostSerializer < ReviewableSerializer
payload_attributes(
diff --git a/app/serializers/reviewable_score_bonus_serializer.rb b/app/serializers/reviewable_score_bonus_serializer.rb
index 9917bd15fd1..45ea585c803 100644
--- a/app/serializers/reviewable_score_bonus_serializer.rb
+++ b/app/serializers/reviewable_score_bonus_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableScoreBonusSerializer < ApplicationSerializer
attributes :id, :name, :score_bonus
diff --git a/app/serializers/reviewable_score_serializer.rb b/app/serializers/reviewable_score_serializer.rb
index f5180d8f766..d5e54257dc0 100644
--- a/app/serializers/reviewable_score_serializer.rb
+++ b/app/serializers/reviewable_score_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'reviewable_score_type_serializer'
class ReviewableScoreSerializer < ApplicationSerializer
diff --git a/app/serializers/reviewable_score_type_serializer.rb b/app/serializers/reviewable_score_type_serializer.rb
index 1bb877e96da..9320e751212 100644
--- a/app/serializers/reviewable_score_type_serializer.rb
+++ b/app/serializers/reviewable_score_type_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableScoreTypeSerializer < ApplicationSerializer
attributes :id, :title, :score_bonus, :icon
diff --git a/app/serializers/reviewable_serializer.rb b/app/serializers/reviewable_serializer.rb
index 1836e8da062..8969f472a30 100644
--- a/app/serializers/reviewable_serializer.rb
+++ b/app/serializers/reviewable_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'reviewable_action_serializer'
require_dependency 'reviewable_editable_field_serializer'
diff --git a/app/serializers/reviewable_settings_serializer.rb b/app/serializers/reviewable_settings_serializer.rb
index 64b83ce23bd..96e5573149c 100644
--- a/app/serializers/reviewable_settings_serializer.rb
+++ b/app/serializers/reviewable_settings_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableSettingsSerializer < ApplicationSerializer
attributes :id
diff --git a/app/serializers/reviewable_topic_serializer.rb b/app/serializers/reviewable_topic_serializer.rb
index 5925da73a16..70e0d7fa036 100644
--- a/app/serializers/reviewable_topic_serializer.rb
+++ b/app/serializers/reviewable_topic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableTopicSerializer < ApplicationSerializer
attributes(
:id,
diff --git a/app/serializers/reviewable_user_serializer.rb b/app/serializers/reviewable_user_serializer.rb
index 5e3345478ee..8785d0c59d3 100644
--- a/app/serializers/reviewable_user_serializer.rb
+++ b/app/serializers/reviewable_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReviewableUserSerializer < ReviewableSerializer
attributes :link_admin, :user_fields
diff --git a/app/serializers/screened_email_serializer.rb b/app/serializers/screened_email_serializer.rb
index 44d28af23d5..bb38bd9093e 100644
--- a/app/serializers/screened_email_serializer.rb
+++ b/app/serializers/screened_email_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ScreenedEmailSerializer < ApplicationSerializer
attributes :email,
:action,
diff --git a/app/serializers/screened_ip_address_serializer.rb b/app/serializers/screened_ip_address_serializer.rb
index 54e9922d58e..f833e0b5fd2 100644
--- a/app/serializers/screened_ip_address_serializer.rb
+++ b/app/serializers/screened_ip_address_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ScreenedIpAddressSerializer < ApplicationSerializer
attributes :id,
:ip_address,
diff --git a/app/serializers/screened_url_serializer.rb b/app/serializers/screened_url_serializer.rb
index 6768ae10be9..7c071349fae 100644
--- a/app/serializers/screened_url_serializer.rb
+++ b/app/serializers/screened_url_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ScreenedUrlSerializer < ApplicationSerializer
attributes :url,
:domain,
diff --git a/app/serializers/search_logs_serializer.rb b/app/serializers/search_logs_serializer.rb
index 9191a2e434c..81f70e0694c 100644
--- a/app/serializers/search_logs_serializer.rb
+++ b/app/serializers/search_logs_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SearchLogsSerializer < ApplicationSerializer
attributes :term,
:searches,
diff --git a/app/serializers/search_post_serializer.rb b/app/serializers/search_post_serializer.rb
index 7664e855d10..0759dac792f 100644
--- a/app/serializers/search_post_serializer.rb
+++ b/app/serializers/search_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SearchPostSerializer < BasicPostSerializer
has_one :topic, serializer: SearchTopicListItemSerializer
diff --git a/app/serializers/search_result_user_serializer.rb b/app/serializers/search_result_user_serializer.rb
index bf4d4bae8ec..9104e53ad1e 100644
--- a/app/serializers/search_result_user_serializer.rb
+++ b/app/serializers/search_result_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SearchResultUserSerializer < BasicUserSerializer
attributes :name
end
diff --git a/app/serializers/search_topic_list_item_serializer.rb b/app/serializers/search_topic_list_item_serializer.rb
index 29640c13d05..faf1322ff6a 100644
--- a/app/serializers/search_topic_list_item_serializer.rb
+++ b/app/serializers/search_topic_list_item_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SearchTopicListItemSerializer < ListableTopicSerializer
include TopicTagsMixin
diff --git a/app/serializers/similar_topic_serializer.rb b/app/serializers/similar_topic_serializer.rb
index 9e6e067e90a..68d6ec73744 100644
--- a/app/serializers/similar_topic_serializer.rb
+++ b/app/serializers/similar_topic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SimilarTopicSerializer < ApplicationSerializer
has_one :topic, serializer: TopicListItemSerializer, embed: :ids
diff --git a/app/serializers/single_sign_on_record_serializer.rb b/app/serializers/single_sign_on_record_serializer.rb
index d55f6678149..bf33523a35e 100644
--- a/app/serializers/single_sign_on_record_serializer.rb
+++ b/app/serializers/single_sign_on_record_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SingleSignOnRecordSerializer < ApplicationSerializer
attributes :user_id, :external_id,
:last_payload, :created_at,
diff --git a/app/serializers/site_serializer.rb b/app/serializers/site_serializer.rb
index 58d3046be30..1b08914efde 100644
--- a/app/serializers/site_serializer.rb
+++ b/app/serializers/site_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse_tagging'
require_dependency 'wizard'
require_dependency 'wizard/builder'
diff --git a/app/serializers/site_text_serializer.rb b/app/serializers/site_text_serializer.rb
index f0e3c1e4c3e..0b7af1e2c4f 100644
--- a/app/serializers/site_text_serializer.rb
+++ b/app/serializers/site_text_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SiteTextSerializer < ApplicationSerializer
attributes :id, :value, :overridden?, :can_revert?
diff --git a/app/serializers/skipped_email_log_serializer.rb b/app/serializers/skipped_email_log_serializer.rb
index 9527f6f8c76..50e1af393d9 100644
--- a/app/serializers/skipped_email_log_serializer.rb
+++ b/app/serializers/skipped_email_log_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SkippedEmailLogSerializer < ApplicationSerializer
include EmailLogsMixin
diff --git a/app/serializers/staff_action_logs_serializer.rb b/app/serializers/staff_action_logs_serializer.rb
index ea887cb4a8e..a9830f5df9d 100644
--- a/app/serializers/staff_action_logs_serializer.rb
+++ b/app/serializers/staff_action_logs_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class StaffActionLogsSerializer < ApplicationSerializer
attributes :user_history_actions
has_many :staff_action_logs, serializer: UserHistorySerializer, embed: :objects
diff --git a/app/serializers/suggested_topic_serializer.rb b/app/serializers/suggested_topic_serializer.rb
index a2dcdef6b17..f2ad535fbbe 100644
--- a/app/serializers/suggested_topic_serializer.rb
+++ b/app/serializers/suggested_topic_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SuggestedTopicSerializer < ListableTopicSerializer
include TopicTagsMixin
diff --git a/app/serializers/suggested_topics_mixin.rb b/app/serializers/suggested_topics_mixin.rb
index e17a4a773f6..9fca424b0f5 100644
--- a/app/serializers/suggested_topics_mixin.rb
+++ b/app/serializers/suggested_topics_mixin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SuggestedTopicsMixin
def self.included(klass)
klass.attributes :related_messages
diff --git a/app/serializers/tag_group_serializer.rb b/app/serializers/tag_group_serializer.rb
index cdfec08ef64..3fa051bfa96 100644
--- a/app/serializers/tag_group_serializer.rb
+++ b/app/serializers/tag_group_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TagGroupSerializer < ApplicationSerializer
attributes :id, :name, :tag_names, :parent_tag_name, :one_per_topic, :permissions
diff --git a/app/serializers/tag_serializer.rb b/app/serializers/tag_serializer.rb
index 5169ea1a65a..696eb3c0378 100644
--- a/app/serializers/tag_serializer.rb
+++ b/app/serializers/tag_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TagSerializer < ApplicationSerializer
attributes :id, :name, :topic_count, :staff
diff --git a/app/serializers/theme_serializer.rb b/app/serializers/theme_serializer.rb
index 645285de28c..fce406ef257 100644
--- a/app/serializers/theme_serializer.rb
+++ b/app/serializers/theme_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'base64'
class ThemeFieldSerializer < ApplicationSerializer
diff --git a/app/serializers/theme_settings_serializer.rb b/app/serializers/theme_settings_serializer.rb
index 1bd892f7557..316a403f045 100644
--- a/app/serializers/theme_settings_serializer.rb
+++ b/app/serializers/theme_settings_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeSettingsSerializer < ApplicationSerializer
attributes :setting, :type, :default, :value, :description, :valid_values,
:list_type, :textarea
diff --git a/app/serializers/theme_translation_serializer.rb b/app/serializers/theme_translation_serializer.rb
index b1ad8967b5d..93a3718b8ae 100644
--- a/app/serializers/theme_translation_serializer.rb
+++ b/app/serializers/theme_translation_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeTranslationSerializer < ApplicationSerializer
attributes :key, :value, :default
end
diff --git a/app/serializers/top_list_serializer.rb b/app/serializers/top_list_serializer.rb
index 464bc58d2a0..195f92217d1 100644
--- a/app/serializers/top_list_serializer.rb
+++ b/app/serializers/top_list_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopListSerializer < ApplicationSerializer
attributes :can_create_topic,
diff --git a/app/serializers/topic_embed_serializer.rb b/app/serializers/topic_embed_serializer.rb
index ac06bf1f3ba..d31ab6e89a9 100644
--- a/app/serializers/topic_embed_serializer.rb
+++ b/app/serializers/topic_embed_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicEmbedSerializer < ApplicationSerializer
attributes \
:topic_id,
diff --git a/app/serializers/topic_flag_type_serializer.rb b/app/serializers/topic_flag_type_serializer.rb
index 4caa98a6985..6532f4918db 100644
--- a/app/serializers/topic_flag_type_serializer.rb
+++ b/app/serializers/topic_flag_type_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicFlagTypeSerializer < PostActionTypeSerializer
protected
diff --git a/app/serializers/topic_link_serializer.rb b/app/serializers/topic_link_serializer.rb
index 4ef9afc65b0..d3d3fb686c4 100644
--- a/app/serializers/topic_link_serializer.rb
+++ b/app/serializers/topic_link_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicLinkSerializer < ApplicationSerializer
attributes :url,
diff --git a/app/serializers/topic_list_item_serializer.rb b/app/serializers/topic_list_item_serializer.rb
index 1f77b45d751..658df936143 100644
--- a/app/serializers/topic_list_item_serializer.rb
+++ b/app/serializers/topic_list_item_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicListItemSerializer < ListableTopicSerializer
include TopicTagsMixin
diff --git a/app/serializers/topic_list_serializer.rb b/app/serializers/topic_list_serializer.rb
index 6ee27854ca8..2766f9c30b7 100644
--- a/app/serializers/topic_list_serializer.rb
+++ b/app/serializers/topic_list_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicListSerializer < ApplicationSerializer
attributes :can_create_topic,
diff --git a/app/serializers/topic_pending_post_serializer.rb b/app/serializers/topic_pending_post_serializer.rb
index 568f9b6eab4..c07fc479e5e 100644
--- a/app/serializers/topic_pending_post_serializer.rb
+++ b/app/serializers/topic_pending_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicPendingPostSerializer < ApplicationSerializer
attributes :id, :raw, :created_at
diff --git a/app/serializers/topic_post_count_serializer.rb b/app/serializers/topic_post_count_serializer.rb
index 70cac7fa574..8baae1e4d46 100644
--- a/app/serializers/topic_post_count_serializer.rb
+++ b/app/serializers/topic_post_count_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicPostCountSerializer < BasicUserSerializer
attributes :post_count, :primary_group_name,
diff --git a/app/serializers/topic_poster_serializer.rb b/app/serializers/topic_poster_serializer.rb
index 9d182b9121d..41c4b7ba807 100644
--- a/app/serializers/topic_poster_serializer.rb
+++ b/app/serializers/topic_poster_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicPosterSerializer < ApplicationSerializer
attributes :extras, :description
has_one :user, serializer: BasicUserSerializer
diff --git a/app/serializers/topic_timer_serializer.rb b/app/serializers/topic_timer_serializer.rb
index 75867d785d8..1c736edc0e2 100644
--- a/app/serializers/topic_timer_serializer.rb
+++ b/app/serializers/topic_timer_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicTimerSerializer < ApplicationSerializer
attributes :id,
:execute_at,
diff --git a/app/serializers/topic_tracking_state_serializer.rb b/app/serializers/topic_tracking_state_serializer.rb
index f023863bfbd..b200ca82e30 100644
--- a/app/serializers/topic_tracking_state_serializer.rb
+++ b/app/serializers/topic_tracking_state_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicTrackingStateSerializer < ApplicationSerializer
attributes :topic_id,
:highest_post_number,
diff --git a/app/serializers/topic_view_details_serializer.rb b/app/serializers/topic_view_details_serializer.rb
index fd4697a3827..c80ba6dece8 100644
--- a/app/serializers/topic_view_details_serializer.rb
+++ b/app/serializers/topic_view_details_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicViewDetailsSerializer < ApplicationSerializer
def self.can_attributes
diff --git a/app/serializers/topic_view_posts_serializer.rb b/app/serializers/topic_view_posts_serializer.rb
index 4fbd733051a..8afcac3e9ff 100644
--- a/app/serializers/topic_view_posts_serializer.rb
+++ b/app/serializers/topic_view_posts_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicViewPostsSerializer < ApplicationSerializer
include PostStreamSerializerMixin
include SuggestedTopicsMixin
diff --git a/app/serializers/topic_view_serializer.rb b/app/serializers/topic_view_serializer.rb
index 48ffd7d4bca..abcfdb8af85 100644
--- a/app/serializers/topic_view_serializer.rb
+++ b/app/serializers/topic_view_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'pinned_check'
require_dependency 'new_post_manager'
diff --git a/app/serializers/topic_view_wordpress_serializer.rb b/app/serializers/topic_view_wordpress_serializer.rb
index 0abd713e644..d7274d5a4b6 100644
--- a/app/serializers/topic_view_wordpress_serializer.rb
+++ b/app/serializers/topic_view_wordpress_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicViewWordpressSerializer < ApplicationSerializer
# These attributes will be delegated to the topic
diff --git a/app/serializers/trust_level3_requirements_serializer.rb b/app/serializers/trust_level3_requirements_serializer.rb
index 371619ccc05..6f5a726830b 100644
--- a/app/serializers/trust_level3_requirements_serializer.rb
+++ b/app/serializers/trust_level3_requirements_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'penalty_counts_serializer'
class TrustLevel3RequirementsSerializer < ApplicationSerializer
diff --git a/app/serializers/trust_level_serializer.rb b/app/serializers/trust_level_serializer.rb
index b2ce92a4589..c41495ff3e0 100644
--- a/app/serializers/trust_level_serializer.rb
+++ b/app/serializers/trust_level_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TrustLevelSerializer < ApplicationSerializer
attributes :id, :name
diff --git a/app/serializers/upload_serializer.rb b/app/serializers/upload_serializer.rb
index 5aeee2261f2..95fd83cf5e1 100644
--- a/app/serializers/upload_serializer.rb
+++ b/app/serializers/upload_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UploadSerializer < ApplicationSerializer
attributes :id,
:url,
diff --git a/app/serializers/user_action_serializer.rb b/app/serializers/user_action_serializer.rb
index 2aec75ceede..a218ae83660 100644
--- a/app/serializers/user_action_serializer.rb
+++ b/app/serializers/user_action_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'post_item_excerpt'
class UserActionSerializer < ApplicationSerializer
diff --git a/app/serializers/user_auth_token_log_serializer.rb b/app/serializers/user_auth_token_log_serializer.rb
index 220d9aa477e..0a676f8c7c1 100644
--- a/app/serializers/user_auth_token_log_serializer.rb
+++ b/app/serializers/user_auth_token_log_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserAuthTokenLogSerializer < ApplicationSerializer
include UserAuthTokensMixin
diff --git a/app/serializers/user_auth_token_serializer.rb b/app/serializers/user_auth_token_serializer.rb
index b033ac66a55..2fac32872ac 100644
--- a/app/serializers/user_auth_token_serializer.rb
+++ b/app/serializers/user_auth_token_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserAuthTokenSerializer < ApplicationSerializer
include UserAuthTokensMixin
diff --git a/app/serializers/user_badge_serializer.rb b/app/serializers/user_badge_serializer.rb
index 3c739517485..5ff905714db 100644
--- a/app/serializers/user_badge_serializer.rb
+++ b/app/serializers/user_badge_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserBadgeSerializer < ApplicationSerializer
class UserSerializer < BasicUserSerializer
diff --git a/app/serializers/user_badges_serializer.rb b/app/serializers/user_badges_serializer.rb
index 178438b177f..189e5f6a9dc 100644
--- a/app/serializers/user_badges_serializer.rb
+++ b/app/serializers/user_badges_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserBadgesSerializer < ApplicationSerializer
has_many :user_badges, embed: :objects
attributes :grant_count, :username
diff --git a/app/serializers/user_field_serializer.rb b/app/serializers/user_field_serializer.rb
index 22aef424fe0..0da8f956f4f 100644
--- a/app/serializers/user_field_serializer.rb
+++ b/app/serializers/user_field_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserFieldSerializer < ApplicationSerializer
attributes :id,
:name,
diff --git a/app/serializers/user_history_serializer.rb b/app/serializers/user_history_serializer.rb
index f73d3e424b2..be3f26c97de 100644
--- a/app/serializers/user_history_serializer.rb
+++ b/app/serializers/user_history_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserHistorySerializer < ApplicationSerializer
attributes :action_name,
:details,
diff --git a/app/serializers/user_name_serializer.rb b/app/serializers/user_name_serializer.rb
index 3d7fc0d1f87..500cc6794fc 100644
--- a/app/serializers/user_name_serializer.rb
+++ b/app/serializers/user_name_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserNameSerializer < BasicUserSerializer
attributes :name, :title
end
diff --git a/app/serializers/user_option_serializer.rb b/app/serializers/user_option_serializer.rb
index 57a8dede499..646ae4a9868 100644
--- a/app/serializers/user_option_serializer.rb
+++ b/app/serializers/user_option_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserOptionSerializer < ApplicationSerializer
attributes :user_id,
:mailing_list_mode,
diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb
index 9eb8cbc96ce..a093c836e9a 100644
--- a/app/serializers/user_serializer.rb
+++ b/app/serializers/user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserSerializer < BasicUserSerializer
attr_accessor :omit_stats,
diff --git a/app/serializers/user_summary_serializer.rb b/app/serializers/user_summary_serializer.rb
index c2c104ea38d..d05ef817c75 100644
--- a/app/serializers/user_summary_serializer.rb
+++ b/app/serializers/user_summary_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserSummarySerializer < ApplicationSerializer
class TopicSerializer < ListableTopicSerializer
diff --git a/app/serializers/user_wordpress_serializer.rb b/app/serializers/user_wordpress_serializer.rb
index 015ff94a298..c43f91076fe 100644
--- a/app/serializers/user_wordpress_serializer.rb
+++ b/app/serializers/user_wordpress_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserWordpressSerializer < BasicUserSerializer
def avatar_template
diff --git a/app/serializers/watched_word_list_serializer.rb b/app/serializers/watched_word_list_serializer.rb
index 16fba3ea503..d51f43e68f8 100644
--- a/app/serializers/watched_word_list_serializer.rb
+++ b/app/serializers/watched_word_list_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WatchedWordListSerializer < ApplicationSerializer
attributes :actions, :words, :regular_expressions
diff --git a/app/serializers/watched_word_serializer.rb b/app/serializers/watched_word_serializer.rb
index ffa46da5125..a99bfc07a25 100644
--- a/app/serializers/watched_word_serializer.rb
+++ b/app/serializers/watched_word_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WatchedWordSerializer < ApplicationSerializer
attributes :id, :word, :action
diff --git a/app/serializers/web_hook_category_serializer.rb b/app/serializers/web_hook_category_serializer.rb
index 57b979e0ce7..b7fd7ba79c9 100644
--- a/app/serializers/web_hook_category_serializer.rb
+++ b/app/serializers/web_hook_category_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHookCategorySerializer < CategorySerializer
%i{
diff --git a/app/serializers/web_hook_flag_serializer.rb b/app/serializers/web_hook_flag_serializer.rb
index 895a7b82c6c..ae2bf85754f 100644
--- a/app/serializers/web_hook_flag_serializer.rb
+++ b/app/serializers/web_hook_flag_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHookFlagSerializer < ApplicationSerializer
attributes :id,
:post,
diff --git a/app/serializers/web_hook_group_serializer.rb b/app/serializers/web_hook_group_serializer.rb
index 66264abcaf2..d1947c2d848 100644
--- a/app/serializers/web_hook_group_serializer.rb
+++ b/app/serializers/web_hook_group_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHookGroupSerializer < BasicGroupSerializer
%i{
diff --git a/app/serializers/web_hook_post_serializer.rb b/app/serializers/web_hook_post_serializer.rb
index 2a9aa564e1e..d2b173485a2 100644
--- a/app/serializers/web_hook_post_serializer.rb
+++ b/app/serializers/web_hook_post_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHookPostSerializer < PostSerializer
attributes :topic_posts_count
diff --git a/app/serializers/web_hook_topic_view_serializer.rb b/app/serializers/web_hook_topic_view_serializer.rb
index 1aa71ccfd19..5c47ead356f 100644
--- a/app/serializers/web_hook_topic_view_serializer.rb
+++ b/app/serializers/web_hook_topic_view_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'pinned_check'
class WebHookTopicViewSerializer < TopicViewSerializer
diff --git a/app/serializers/web_hook_user_serializer.rb b/app/serializers/web_hook_user_serializer.rb
index 183e4cb66bd..4fd63a8abe6 100644
--- a/app/serializers/web_hook_user_serializer.rb
+++ b/app/serializers/web_hook_user_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WebHookUserSerializer < UserSerializer
attributes :external_id
diff --git a/app/serializers/wizard_field_choice_serializer.rb b/app/serializers/wizard_field_choice_serializer.rb
index 4c9d641d328..38862540239 100644
--- a/app/serializers/wizard_field_choice_serializer.rb
+++ b/app/serializers/wizard_field_choice_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WizardFieldChoiceSerializer < ApplicationSerializer
attributes :id, :label, :extra_label, :description, :icon, :data
diff --git a/app/serializers/wizard_field_serializer.rb b/app/serializers/wizard_field_serializer.rb
index 72e5b07baa0..cc937556f79 100644
--- a/app/serializers/wizard_field_serializer.rb
+++ b/app/serializers/wizard_field_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WizardFieldSerializer < ApplicationSerializer
attributes :id, :type, :required, :value, :label, :placeholder, :description
diff --git a/app/serializers/wizard_serializer.rb b/app/serializers/wizard_serializer.rb
index 87456601ee0..d830ad73256 100644
--- a/app/serializers/wizard_serializer.rb
+++ b/app/serializers/wizard_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WizardSerializer < ApplicationSerializer
attributes :start, :completed
diff --git a/app/serializers/wizard_step_serializer.rb b/app/serializers/wizard_step_serializer.rb
index bb792a2f7e4..d067e5eb816 100644
--- a/app/serializers/wizard_step_serializer.rb
+++ b/app/serializers/wizard_step_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WizardStepSerializer < ApplicationSerializer
attributes :id, :next, :previous, :description, :title, :index, :banner
diff --git a/app/services/anonymous_shadow_creator.rb b/app/services/anonymous_shadow_creator.rb
index a5fef713d16..ae7569f359f 100644
--- a/app/services/anonymous_shadow_creator.rb
+++ b/app/services/anonymous_shadow_creator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AnonymousShadowCreator
def self.get_master(user)
diff --git a/app/services/badge_granter.rb b/app/services/badge_granter.rb
index 44a1766e882..b2f302f9547 100644
--- a/app/services/badge_granter.rb
+++ b/app/services/badge_granter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgeGranter
def initialize(badge, user, opts = {})
diff --git a/app/services/color_scheme_revisor.rb b/app/services/color_scheme_revisor.rb
index 36776ead7cc..e76f3d6f36b 100644
--- a/app/services/color_scheme_revisor.rb
+++ b/app/services/color_scheme_revisor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ColorSchemeRevisor
def initialize(color_scheme, params = {})
diff --git a/app/services/destroy_task.rb b/app/services/destroy_task.rb
index aa5c8c86bd6..f7c8a64123d 100644
--- a/app/services/destroy_task.rb
+++ b/app/services/destroy_task.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
## Because these methods are meant to be called from a rake task
# we are capturing all log output into a log array to return
# to the rake task rather than using `puts` statements.
diff --git a/app/services/group_action_logger.rb b/app/services/group_action_logger.rb
index bcd5e56908e..01620a72b5b 100644
--- a/app/services/group_action_logger.rb
+++ b/app/services/group_action_logger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupActionLogger
def initialize(acting_user, group)
diff --git a/app/services/group_mentions_updater.rb b/app/services/group_mentions_updater.rb
index 92dd5650983..96f61396836 100644
--- a/app/services/group_mentions_updater.rb
+++ b/app/services/group_mentions_updater.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupMentionsUpdater
def self.update(current_name, previous_name)
Post.where(
diff --git a/app/services/group_message.rb b/app/services/group_message.rb
index 4e5a55f99a4..0bc9a9005c9 100644
--- a/app/services/group_message.rb
+++ b/app/services/group_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# GroupMessage sends a private message to a group.
# It will also avoid sending the same message repeatedly, which can happen with
# notifications to moderators when spam is detected.
diff --git a/app/services/handle_chunk_upload.rb b/app/services/handle_chunk_upload.rb
index 93aee6122fc..2bd365b6432 100644
--- a/app/services/handle_chunk_upload.rb
+++ b/app/services/handle_chunk_upload.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class HandleChunkUpload
def initialize(chunk, params = {})
diff --git a/app/services/notification_emailer.rb b/app/services/notification_emailer.rb
index ab2421d4b97..40e044105d6 100644
--- a/app/services/notification_emailer.rb
+++ b/app/services/notification_emailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class NotificationEmailer
class EmailUser
diff --git a/app/services/post_action_notifier.rb b/app/services/post_action_notifier.rb
index 3e3fd46fbb9..22077eaedb8 100644
--- a/app/services/post_action_notifier.rb
+++ b/app/services/post_action_notifier.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostActionNotifier
def self.disable
diff --git a/app/services/post_alerter.rb b/app/services/post_alerter.rb
index a71b68bcdbc..f9d67620fb5 100644
--- a/app/services/post_alerter.rb
+++ b/app/services/post_alerter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'distributed_mutex'
require_dependency 'user_action_manager'
@@ -565,7 +567,7 @@ class PostAlerter
warn_if_not_sidekiq
- condition = <<~SQL
+ condition = +<<~SQL
id IN (
SELECT user_id
FROM topic_users
diff --git a/app/services/post_owner_changer.rb b/app/services/post_owner_changer.rb
index 5ce235f2f2b..45ed22688c9 100644
--- a/app/services/post_owner_changer.rb
+++ b/app/services/post_owner_changer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'post_action_destroyer'
class PostOwnerChanger
diff --git a/app/services/push_notification_pusher.rb b/app/services/push_notification_pusher.rb
index 447324011aa..82d65196d60 100644
--- a/app/services/push_notification_pusher.rb
+++ b/app/services/push_notification_pusher.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'webpush'
class PushNotificationPusher
diff --git a/app/services/random_topic_selector.rb b/app/services/random_topic_selector.rb
index a484c91be15..b7a1087b46b 100644
--- a/app/services/random_topic_selector.rb
+++ b/app/services/random_topic_selector.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RandomTopicSelector
BACKFILL_SIZE = 3000
diff --git a/app/services/site_settings_task.rb b/app/services/site_settings_task.rb
index 224ec20c0d0..8cbb4cfc57b 100644
--- a/app/services/site_settings_task.rb
+++ b/app/services/site_settings_task.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SiteSettingsTask
def self.export_to_hash(include_defaults: false)
site_settings = SiteSetting.all_settings
diff --git a/app/services/spam_rule/auto_silence.rb b/app/services/spam_rule/auto_silence.rb
index 3486e3a0e20..accebe1e341 100644
--- a/app/services/spam_rule/auto_silence.rb
+++ b/app/services/spam_rule/auto_silence.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SpamRule::AutoSilence
attr_reader :group_message
diff --git a/app/services/spam_rule/flag_sockpuppets.rb b/app/services/spam_rule/flag_sockpuppets.rb
index d7fd26cdc56..c67636904c6 100644
--- a/app/services/spam_rule/flag_sockpuppets.rb
+++ b/app/services/spam_rule/flag_sockpuppets.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SpamRule::FlagSockpuppets
def initialize(post)
diff --git a/app/services/staff_action_logger.rb b/app/services/staff_action_logger.rb
index 1f33fca2224..7090abbaf0b 100644
--- a/app/services/staff_action_logger.rb
+++ b/app/services/staff_action_logger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'staff_message_format'
# Responsible for logging the actions of admins and moderators.
diff --git a/app/services/topic_status_updater.rb b/app/services/topic_status_updater.rb
index 09c6f2e8956..8c7489d8c22 100644
--- a/app/services/topic_status_updater.rb
+++ b/app/services/topic_status_updater.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
TopicStatusUpdater = Struct.new(:topic, :user) do
def update!(status, enabled, opts = {})
status = Status.new(status, enabled)
@@ -74,7 +76,7 @@ TopicStatusUpdater = Struct.new(:topic, :user) do
def message_for(status)
if status.autoclosed?
- locale_key = status.locale_key
+ locale_key = status.locale_key.dup
locale_key << "_lastpost" if @topic_status_update&.based_on_last_post
message_for_autoclosed(locale_key)
end
diff --git a/app/services/topic_timestamp_changer.rb b/app/services/topic_timestamp_changer.rb
index 8dffa3323da..bc24369718c 100644
--- a/app/services/topic_timestamp_changer.rb
+++ b/app/services/topic_timestamp_changer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicTimestampChanger
class InvalidTimestampError < StandardError; end
diff --git a/app/services/tracked_topics_updater.rb b/app/services/tracked_topics_updater.rb
index 0ffb32e7e79..018303af0bd 100644
--- a/app/services/tracked_topics_updater.rb
+++ b/app/services/tracked_topics_updater.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TrackedTopicsUpdater
def initialize(user_id, threshold)
diff --git a/app/services/trust_level_granter.rb b/app/services/trust_level_granter.rb
index 23e9ef50ff0..db284b5dc8c 100644
--- a/app/services/trust_level_granter.rb
+++ b/app/services/trust_level_granter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TrustLevelGranter
def initialize(trust_level, user)
diff --git a/app/services/user_action_manager.rb b/app/services/user_action_manager.rb
index 7adc19fef8d..fa80f040859 100644
--- a/app/services/user_action_manager.rb
+++ b/app/services/user_action_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserActionManager
def self.disable
diff --git a/app/services/user_activator.rb b/app/services/user_activator.rb
index d65fba83c29..49672b04ffe 100644
--- a/app/services/user_activator.rb
+++ b/app/services/user_activator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserActivator
attr_reader :user, :request, :session, :cookies, :message
diff --git a/app/services/user_anonymizer.rb b/app/services/user_anonymizer.rb
index a5bef8ba05a..fbc560dec03 100644
--- a/app/services/user_anonymizer.rb
+++ b/app/services/user_anonymizer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserAnonymizer
attr_reader :user_history
diff --git a/app/services/user_authenticator.rb b/app/services/user_authenticator.rb
index b53c5de8b95..c2361f6a5d1 100644
--- a/app/services/user_authenticator.rb
+++ b/app/services/user_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserAuthenticator
def initialize(user, session, authenticator_finder = Users::OmniauthCallbacksController)
diff --git a/app/services/user_destroyer.rb b/app/services/user_destroyer.rb
index 900ffbb8b0b..9ef3394d804 100644
--- a/app/services/user_destroyer.rb
+++ b/app/services/user_destroyer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'ip_addr'
# Responsible for destroying a User record
diff --git a/app/services/user_merger.rb b/app/services/user_merger.rb
index b192aa24aa7..25bf412625c 100644
--- a/app/services/user_merger.rb
+++ b/app/services/user_merger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserMerger
def initialize(source_user, target_user, acting_user = nil)
@source_user = source_user
diff --git a/app/services/user_silencer.rb b/app/services/user_silencer.rb
index 9e452cdf7d9..014d65aa5db 100644
--- a/app/services/user_silencer.rb
+++ b/app/services/user_silencer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'staff_message_format'
class UserSilencer
diff --git a/app/services/user_updater.rb b/app/services/user_updater.rb
index bffeb66afda..38983b34f53 100644
--- a/app/services/user_updater.rb
+++ b/app/services/user_updater.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserUpdater
CATEGORY_IDS = {
diff --git a/app/services/username_changer.rb b/app/services/username_changer.rb
index 70ce9caabb5..287360ef685 100644
--- a/app/services/username_changer.rb
+++ b/app/services/username_changer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'jobs/regular/update_username'
class UsernameChanger
diff --git a/app/services/username_checker_service.rb b/app/services/username_checker_service.rb
index 8da0748d043..e724e2bca20 100644
--- a/app/services/username_checker_service.rb
+++ b/app/services/username_checker_service.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UsernameCheckerService
def initialize(allow_reserved_username: false)
@allow_reserved_username = allow_reserved_username
diff --git a/app/services/wildcard_domain_checker.rb b/app/services/wildcard_domain_checker.rb
index 3f91811f07e..0b95f12d2a2 100644
--- a/app/services/wildcard_domain_checker.rb
+++ b/app/services/wildcard_domain_checker.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module WildcardDomainChecker
def self.check_domain(domain, external_domain)
diff --git a/app/services/wildcard_url_checker.rb b/app/services/wildcard_url_checker.rb
index 0503493b05f..e9c9f44d0c9 100644
--- a/app/services/wildcard_url_checker.rb
+++ b/app/services/wildcard_url_checker.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module WildcardUrlChecker
def self.check_url(url, url_to_check)
diff --git a/app/services/word_watcher.rb b/app/services/word_watcher.rb
index 20614d23a7f..762f56cd543 100644
--- a/app/services/word_watcher.rb
+++ b/app/services/word_watcher.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class WordWatcher
def initialize(raw)
diff --git a/bin/bundle b/bin/bundle
index 66e9889e8b4..58115ecf305 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -1,3 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/rails b/bin/rails
index 5481cad3fec..cdc2c4c16b3 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
if !ENV["RAILS_ENV"] && (ARGV[0] == "s" || ARGV[0] == "server")
ENV["UNICORN_PORT"] ||= "3000"
diff --git a/bin/rake b/bin/rake
index febc865cbd1..61c75ed85af 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
if ENV['RAILS_ENV'] == 'test' && ENV['LOAD_PLUGINS'].nil?
if ARGV.include?('db:migrate')
diff --git a/bin/rspec b/bin/rspec
index 0c86b5c6fa1..c36691f7ddd 100755
--- a/bin/rspec
+++ b/bin/rspec
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
#
# This file was generated by Bundler.
#
diff --git a/bin/unicorn b/bin/unicorn
index a425691870d..cff21639972 100755
--- a/bin/unicorn
+++ b/bin/unicorn
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
diff --git a/config.ru b/config.ru
index 3c73b82bb19..82fc7c365d9 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.
ENV["DISCOURSE_RUNNING_IN_RACK"] = "1"
diff --git a/config/boot.rb b/config/boot.rb
index fdf031f52fe..df26be14a64 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if ENV['DISCOURSE_DUMP_HEAP'] == "1"
require 'objspace'
ObjectSpace.trace_object_allocations_start
diff --git a/config/cloud/cloud66/files/production.rb b/config/cloud/cloud66/files/production.rb
index 42d9caa9fc2..c43d53772f0 100644
--- a/config/cloud/cloud66/files/production.rb
+++ b/config/cloud/cloud66/files/production.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Discourse::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
diff --git a/config/environment.rb b/config/environment.rb
index bee2a432875..ce160dc5e17 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Load the rails application
require File.expand_path('../application', __FILE__)
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 94a96f10848..eb623464003 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Discourse::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
diff --git a/config/environments/production.rb b/config/environments/production.rb
index fd344fab4c4..7e122948246 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Discourse::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
diff --git a/config/environments/profile.rb b/config/environments/profile.rb
index e29421d57e2..d09ddcd1b36 100644
--- a/config/environments/profile.rb
+++ b/config/environments/profile.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Discourse::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
diff --git a/config/environments/test.rb b/config/environments/test.rb
index e140ec56fb4..da7b6f2ef3b 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Discourse::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
diff --git a/config/initializers/000-mini_sql.rb b/config/initializers/000-mini_sql.rb
index 35f8713b8bf..15bbb7de068 100644
--- a/config/initializers/000-mini_sql.rb
+++ b/config/initializers/000-mini_sql.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
require 'mini_sql_multisite_connection'
::DB = MiniSqlMultisiteConnection.instance
diff --git a/config/initializers/000-post_migration.rb b/config/initializers/000-post_migration.rb
index acff3e26d9f..ca0c06d8a8f 100644
--- a/config/initializers/000-post_migration.rb
+++ b/config/initializers/000-post_migration.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
unless Discourse.skip_post_deployment_migrations?
Rails.application.config.paths['db/migrate'] << Rails.root.join(
Discourse::DB_POST_MIGRATE_PATH
diff --git a/config/initializers/001-redis.rb b/config/initializers/001-redis.rb
index e92fb9320c4..61bd490bd0b 100644
--- a/config/initializers/001-redis.rb
+++ b/config/initializers/001-redis.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if Rails.env.development? && ENV['DISCOURSE_FLUSH_REDIS']
puts "Flushing redis (development mode)"
$redis.flushall
diff --git a/config/initializers/002-freedom_patches.rb b/config/initializers/002-freedom_patches.rb
index d5d4f76d800..255652ba206 100644
--- a/config/initializers/002-freedom_patches.rb
+++ b/config/initializers/002-freedom_patches.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Dir["#{Rails.root}/lib/freedom_patches/*.rb"].each do |f|
require(f)
end
diff --git a/config/initializers/003-sql_builder.rb b/config/initializers/003-sql_builder.rb
index fd87e9c645e..a7be88c2942 100644
--- a/config/initializers/003-sql_builder.rb
+++ b/config/initializers/003-sql_builder.rb
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
require 'sql_builder'
diff --git a/config/initializers/004-message_bus.rb b/config/initializers/004-message_bus.rb
index 3ad639ffded..7d2ab966ce6 100644
--- a/config/initializers/004-message_bus.rb
+++ b/config/initializers/004-message_bus.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
MessageBus.site_id_lookup do |env = nil|
if env
setup_message_bus_env(env)
diff --git a/config/initializers/005-site_settings.rb b/config/initializers/005-site_settings.rb
index 033db48f616..b783774c34f 100644
--- a/config/initializers/005-site_settings.rb
+++ b/config/initializers/005-site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# load up git version into memory
# this way if it changes underneath we still have
# the original version
diff --git a/config/initializers/006-ensure_login_hint.rb b/config/initializers/006-ensure_login_hint.rb
index d5c425980d9..62bd1985ac5 100644
--- a/config/initializers/006-ensure_login_hint.rb
+++ b/config/initializers/006-ensure_login_hint.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Some sanity checking so we don't count on an unindexed column on boot
begin
if ActiveRecord::Base.connection.table_exists?(:users) &&
diff --git a/config/initializers/006-mini_profiler.rb b/config/initializers/006-mini_profiler.rb
index 7620cb3d8f5..b1f47d963aa 100644
--- a/config/initializers/006-mini_profiler.rb
+++ b/config/initializers/006-mini_profiler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# If Mini Profiler is included via gem
if Rails.configuration.respond_to?(:load_mini_profiler) && Rails.configuration.load_mini_profiler
require 'rack-mini-profiler'
diff --git a/config/initializers/009-omniauth.rb b/config/initializers/009-omniauth.rb
index 0e58b14b8c1..6acc2856429 100644
--- a/config/initializers/009-omniauth.rb
+++ b/config/initializers/009-omniauth.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "openssl"
require "openid_redis_store"
diff --git a/config/initializers/010-discourse_iife.rb b/config/initializers/010-discourse_iife.rb
index 275272fad1e..7e50904fa89 100644
--- a/config/initializers/010-discourse_iife.rb
+++ b/config/initializers/010-discourse_iife.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'discourse_iife'
Rails.application.config.assets.configure do |env|
diff --git a/config/initializers/011-rack-protection.rb b/config/initializers/011-rack-protection.rb
index a0fce3853c2..72bda38b072 100644
--- a/config/initializers/011-rack-protection.rb
+++ b/config/initializers/011-rack-protection.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rack/protection'
Rails.configuration.middleware.use Rack::Protection::FrameOptions
diff --git a/config/initializers/012-web_hook_events.rb b/config/initializers/012-web_hook_events.rb
index 3f1c2f9c649..5df4c8df031 100644
--- a/config/initializers/012-web_hook_events.rb
+++ b/config/initializers/012-web_hook_events.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
%i(
topic_recovered
).each do |event|
diff --git a/config/initializers/013-excon_defaults.rb b/config/initializers/013-excon_defaults.rb
index 32ab36b4cb6..cfade5b7ccd 100644
--- a/config/initializers/013-excon_defaults.rb
+++ b/config/initializers/013-excon_defaults.rb
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
Excon::DEFAULTS[:omit_default_port] = true
diff --git a/config/initializers/014-track-setting-changes.rb b/config/initializers/014-track-setting-changes.rb
index 49259ed2e6a..9720c1e7d88 100644
--- a/config/initializers/014-track-setting-changes.rb
+++ b/config/initializers/014-track-setting-changes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "site_icon_manager"
DiscourseEvent.on(:site_setting_changed) do |name, old_value, new_value|
diff --git a/config/initializers/050-force_https.rb b/config/initializers/050-force_https.rb
index 0185fbd7426..a3bdb5d3b27 100644
--- a/config/initializers/050-force_https.rb
+++ b/config/initializers/050-force_https.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# tiny middleware to force https if needed
class Discourse::ForceHttpsMiddleware
diff --git a/config/initializers/099-anon-cache.rb b/config/initializers/099-anon-cache.rb
index 9c47f367129..32bca432060 100644
--- a/config/initializers/099-anon-cache.rb
+++ b/config/initializers/099-anon-cache.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "middleware/anonymous_cache"
enabled =
diff --git a/config/initializers/099-defer.rb b/config/initializers/099-defer.rb
index 9d020433c1d..96f1456b644 100644
--- a/config/initializers/099-defer.rb
+++ b/config/initializers/099-defer.rb
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
require_dependency 'scheduler/defer'
diff --git a/config/initializers/099-drain_pool.rb b/config/initializers/099-drain_pool.rb
index e26f45976da..cff95339b8a 100644
--- a/config/initializers/099-drain_pool.rb
+++ b/config/initializers/099-drain_pool.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
# pg performs inconsistently with large amounts of connections
Discourse.start_connection_reaper
diff --git a/config/initializers/100-i18n.rb b/config/initializers/100-i18n.rb
index a326b2060df..d714de498d7 100644
--- a/config/initializers/100-i18n.rb
+++ b/config/initializers/100-i18n.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# order: after 02-freedom_patches.rb
require 'i18n/backend/discourse_i18n'
diff --git a/config/initializers/100-logster.rb b/config/initializers/100-logster.rb
index 50af0b12db9..c651b890fa9 100644
--- a/config/initializers/100-logster.rb
+++ b/config/initializers/100-logster.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if Rails.env.development? && RUBY_VERSION.match?(/^2\.5\.[23]/)
STDERR.puts "WARNING: Discourse development environment runs slower on Ruby 2.5.3 or below"
STDERR.puts "We recommend you upgrade to Ruby 2.6.1 for the optimal development performance"
diff --git a/config/initializers/100-oj.rb b/config/initializers/100-oj.rb
index 5f34bca1917..4e51c78a904 100644
--- a/config/initializers/100-oj.rb
+++ b/config/initializers/100-oj.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
# Not sure why it's not using this by default!
MultiJson.engine = :oj
diff --git a/config/initializers/100-onebox_options.rb b/config/initializers/100-onebox_options.rb
index 55ba15ddf6b..c6bd15fad9f 100644
--- a/config/initializers/100-onebox_options.rb
+++ b/config/initializers/100-onebox_options.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'twitter_api'
Onebox.options = {
diff --git a/config/initializers/100-push-notifications.rb b/config/initializers/100-push-notifications.rb
index 50f580c3883..2e0461664e6 100644
--- a/config/initializers/100-push-notifications.rb
+++ b/config/initializers/100-push-notifications.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'webpush'
if SiteSetting.vapid_public_key.blank? || SiteSetting.vapid_private_key.blank? || SiteSetting.vapid_public_key_bytes.blank?
diff --git a/config/initializers/100-quiet_logger.rb b/config/initializers/100-quiet_logger.rb
index e4106607c27..ad8e1798b93 100644
--- a/config/initializers/100-quiet_logger.rb
+++ b/config/initializers/100-quiet_logger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Rails.application.config.assets.configure do |env|
env.logger = Logger.new('/dev/null')
end
diff --git a/config/initializers/100-secret_token.rb b/config/initializers/100-secret_token.rb
index a9507c57961..3455a1220f7 100644
--- a/config/initializers/100-secret_token.rb
+++ b/config/initializers/100-secret_token.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Not fussed setting secret_token anymore, that is only required for
# backwards support of "seamless" upgrade from Rails 3.
# Discourse has shipped Rails 3 for a very long time.
diff --git a/config/initializers/100-session_store.rb b/config/initializers/100-session_store.rb
index ab4077023f3..1827f6e552a 100644
--- a/config/initializers/100-session_store.rb
+++ b/config/initializers/100-session_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
#
require_dependency 'discourse_cookie_store'
diff --git a/config/initializers/100-sidekiq.rb b/config/initializers/100-sidekiq.rb
index b25cb6dd4ba..068cdb7e434 100644
--- a/config/initializers/100-sidekiq.rb
+++ b/config/initializers/100-sidekiq.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "sidekiq/pausable"
Sidekiq.configure_client do |config|
diff --git a/config/initializers/100-silence_logger.rb b/config/initializers/100-silence_logger.rb
index 9952c8b36ea..38fdbef5aad 100644
--- a/config/initializers/100-silence_logger.rb
+++ b/config/initializers/100-silence_logger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SilenceLogger < Rails::Rack::Logger
PATH_INFO = 'PATH_INFO'.freeze
HTTP_X_SILENCE_LOGGER = 'HTTP_X_SILENCE_LOGGER'.freeze
diff --git a/config/initializers/100-strong_parameters.rb b/config/initializers/100-strong_parameters.rb
index ddc8cf3b6be..1dbf131e87f 100644
--- a/config/initializers/100-strong_parameters.rb
+++ b/config/initializers/100-strong_parameters.rb
@@ -1 +1,3 @@
+# frozen_string_literal: true
+
ActiveRecord::Base.public_send(:include, ActiveModel::ForbiddenAttributesProtection)
diff --git a/config/initializers/100-verify_config.rb b/config/initializers/100-verify_config.rb
index 2d91431db64..4d2d986cd15 100644
--- a/config/initializers/100-verify_config.rb
+++ b/config/initializers/100-verify_config.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Check that the app is configured correctly. Raise some helpful errors if something is wrong.
if defined?(Rails::Server) && Rails.env.production? # Only run these checks when starting up a production server
diff --git a/config/initializers/100-watch_for_restart.rb b/config/initializers/100-watch_for_restart.rb
index 40ed81bb34b..292bf54bd3c 100644
--- a/config/initializers/100-watch_for_restart.rb
+++ b/config/initializers/100-watch_for_restart.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# this is a trivial graceful restart on touch of tmp/restart.
#
# It simply drains all the requests (waits up to 4 seconds) and issues a HUP
diff --git a/config/initializers/100-wrap_parameters.rb b/config/initializers/100-wrap_parameters.rb
index 999df20181e..85b2d840618 100644
--- a/config/initializers/100-wrap_parameters.rb
+++ b/config/initializers/100-wrap_parameters.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
diff --git a/config/initializers/101-lograge.rb b/config/initializers/101-lograge.rb
index ef0624ab83e..de1ab4fb272 100644
--- a/config/initializers/101-lograge.rb
+++ b/config/initializers/101-lograge.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["ENABLE_LOGRAGE"]
require 'lograge'
diff --git a/config/initializers/200-message_bus_request_tracker.rb b/config/initializers/200-message_bus_request_tracker.rb
index dd58419e15d..1026912c491 100644
--- a/config/initializers/200-message_bus_request_tracker.rb
+++ b/config/initializers/200-message_bus_request_tracker.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# we want MesageBus in the absolute front
# this is important cause the vast majority of web requests go to it
# this allows us to avoid full middleware crawls each time
diff --git a/config/locales/plurals.rb b/config/locales/plurals.rb
index c3e6acf170a..54a46b58c6a 100644
--- a/config/locales/plurals.rb
+++ b/config/locales/plurals.rb
@@ -1,4 +1,6 @@
# encoding: utf-8
+# frozen_string_literal: true
+
# source: https://github.com/svenfuchs/i18n/blob/master/test/test_data/locales/plurals.rb
{
diff --git a/config/puma.rb b/config/puma.rb
index 85f38250eca..e237b06d201 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if ENV['RAILS_ENV'] == 'production'
# First, you need to change these below to your situation.
diff --git a/config/routes.rb b/config/routes.rb
index d3868db2d0e..0b42f7fba14 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "sidekiq/web"
require "mini_scheduler/web"
require_dependency "admin_constraint"
diff --git a/config/spring.rb b/config/spring.rb
index 4e5ef1d97de..68b1b41a334 100644
--- a/config/spring.rb
+++ b/config/spring.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# spring speeds up your dev environment, similar to zeus but build in Ruby
#
# gem install spring
diff --git a/config/unicorn.conf.rb b/config/unicorn.conf.rb
index 6ba41e42f8f..e6e2d616b48 100644
--- a/config/unicorn.conf.rb
+++ b/config/unicorn.conf.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# See http://unicorn.bogomips.org/Unicorn/Configurator.html
if ENV["LOGSTASH_UNICORN_URI"]
diff --git a/db/api_test_seeds.rb b/db/api_test_seeds.rb
index ece7fc1935a..17c3256e976 100644
--- a/db/api_test_seeds.rb
+++ b/db/api_test_seeds.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
user = User.where(username: "test_user").first_or_create(name: "Test User", email: "test_user@example.com", password: SecureRandom.hex, username: "test_user", approved: true, active: true, admin: true)
UserAuthToken.generate!(user_id: user.id)
ApiKey.create(key: 'test_d7fd0429940', user_id: user.id, created_by_id: user.id)
diff --git a/db/fixtures/001_refresh.rb b/db/fixtures/001_refresh.rb
index 5969a2e2a89..5188adc6cb7 100644
--- a/db/fixtures/001_refresh.rb
+++ b/db/fixtures/001_refresh.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# fix any bust caches post initial migration
ActiveRecord::Base.public_send(:subclasses).each { |m| m.reset_column_information }
SiteSetting.refresh!
diff --git a/db/fixtures/002_groups.rb b/db/fixtures/002_groups.rb
index 319bb30797c..f3ed4808422 100644
--- a/db/fixtures/002_groups.rb
+++ b/db/fixtures/002_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Group.ensure_automatic_groups!
if g = Group.find_by(name: 'trust_level_5', id: 15)
g.destroy!
diff --git a/db/fixtures/003_post_action_types.rb b/db/fixtures/003_post_action_types.rb
index 0de70060017..21350f55669 100644
--- a/db/fixtures/003_post_action_types.rb
+++ b/db/fixtures/003_post_action_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
PostActionType.seed do |s|
s.id = PostActionType.types[:bookmark]
s.name_key = 'bookmark'
diff --git a/db/fixtures/004_screened_ip_addresses.rb b/db/fixtures/004_screened_ip_addresses.rb
index 0831e837111..c22ede24e71 100644
--- a/db/fixtures/004_screened_ip_addresses.rb
+++ b/db/fixtures/004_screened_ip_addresses.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
ScreenedIpAddress.seed do |s|
s.id = 1
s.ip_address = "10.0.0.0/8"
diff --git a/db/fixtures/005_badge_types.rb b/db/fixtures/005_badge_types.rb
index 2cdec2b4169..6aff12fe638 100644
--- a/db/fixtures/005_badge_types.rb
+++ b/db/fixtures/005_badge_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
BadgeType.seed do |b|
b.id = 1
b.name = "Gold"
diff --git a/db/fixtures/006_badges.rb b/db/fixtures/006_badges.rb
index 12c189da111..211a972f17f 100644
--- a/db/fixtures/006_badges.rb
+++ b/db/fixtures/006_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'badge_queries'
BadgeGrouping.seed do |g|
diff --git a/db/fixtures/007_web_hook_event_types.rb b/db/fixtures/007_web_hook_event_types.rb
index cbe6a323446..4f3d2d15df3 100644
--- a/db/fixtures/007_web_hook_event_types.rb
+++ b/db/fixtures/007_web_hook_event_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
WebHookEventType.seed do |b|
b.id = WebHookEventType::TOPIC
b.name = "topic"
diff --git a/db/fixtures/009_users.rb b/db/fixtures/009_users.rb
index add14131819..b0484fd4444 100644
--- a/db/fixtures/009_users.rb
+++ b/db/fixtures/009_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# kind of odd, but we need it, we also need to nuke usage of User from inside migrations
# very poor form
user = User.find_by("id <> -1 and username_lower = 'system'")
diff --git a/db/fixtures/010_uploads.rb b/db/fixtures/010_uploads.rb
index 2b3097f8b23..b36012ea7a4 100644
--- a/db/fixtures/010_uploads.rb
+++ b/db/fixtures/010_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
{
-1 => "d-logo-sketch.png", # Old version
-2 => "d-logo-sketch-small.png", # Old version
diff --git a/db/fixtures/500_categories.rb b/db/fixtures/500_categories.rb
index 3146ba4397e..060969b72e6 100644
--- a/db/fixtures/500_categories.rb
+++ b/db/fixtures/500_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'seed_data/categories'
if !Rails.env.test?
diff --git a/db/fixtures/600_themes.rb b/db/fixtures/600_themes.rb
index 340f4506edc..23cc993a276 100644
--- a/db/fixtures/600_themes.rb
+++ b/db/fixtures/600_themes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# we can not guess what to do if customization already started, so skip it
if !Theme.exists?
STDERR.puts "> Seeding dark and light themes"
diff --git a/db/fixtures/990_settings.rb b/db/fixtures/990_settings.rb
index 98e0ef84dd0..7086f6b1cd9 100644
--- a/db/fixtures/990_settings.rb
+++ b/db/fixtures/990_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if SiteSetting.notification_email == SiteSetting.defaults[:notification_email]
# don't crash for invalid hostname, which is possible in dev
begin
diff --git a/db/fixtures/990_topics.rb b/db/fixtures/990_topics.rb
index 73c8f887273..13c8b53c8e9 100644
--- a/db/fixtures/990_topics.rb
+++ b/db/fixtures/990_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'seed_data/topics'
User.reset_column_information
diff --git a/db/migrate/20000225050318_add_schema_migration_details.rb b/db/migrate/20000225050318_add_schema_migration_details.rb
index 927b7d1e046..55e6abf22b4 100644
--- a/db/migrate/20000225050318_add_schema_migration_details.rb
+++ b/db/migrate/20000225050318_add_schema_migration_details.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSchemaMigrationDetails < ActiveRecord::Migration[4.2]
def up
# schema_migrations table is way too thin, does not give info about
diff --git a/db/migrate/20120311163914_create_forum_threads.rb b/db/migrate/20120311163914_create_forum_threads.rb
index a0f4f2c5978..44ac1e26975 100644
--- a/db/migrate/20120311163914_create_forum_threads.rb
+++ b/db/migrate/20120311163914_create_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateForumThreads < ActiveRecord::Migration[4.2]
def change
create_table :forum_threads do |t|
diff --git a/db/migrate/20120311164326_create_posts.rb b/db/migrate/20120311164326_create_posts.rb
index f67d93f29d1..3dd129cd94a 100644
--- a/db/migrate/20120311164326_create_posts.rb
+++ b/db/migrate/20120311164326_create_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePosts < ActiveRecord::Migration[4.2]
def change
create_table :posts do |t|
diff --git a/db/migrate/20120311170118_create_users.rb b/db/migrate/20120311170118_create_users.rb
index 9a1ae7a448f..1841ced71a9 100644
--- a/db/migrate/20120311170118_create_users.rb
+++ b/db/migrate/20120311170118_create_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUsers < ActiveRecord::Migration[4.2]
def change
create_table :users do |t|
diff --git a/db/migrate/20120311201341_create_forums.rb b/db/migrate/20120311201341_create_forums.rb
index ef88af4c105..82ea51d6e75 100644
--- a/db/migrate/20120311201341_create_forums.rb
+++ b/db/migrate/20120311201341_create_forums.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateForums < ActiveRecord::Migration[4.2]
def change
create_table :forums do |t|
diff --git a/db/migrate/20120311210245_create_sites.rb b/db/migrate/20120311210245_create_sites.rb
index 70e8f2c4e60..4246a6ee7e8 100644
--- a/db/migrate/20120311210245_create_sites.rb
+++ b/db/migrate/20120311210245_create_sites.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateSites < ActiveRecord::Migration[4.2]
def change
create_table :sites do |t|
diff --git a/db/migrate/20120416201606_add_reply_to_to_posts.rb b/db/migrate/20120416201606_add_reply_to_to_posts.rb
index 0656d315370..d89c7030b50 100644
--- a/db/migrate/20120416201606_add_reply_to_to_posts.rb
+++ b/db/migrate/20120416201606_add_reply_to_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReplyToToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :reply_to_post_number, :integer, null: true
diff --git a/db/migrate/20120420183447_add_views_to_forum_threads.rb b/db/migrate/20120420183447_add_views_to_forum_threads.rb
index 50757876085..8e97ceff7f9 100644
--- a/db/migrate/20120420183447_add_views_to_forum_threads.rb
+++ b/db/migrate/20120420183447_add_views_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddViewsToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :views, :integer, default: 0, null: false
diff --git a/db/migrate/20120423140906_add_posts_count_to_forum_threads.rb b/db/migrate/20120423140906_add_posts_count_to_forum_threads.rb
index 832f66a3076..632daeabbcc 100644
--- a/db/migrate/20120423140906_add_posts_count_to_forum_threads.rb
+++ b/db/migrate/20120423140906_add_posts_count_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostsCountToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :posts_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120423142820_fix_post_indices.rb b/db/migrate/20120423142820_fix_post_indices.rb
index 0e99e03e161..2d1042663c9 100644
--- a/db/migrate/20120423142820_fix_post_indices.rb
+++ b/db/migrate/20120423142820_fix_post_indices.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixPostIndices < ActiveRecord::Migration[4.2]
def up
remove_index :posts, [:forum_thread_id, :created_at]
diff --git a/db/migrate/20120423151548_remove_last_post_id.rb b/db/migrate/20120423151548_remove_last_post_id.rb
index fd3f1b292b6..57f57609223 100644
--- a/db/migrate/20120423151548_remove_last_post_id.rb
+++ b/db/migrate/20120423151548_remove_last_post_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveLastPostId < ActiveRecord::Migration[4.2]
def up
remove_column :forum_threads, :last_post_id
diff --git a/db/migrate/20120425145456_add_display_username_to_users.rb b/db/migrate/20120425145456_add_display_username_to_users.rb
index 43df8bdf6a6..e88c4ee0ca5 100644
--- a/db/migrate/20120425145456_add_display_username_to_users.rb
+++ b/db/migrate/20120425145456_add_display_username_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDisplayUsernameToUsers < ActiveRecord::Migration[4.2]
def up
add_column :users, :display_username, :string
diff --git a/db/migrate/20120427150624_add_user_id_index_to_posts.rb b/db/migrate/20120427150624_add_user_id_index_to_posts.rb
index 8da0ee50fe3..df785acda52 100644
--- a/db/migrate/20120427150624_add_user_id_index_to_posts.rb
+++ b/db/migrate/20120427150624_add_user_id_index_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserIdIndexToPosts < ActiveRecord::Migration[4.2]
def change
add_index :posts, :user_id
diff --git a/db/migrate/20120427151452_cooked_migration.rb b/db/migrate/20120427151452_cooked_migration.rb
index 9b8ca2d8e86..1f10250ea74 100644
--- a/db/migrate/20120427151452_cooked_migration.rb
+++ b/db/migrate/20120427151452_cooked_migration.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CookedMigration < ActiveRecord::Migration[4.2]
def change
rename_column :posts, :content, :raw
diff --git a/db/migrate/20120427154330_create_vestal_versions.rb b/db/migrate/20120427154330_create_vestal_versions.rb
index 730c275c1f1..364592430f6 100644
--- a/db/migrate/20120427154330_create_vestal_versions.rb
+++ b/db/migrate/20120427154330_create_vestal_versions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateVestalVersions < ActiveRecord::Migration[4.2]
def self.up
create_table :versions do |t|
diff --git a/db/migrate/20120427172031_add_version_to_posts.rb b/db/migrate/20120427172031_add_version_to_posts.rb
index 6ff53461a42..1dad2651781 100644
--- a/db/migrate/20120427172031_add_version_to_posts.rb
+++ b/db/migrate/20120427172031_add_version_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddVersionToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :cached_version, :integer, null: false, default: 1
diff --git a/db/migrate/20120502183240_add_created_by_to_forum_threads.rb b/db/migrate/20120502183240_add_created_by_to_forum_threads.rb
index 0eca6e0908f..62f76731b38 100644
--- a/db/migrate/20120502183240_add_created_by_to_forum_threads.rb
+++ b/db/migrate/20120502183240_add_created_by_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCreatedByToForumThreads < ActiveRecord::Migration[4.2]
def up
add_column :forum_threads, :user_id, :integer
diff --git a/db/migrate/20120502192121_add_last_post_user_id_to_forum_threads.rb b/db/migrate/20120502192121_add_last_post_user_id_to_forum_threads.rb
index aafa179b823..174e4f99d9a 100644
--- a/db/migrate/20120502192121_add_last_post_user_id_to_forum_threads.rb
+++ b/db/migrate/20120502192121_add_last_post_user_id_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastPostUserIdToForumThreads < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20120503205521_add_site_id_to_users.rb b/db/migrate/20120503205521_add_site_id_to_users.rb
index 2057bc809a1..131299bc1b7 100644
--- a/db/migrate/20120503205521_add_site_id_to_users.rb
+++ b/db/migrate/20120503205521_add_site_id_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSiteIdToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :site_id, :integer
diff --git a/db/migrate/20120507144132_create_expressions.rb b/db/migrate/20120507144132_create_expressions.rb
index 5daf04026fb..8c2aba4cc97 100644
--- a/db/migrate/20120507144132_create_expressions.rb
+++ b/db/migrate/20120507144132_create_expressions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateExpressions < ActiveRecord::Migration[4.2]
def change
create_table :expressions, id: false, force: true do |t|
diff --git a/db/migrate/20120507144222_create_expression_types.rb b/db/migrate/20120507144222_create_expression_types.rb
index a536a0da51f..70630349fbb 100644
--- a/db/migrate/20120507144222_create_expression_types.rb
+++ b/db/migrate/20120507144222_create_expression_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateExpressionTypes < ActiveRecord::Migration[4.2]
def change
create_table :expression_types do |t|
diff --git a/db/migrate/20120514144549_add_reply_count_to_posts.rb b/db/migrate/20120514144549_add_reply_count_to_posts.rb
index 4be691b2340..8209c8281f6 100644
--- a/db/migrate/20120514144549_add_reply_count_to_posts.rb
+++ b/db/migrate/20120514144549_add_reply_count_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReplyCountToPosts < ActiveRecord::Migration[4.2]
def up
add_column :posts, :reply_count, :integer, null: false, default: 0
diff --git a/db/migrate/20120514173920_add_flag_to_expression_types.rb b/db/migrate/20120514173920_add_flag_to_expression_types.rb
index b5f15bf458f..a1644f84b60 100644
--- a/db/migrate/20120514173920_add_flag_to_expression_types.rb
+++ b/db/migrate/20120514173920_add_flag_to_expression_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFlagToExpressionTypes < ActiveRecord::Migration[4.2]
def change
add_column :expression_types, :flag, :boolean, default: false
diff --git a/db/migrate/20120514204934_add_description_to_expression_types.rb b/db/migrate/20120514204934_add_description_to_expression_types.rb
index 8e4cc982716..be1121fd631 100644
--- a/db/migrate/20120514204934_add_description_to_expression_types.rb
+++ b/db/migrate/20120514204934_add_description_to_expression_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDescriptionToExpressionTypes < ActiveRecord::Migration[4.2]
def change
add_column :expression_types, :description, :text, null: true
diff --git a/db/migrate/20120517200130_add_quoteless_to_post.rb b/db/migrate/20120517200130_add_quoteless_to_post.rb
index 116f67eabac..a7d1e3d7e24 100644
--- a/db/migrate/20120517200130_add_quoteless_to_post.rb
+++ b/db/migrate/20120517200130_add_quoteless_to_post.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddQuotelessToPost < ActiveRecord::Migration[4.2]
def change
add_column :posts, :quoteless, :boolean, default: false
diff --git a/db/migrate/20120518200115_create_read_posts.rb b/db/migrate/20120518200115_create_read_posts.rb
index d1cc7b99ff9..c17305159ae 100644
--- a/db/migrate/20120518200115_create_read_posts.rb
+++ b/db/migrate/20120518200115_create_read_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateReadPosts < ActiveRecord::Migration[4.2]
def up
create_table :read_posts, id: false do |t|
diff --git a/db/migrate/20120519182212_create_last_read_posts.rb b/db/migrate/20120519182212_create_last_read_posts.rb
index 7c90498a5b3..3b9e47b84f5 100644
--- a/db/migrate/20120519182212_create_last_read_posts.rb
+++ b/db/migrate/20120519182212_create_last_read_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateLastReadPosts < ActiveRecord::Migration[4.2]
def change
create_table :last_read_posts do |t|
diff --git a/db/migrate/20120523180723_create_views.rb b/db/migrate/20120523180723_create_views.rb
index aa201b3dd31..78da1994781 100644
--- a/db/migrate/20120523180723_create_views.rb
+++ b/db/migrate/20120523180723_create_views.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateViews < ActiveRecord::Migration[4.2]
def change
create_table :views, id: false do |t|
diff --git a/db/migrate/20120523184307_add_replies_to_forum_threads.rb b/db/migrate/20120523184307_add_replies_to_forum_threads.rb
index fd5870417c0..04805c10ab5 100644
--- a/db/migrate/20120523184307_add_replies_to_forum_threads.rb
+++ b/db/migrate/20120523184307_add_replies_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddRepliesToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :reply_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120523201329_add_featured_to_forum_threads.rb b/db/migrate/20120523201329_add_featured_to_forum_threads.rb
index ef47cb07e49..11832f45047 100644
--- a/db/migrate/20120523201329_add_featured_to_forum_threads.rb
+++ b/db/migrate/20120523201329_add_featured_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFeaturedToForumThreads < ActiveRecord::Migration[4.2]
def up
add_column :forum_threads, :featured_user1_id, :integer, null: true
diff --git a/db/migrate/20120525194845_add_avg_time_to_forum_threads.rb b/db/migrate/20120525194845_add_avg_time_to_forum_threads.rb
index 08f3bc7f371..0d4533e910a 100644
--- a/db/migrate/20120525194845_add_avg_time_to_forum_threads.rb
+++ b/db/migrate/20120525194845_add_avg_time_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAvgTimeToForumThreads < ActiveRecord::Migration[4.2]
def up
add_column :forum_threads, :avg_time, :integer
diff --git a/db/migrate/20120529175956_create_uploads.rb b/db/migrate/20120529175956_create_uploads.rb
index 9d6c355dd03..02d7cc39b95 100644
--- a/db/migrate/20120529175956_create_uploads.rb
+++ b/db/migrate/20120529175956_create_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUploads < ActiveRecord::Migration[4.2]
def change
create_table :uploads do |t|
diff --git a/db/migrate/20120529202707_create_stars.rb b/db/migrate/20120529202707_create_stars.rb
index 75e75888379..99655810df8 100644
--- a/db/migrate/20120529202707_create_stars.rb
+++ b/db/migrate/20120529202707_create_stars.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateStars < ActiveRecord::Migration[4.2]
def change
create_table :stars, id: false do |t|
diff --git a/db/migrate/20120530150726_create_forum_thread_user.rb b/db/migrate/20120530150726_create_forum_thread_user.rb
index 272e96d5647..25974993874 100644
--- a/db/migrate/20120530150726_create_forum_thread_user.rb
+++ b/db/migrate/20120530150726_create_forum_thread_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateForumThreadUser < ActiveRecord::Migration[4.2]
def up
create_table :forum_thread_users, id: false do |t|
diff --git a/db/migrate/20120530160745_migrate_posted.rb b/db/migrate/20120530160745_migrate_posted.rb
index 599c8810e4a..044dcb7af74 100644
--- a/db/migrate/20120530160745_migrate_posted.rb
+++ b/db/migrate/20120530160745_migrate_posted.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigratePosted < ActiveRecord::Migration[4.2]
def up
end
diff --git a/db/migrate/20120530200724_add_index_to_forum_threads.rb b/db/migrate/20120530200724_add_index_to_forum_threads.rb
index 35045d19517..79466c1d4e7 100644
--- a/db/migrate/20120530200724_add_index_to_forum_threads.rb
+++ b/db/migrate/20120530200724_add_index_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexToForumThreads < ActiveRecord::Migration[4.2]
def change
add_index :forum_threads, :last_posted_at
diff --git a/db/migrate/20120530212912_create_forum_thread_links.rb b/db/migrate/20120530212912_create_forum_thread_links.rb
index f43cbf9f2d0..de8b5e99622 100644
--- a/db/migrate/20120530212912_create_forum_thread_links.rb
+++ b/db/migrate/20120530212912_create_forum_thread_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateForumThreadLinks < ActiveRecord::Migration[4.2]
def change
create_table :forum_thread_links do |t|
diff --git a/db/migrate/20120614190726_add_tags_to_forum_threads.rb b/db/migrate/20120614190726_add_tags_to_forum_threads.rb
index 042f32b92ac..0ec6bf02111 100644
--- a/db/migrate/20120614190726_add_tags_to_forum_threads.rb
+++ b/db/migrate/20120614190726_add_tags_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTagsToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :tag, :string, null: true, limit: 25
diff --git a/db/migrate/20120614202024_add_quote_count_to_posts.rb b/db/migrate/20120614202024_add_quote_count_to_posts.rb
index 373e800789f..d43f8af8fa5 100644
--- a/db/migrate/20120614202024_add_quote_count_to_posts.rb
+++ b/db/migrate/20120614202024_add_quote_count_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddQuoteCountToPosts < ActiveRecord::Migration[4.2]
def up
add_column :posts, :quote_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120615180517_create_bookmarks.rb b/db/migrate/20120615180517_create_bookmarks.rb
index b8b1f66e4ba..49433756eb7 100644
--- a/db/migrate/20120615180517_create_bookmarks.rb
+++ b/db/migrate/20120615180517_create_bookmarks.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateBookmarks < ActiveRecord::Migration[4.2]
def change
create_table :bookmarks do |t|
diff --git a/db/migrate/20120618152946_add_reply_below_to_posts.rb b/db/migrate/20120618152946_add_reply_below_to_posts.rb
index 33fcc006836..812d839fd4e 100644
--- a/db/migrate/20120618152946_add_reply_below_to_posts.rb
+++ b/db/migrate/20120618152946_add_reply_below_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReplyBelowToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :reply_below_post_number, :integer, null: true
diff --git a/db/migrate/20120618212349_create_post_timings.rb b/db/migrate/20120618212349_create_post_timings.rb
index 4cfbf9d4aed..b8ea4a28589 100644
--- a/db/migrate/20120618212349_create_post_timings.rb
+++ b/db/migrate/20120618212349_create_post_timings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostTimings < ActiveRecord::Migration[4.2]
def change
create_table :post_timings do |t|
diff --git a/db/migrate/20120618214856_create_message_bus.rb b/db/migrate/20120618214856_create_message_bus.rb
index a81441d5ad5..929fb0fea57 100644
--- a/db/migrate/20120618214856_create_message_bus.rb
+++ b/db/migrate/20120618214856_create_message_bus.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateMessageBus < ActiveRecord::Migration[4.2]
def change
create_table :message_bus do |t|
diff --git a/db/migrate/20120619150807_fix_post_timings.rb b/db/migrate/20120619150807_fix_post_timings.rb
index 4e6fd051ebf..c2ff90805a5 100644
--- a/db/migrate/20120619150807_fix_post_timings.rb
+++ b/db/migrate/20120619150807_fix_post_timings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixPostTimings < ActiveRecord::Migration[4.2]
def up
remove_index :post_timings, [:thread_id, :post_number]
diff --git a/db/migrate/20120619153349_drop_read_posts.rb b/db/migrate/20120619153349_drop_read_posts.rb
index 89b74727513..d68fbc733d4 100644
--- a/db/migrate/20120619153349_drop_read_posts.rb
+++ b/db/migrate/20120619153349_drop_read_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DropReadPosts < ActiveRecord::Migration[4.2]
def up
drop_table :read_posts
diff --git a/db/migrate/20120619172714_add_post_number_to_bookmarks.rb b/db/migrate/20120619172714_add_post_number_to_bookmarks.rb
index 7a21dda8ad5..6976191f42a 100644
--- a/db/migrate/20120619172714_add_post_number_to_bookmarks.rb
+++ b/db/migrate/20120619172714_add_post_number_to_bookmarks.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostNumberToBookmarks < ActiveRecord::Migration[4.2]
def change
drop_table :bookmarks
diff --git a/db/migrate/20120621155351_add_seen_post_count_to_forum_thread_users.rb b/db/migrate/20120621155351_add_seen_post_count_to_forum_thread_users.rb
index 20199118cba..074c80ec364 100644
--- a/db/migrate/20120621155351_add_seen_post_count_to_forum_thread_users.rb
+++ b/db/migrate/20120621155351_add_seen_post_count_to_forum_thread_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSeenPostCountToForumThreadUsers < ActiveRecord::Migration[4.2]
def change
remove_column :post_timings, :id
diff --git a/db/migrate/20120621190310_add_deleted_at_to_forum_threads.rb b/db/migrate/20120621190310_add_deleted_at_to_forum_threads.rb
index 0d4b9c063b3..372a1f3ece7 100644
--- a/db/migrate/20120621190310_add_deleted_at_to_forum_threads.rb
+++ b/db/migrate/20120621190310_add_deleted_at_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDeletedAtToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :deleted_at, :datetime
diff --git a/db/migrate/20120622200242_create_notifications.rb b/db/migrate/20120622200242_create_notifications.rb
index 116b111974b..b6f8a320b77 100644
--- a/db/migrate/20120622200242_create_notifications.rb
+++ b/db/migrate/20120622200242_create_notifications.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateNotifications < ActiveRecord::Migration[4.2]
def change
create_table :notifications do |t|
diff --git a/db/migrate/20120625145714_add_seen_notification_id_to_users.rb b/db/migrate/20120625145714_add_seen_notification_id_to_users.rb
index c14c7f40c9a..75b975dd7c1 100644
--- a/db/migrate/20120625145714_add_seen_notification_id_to_users.rb
+++ b/db/migrate/20120625145714_add_seen_notification_id_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSeenNotificationIdToUsers < ActiveRecord::Migration[4.2]
def change
diff --git a/db/migrate/20120625162318_add_deleted_at_to_posts.rb b/db/migrate/20120625162318_add_deleted_at_to_posts.rb
index 55efd8b5bb4..f653cb28401 100644
--- a/db/migrate/20120625162318_add_deleted_at_to_posts.rb
+++ b/db/migrate/20120625162318_add_deleted_at_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDeletedAtToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :deleted_at, :datetime
diff --git a/db/migrate/20120625174544_add_highest_post_number_to_forum_threads.rb b/db/migrate/20120625174544_add_highest_post_number_to_forum_threads.rb
index 3a9cf51ed54..278e88f14f6 100644
--- a/db/migrate/20120625174544_add_highest_post_number_to_forum_threads.rb
+++ b/db/migrate/20120625174544_add_highest_post_number_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddHighestPostNumberToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :highest_post_number, :integer, default: 0, null: false
diff --git a/db/migrate/20120625195326_add_image_url_to_forum_threads.rb b/db/migrate/20120625195326_add_image_url_to_forum_threads.rb
index 5f9cdfa4cad..5b6fba48a8d 100644
--- a/db/migrate/20120625195326_add_image_url_to_forum_threads.rb
+++ b/db/migrate/20120625195326_add_image_url_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddImageUrlToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :image_url, :string
diff --git a/db/migrate/20120629143908_rename_expression_type_id.rb b/db/migrate/20120629143908_rename_expression_type_id.rb
index ccb7f6f4e74..630cc4afae1 100644
--- a/db/migrate/20120629143908_rename_expression_type_id.rb
+++ b/db/migrate/20120629143908_rename_expression_type_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameExpressionTypeId < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20120629150253_denormalize_expressions.rb b/db/migrate/20120629150253_denormalize_expressions.rb
index 9c0ae638400..eb0e386ec1a 100644
--- a/db/migrate/20120629150253_denormalize_expressions.rb
+++ b/db/migrate/20120629150253_denormalize_expressions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DenormalizeExpressions < ActiveRecord::Migration[4.2]
def change
diff --git a/db/migrate/20120629151243_make_expressions_less_generic.rb b/db/migrate/20120629151243_make_expressions_less_generic.rb
index a442abe5748..030d5bb2bd8 100644
--- a/db/migrate/20120629151243_make_expressions_less_generic.rb
+++ b/db/migrate/20120629151243_make_expressions_less_generic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MakeExpressionsLessGeneric < ActiveRecord::Migration[4.2]
def up
rename_column :expressions, :parent_id, :post_id
diff --git a/db/migrate/20120629182637_create_incoming_links.rb b/db/migrate/20120629182637_create_incoming_links.rb
index ffa324c0a9d..70a1ffa2e93 100644
--- a/db/migrate/20120629182637_create_incoming_links.rb
+++ b/db/migrate/20120629182637_create_incoming_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateIncomingLinks < ActiveRecord::Migration[4.2]
def change
create_table :incoming_links do |t|
diff --git a/db/migrate/20120702211427_create_replies.rb b/db/migrate/20120702211427_create_replies.rb
index fccfd383cde..a252a11501e 100644
--- a/db/migrate/20120702211427_create_replies.rb
+++ b/db/migrate/20120702211427_create_replies.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateReplies < ActiveRecord::Migration[4.2]
def change
create_table :post_replies, id: false do |t|
diff --git a/db/migrate/20120703184734_add_reflection_to_forum_thread_links.rb b/db/migrate/20120703184734_add_reflection_to_forum_thread_links.rb
index aa41ca99056..6cefef0eed7 100644
--- a/db/migrate/20120703184734_add_reflection_to_forum_thread_links.rb
+++ b/db/migrate/20120703184734_add_reflection_to_forum_thread_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReflectionToForumThreadLinks < ActiveRecord::Migration[4.2]
def change
add_column :forum_thread_links, :reflection, :boolean, default: false
diff --git a/db/migrate/20120703201312_add_incoming_link_count_to_posts.rb b/db/migrate/20120703201312_add_incoming_link_count_to_posts.rb
index ca1641a5d41..9701bc9e764 100644
--- a/db/migrate/20120703201312_add_incoming_link_count_to_posts.rb
+++ b/db/migrate/20120703201312_add_incoming_link_count_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIncomingLinkCountToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :incoming_link_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120703203623_add_incoming_link_count_to_forum_threads.rb b/db/migrate/20120703203623_add_incoming_link_count_to_forum_threads.rb
index 18684044edb..6aaab73ba3e 100644
--- a/db/migrate/20120703203623_add_incoming_link_count_to_forum_threads.rb
+++ b/db/migrate/20120703203623_add_incoming_link_count_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIncomingLinkCountToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :incoming_link_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120703210004_add_bookmark_count_to_posts.rb b/db/migrate/20120703210004_add_bookmark_count_to_posts.rb
index ddb1a98a02b..2805238825a 100644
--- a/db/migrate/20120703210004_add_bookmark_count_to_posts.rb
+++ b/db/migrate/20120703210004_add_bookmark_count_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddBookmarkCountToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :bookmark_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120704160659_add_avg_time_to_posts.rb b/db/migrate/20120704160659_add_avg_time_to_posts.rb
index 2aa76da9c58..d51b4836514 100644
--- a/db/migrate/20120704160659_add_avg_time_to_posts.rb
+++ b/db/migrate/20120704160659_add_avg_time_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAvgTimeToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :avg_time, :integer, null: true
diff --git a/db/migrate/20120704201743_add_view_count_to_posts.rb b/db/migrate/20120704201743_add_view_count_to_posts.rb
index 286b9b97458..895a8b21f5e 100644
--- a/db/migrate/20120704201743_add_view_count_to_posts.rb
+++ b/db/migrate/20120704201743_add_view_count_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddViewCountToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :views, :integer, default: 0, null: false
diff --git a/db/migrate/20120705181724_add_user_to_versions.rb b/db/migrate/20120705181724_add_user_to_versions.rb
index 0e68b887d6e..eb0795c11f9 100644
--- a/db/migrate/20120705181724_add_user_to_versions.rb
+++ b/db/migrate/20120705181724_add_user_to_versions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserToVersions < ActiveRecord::Migration[4.2]
def change
execute "UPDATE versions SET user_type = 'User', user_id = posts.user_id
diff --git a/db/migrate/20120708210305_add_last_posted_at_to_users.rb b/db/migrate/20120708210305_add_last_posted_at_to_users.rb
index e0df759ebd7..5a1a0ab0002 100644
--- a/db/migrate/20120708210305_add_last_posted_at_to_users.rb
+++ b/db/migrate/20120708210305_add_last_posted_at_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastPostedAtToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :last_posted_at, :datetime, null: true
diff --git a/db/migrate/20120712150500_create_categories.rb b/db/migrate/20120712150500_create_categories.rb
index 329afb22bcd..3f5ef230fdb 100644
--- a/db/migrate/20120712150500_create_categories.rb
+++ b/db/migrate/20120712150500_create_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateCategories < ActiveRecord::Migration[4.2]
def up
create_table :categories do |t|
diff --git a/db/migrate/20120712151934_add_category_id_to_forum_threads.rb b/db/migrate/20120712151934_add_category_id_to_forum_threads.rb
index d90799dc4fb..d9feac5477e 100644
--- a/db/migrate/20120712151934_add_category_id_to_forum_threads.rb
+++ b/db/migrate/20120712151934_add_category_id_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCategoryIdToForumThreads < ActiveRecord::Migration[4.2]
def up
add_column :forum_threads, :category_id, :integer
diff --git a/db/migrate/20120713201324_create_category_featured_threads.rb b/db/migrate/20120713201324_create_category_featured_threads.rb
index 897992ce64a..30082244338 100644
--- a/db/migrate/20120713201324_create_category_featured_threads.rb
+++ b/db/migrate/20120713201324_create_category_featured_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateCategoryFeaturedThreads < ActiveRecord::Migration[4.2]
def change
create_table :category_featured_threads, id: false do |t|
diff --git a/db/migrate/20120716020835_create_site_settings.rb b/db/migrate/20120716020835_create_site_settings.rb
index f554de545a1..2c2ef633d8e 100644
--- a/db/migrate/20120716020835_create_site_settings.rb
+++ b/db/migrate/20120716020835_create_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateSiteSettings < ActiveRecord::Migration[4.2]
def change
create_table :site_settings do |t|
diff --git a/db/migrate/20120716173544_add_stats_to_categories.rb b/db/migrate/20120716173544_add_stats_to_categories.rb
index d904089921e..b8e6070523b 100644
--- a/db/migrate/20120716173544_add_stats_to_categories.rb
+++ b/db/migrate/20120716173544_add_stats_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddStatsToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :posts_year, :integer
diff --git a/db/migrate/20120718044955_create_user_open_ids.rb b/db/migrate/20120718044955_create_user_open_ids.rb
index 626c27897c1..19e0c0e7979 100644
--- a/db/migrate/20120718044955_create_user_open_ids.rb
+++ b/db/migrate/20120718044955_create_user_open_ids.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUserOpenIds < ActiveRecord::Migration[4.2]
def change
create_table :user_open_ids do |t|
diff --git a/db/migrate/20120719004636_add_email_hashed_password_name_salt_to_users.rb b/db/migrate/20120719004636_add_email_hashed_password_name_salt_to_users.rb
index a4169738e72..355e4c42b35 100644
--- a/db/migrate/20120719004636_add_email_hashed_password_name_salt_to_users.rb
+++ b/db/migrate/20120719004636_add_email_hashed_password_name_salt_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddEmailHashedPasswordNameSaltToUsers < ActiveRecord::Migration[4.2]
def up
add_column :users, :email, :string, limit: 256
diff --git a/db/migrate/20120720013733_add_username_lower_to_users.rb b/db/migrate/20120720013733_add_username_lower_to_users.rb
index 0a6a89e741a..d396aa9bef5 100644
--- a/db/migrate/20120720013733_add_username_lower_to_users.rb
+++ b/db/migrate/20120720013733_add_username_lower_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUsernameLowerToUsers < ActiveRecord::Migration[4.2]
def up
add_column :users, :username_lower, :string, limit: 20
diff --git a/db/migrate/20120720044246_add_auth_token_to_users.rb b/db/migrate/20120720044246_add_auth_token_to_users.rb
index d489e99b074..ee0c7182d93 100644
--- a/db/migrate/20120720044246_add_auth_token_to_users.rb
+++ b/db/migrate/20120720044246_add_auth_token_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAuthTokenToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :auth_token, :string, limit: 32
diff --git a/db/migrate/20120720162422_add_forum_id_to_categories.rb b/db/migrate/20120720162422_add_forum_id_to_categories.rb
index 8b253d15496..8868e767855 100644
--- a/db/migrate/20120720162422_add_forum_id_to_categories.rb
+++ b/db/migrate/20120720162422_add_forum_id_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddForumIdToCategories < ActiveRecord::Migration[4.2]
def up
add_column :categories, :forum_id, :integer
diff --git a/db/migrate/20120723051512_add_not_nulls_to_user_open_ids.rb b/db/migrate/20120723051512_add_not_nulls_to_user_open_ids.rb
index 44666072a7e..f0794937468 100644
--- a/db/migrate/20120723051512_add_not_nulls_to_user_open_ids.rb
+++ b/db/migrate/20120723051512_add_not_nulls_to_user_open_ids.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNotNullsToUserOpenIds < ActiveRecord::Migration[4.2]
def change
change_column :user_open_ids, :user_id, :integer, null: false
diff --git a/db/migrate/20120724234502_add_last_seen_at_to_users.rb b/db/migrate/20120724234502_add_last_seen_at_to_users.rb
index c957404fa8f..356624fdddc 100644
--- a/db/migrate/20120724234502_add_last_seen_at_to_users.rb
+++ b/db/migrate/20120724234502_add_last_seen_at_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastSeenAtToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :last_seen_at, :datetime
diff --git a/db/migrate/20120724234711_add_website_to_users.rb b/db/migrate/20120724234711_add_website_to_users.rb
index 96b5ba64d2d..c4531cf4b58 100644
--- a/db/migrate/20120724234711_add_website_to_users.rb
+++ b/db/migrate/20120724234711_add_website_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddWebsiteToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :website, :string
diff --git a/db/migrate/20120725183347_add_excerpt_to_categories.rb b/db/migrate/20120725183347_add_excerpt_to_categories.rb
index 3171ec2a814..8dc0983c757 100644
--- a/db/migrate/20120725183347_add_excerpt_to_categories.rb
+++ b/db/migrate/20120725183347_add_excerpt_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddExcerptToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :excerpt, :string, limit: 250
diff --git a/db/migrate/20120726201830_add_invisible_to_forum_thread.rb b/db/migrate/20120726201830_add_invisible_to_forum_thread.rb
index 404350ed86b..faad5921203 100644
--- a/db/migrate/20120726201830_add_invisible_to_forum_thread.rb
+++ b/db/migrate/20120726201830_add_invisible_to_forum_thread.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddInvisibleToForumThread < ActiveRecord::Migration[4.2]
def up
add_column :forum_threads, :invisible, :boolean, default: false, null: false
diff --git a/db/migrate/20120726235129_add_user_id_to_categories.rb b/db/migrate/20120726235129_add_user_id_to_categories.rb
index 376781c4fd1..a9d38f6358e 100644
--- a/db/migrate/20120726235129_add_user_id_to_categories.rb
+++ b/db/migrate/20120726235129_add_user_id_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserIdToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :user_id, :integer
diff --git a/db/migrate/20120727005556_remove_excerpt_from_categories.rb b/db/migrate/20120727005556_remove_excerpt_from_categories.rb
index 8699dab5d59..0e9ff048a07 100644
--- a/db/migrate/20120727005556_remove_excerpt_from_categories.rb
+++ b/db/migrate/20120727005556_remove_excerpt_from_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveExcerptFromCategories < ActiveRecord::Migration[4.2]
def up
remove_column :categories, :excerpt
diff --git a/db/migrate/20120727150428_rename_invisible.rb b/db/migrate/20120727150428_rename_invisible.rb
index 4829a1f5f28..68986b1cadc 100644
--- a/db/migrate/20120727150428_rename_invisible.rb
+++ b/db/migrate/20120727150428_rename_invisible.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameInvisible < ActiveRecord::Migration[4.2]
def change
diff --git a/db/migrate/20120727213543_add_thread_counts_to_categories.rb b/db/migrate/20120727213543_add_thread_counts_to_categories.rb
index cd922b175f9..35f0242bf8d 100644
--- a/db/migrate/20120727213543_add_thread_counts_to_categories.rb
+++ b/db/migrate/20120727213543_add_thread_counts_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddThreadCountsToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :threads_year, :integer
diff --git a/db/migrate/20120802151210_add_icon_to_expression_types.rb b/db/migrate/20120802151210_add_icon_to_expression_types.rb
index ab833036fb5..7c30020ac0f 100644
--- a/db/migrate/20120802151210_add_icon_to_expression_types.rb
+++ b/db/migrate/20120802151210_add_icon_to_expression_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIconToExpressionTypes < ActiveRecord::Migration[4.2]
def change
add_column :expression_types, :icon, :string, limit: 20
diff --git a/db/migrate/20120803191426_add_admin_flag_to_users.rb b/db/migrate/20120803191426_add_admin_flag_to_users.rb
index f60b405ee30..0e0908a8176 100644
--- a/db/migrate/20120803191426_add_admin_flag_to_users.rb
+++ b/db/migrate/20120803191426_add_admin_flag_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAdminFlagToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :admin, :boolean, default: false, null: false
diff --git a/db/migrate/20120806030641_add_new_password_new_salt_email_token_to_users.rb b/db/migrate/20120806030641_add_new_password_new_salt_email_token_to_users.rb
index 7277b4eb450..5f5fc673aa8 100644
--- a/db/migrate/20120806030641_add_new_password_new_salt_email_token_to_users.rb
+++ b/db/migrate/20120806030641_add_new_password_new_salt_email_token_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNewPasswordNewSaltEmailTokenToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :new_salt, :string, limit: 32
diff --git a/db/migrate/20120806062617_remove_new_password_stuff_from_user.rb b/db/migrate/20120806062617_remove_new_password_stuff_from_user.rb
index c1a3069a256..c58b290110f 100644
--- a/db/migrate/20120806062617_remove_new_password_stuff_from_user.rb
+++ b/db/migrate/20120806062617_remove_new_password_stuff_from_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveNewPasswordStuffFromUser < ActiveRecord::Migration[4.2]
def change
remove_column :users, :new_password_hash
diff --git a/db/migrate/20120807223020_create_actions.rb b/db/migrate/20120807223020_create_actions.rb
index c84336dc22e..9819e5d31e4 100644
--- a/db/migrate/20120807223020_create_actions.rb
+++ b/db/migrate/20120807223020_create_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateActions < ActiveRecord::Migration[4.2]
def change
create_table :actions do |t|
diff --git a/db/migrate/20120809020415_remove_site_id.rb b/db/migrate/20120809020415_remove_site_id.rb
index 24a8019824f..93c242f8971 100644
--- a/db/migrate/20120809020415_remove_site_id.rb
+++ b/db/migrate/20120809020415_remove_site_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveSiteId < ActiveRecord::Migration[4.2]
def up
drop_table 'sites'
diff --git a/db/migrate/20120809030647_remove_forum_id.rb b/db/migrate/20120809030647_remove_forum_id.rb
index f489fc52e5a..e13cfade6cd 100644
--- a/db/migrate/20120809030647_remove_forum_id.rb
+++ b/db/migrate/20120809030647_remove_forum_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveForumId < ActiveRecord::Migration[4.2]
def up
remove_column 'forum_threads', 'forum_id'
diff --git a/db/migrate/20120809053414_correct_indexing_on_posts.rb b/db/migrate/20120809053414_correct_indexing_on_posts.rb
index ce29c25a5a6..2600244583d 100644
--- a/db/migrate/20120809053414_correct_indexing_on_posts.rb
+++ b/db/migrate/20120809053414_correct_indexing_on_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CorrectIndexingOnPosts < ActiveRecord::Migration[4.2]
def up
execute "update posts pp
diff --git a/db/migrate/20120809154750_remove_index_for_now.rb b/db/migrate/20120809154750_remove_index_for_now.rb
index dabc1728506..44a2c1189e9 100644
--- a/db/migrate/20120809154750_remove_index_for_now.rb
+++ b/db/migrate/20120809154750_remove_index_for_now.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveIndexForNow < ActiveRecord::Migration[4.2]
def up
remove_index "posts", ["forum_thread_id", "post_number"]
diff --git a/db/migrate/20120809174649_create_post_actions.rb b/db/migrate/20120809174649_create_post_actions.rb
index f9d2d8af87d..e437e40b543 100644
--- a/db/migrate/20120809174649_create_post_actions.rb
+++ b/db/migrate/20120809174649_create_post_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostActions < ActiveRecord::Migration[4.2]
def up
create_table :post_actions do |t|
diff --git a/db/migrate/20120809175110_create_post_action_types.rb b/db/migrate/20120809175110_create_post_action_types.rb
index 1759817ea3e..af693f1fc15 100644
--- a/db/migrate/20120809175110_create_post_action_types.rb
+++ b/db/migrate/20120809175110_create_post_action_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostActionTypes < ActiveRecord::Migration[4.2]
def change
create_table(:post_action_types, id: false) do |t|
diff --git a/db/migrate/20120809201855_migrate_bookmarks_to_post_actions.rb b/db/migrate/20120809201855_migrate_bookmarks_to_post_actions.rb
index 5b6705e8662..2518020556b 100644
--- a/db/migrate/20120809201855_migrate_bookmarks_to_post_actions.rb
+++ b/db/migrate/20120809201855_migrate_bookmarks_to_post_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateBookmarksToPostActions < ActiveRecord::Migration[4.2]
def up
drop_table "bookmarks"
diff --git a/db/migrate/20120810064839_rename_actions_to_user_actions.rb b/db/migrate/20120810064839_rename_actions_to_user_actions.rb
index 6be0a2b8b3c..051e2e9fef9 100644
--- a/db/migrate/20120810064839_rename_actions_to_user_actions.rb
+++ b/db/migrate/20120810064839_rename_actions_to_user_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameActionsToUserActions < ActiveRecord::Migration[4.2]
def change
rename_table 'actions', 'user_actions'
diff --git a/db/migrate/20120812235417_retire_expressions.rb b/db/migrate/20120812235417_retire_expressions.rb
index 3f565558c18..a5494ccd2c2 100644
--- a/db/migrate/20120812235417_retire_expressions.rb
+++ b/db/migrate/20120812235417_retire_expressions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RetireExpressions < ActiveRecord::Migration[4.2]
def up
execute 'insert into post_actions (post_action_type_id, user_id, post_id, created_at, updated_at)
diff --git a/db/migrate/20120813004347_rename_expression_columns_in_forum_thread.rb b/db/migrate/20120813004347_rename_expression_columns_in_forum_thread.rb
index 4483800e4f6..43958a86225 100644
--- a/db/migrate/20120813004347_rename_expression_columns_in_forum_thread.rb
+++ b/db/migrate/20120813004347_rename_expression_columns_in_forum_thread.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameExpressionColumnsInForumThread < ActiveRecord::Migration[4.2]
def change
rename_column 'forum_threads', 'expression1_count', 'off_topic_count'
diff --git a/db/migrate/20120813042912_rename_expression_columns_in_posts.rb b/db/migrate/20120813042912_rename_expression_columns_in_posts.rb
index 8b22ec5a279..90ac91d4159 100644
--- a/db/migrate/20120813042912_rename_expression_columns_in_posts.rb
+++ b/db/migrate/20120813042912_rename_expression_columns_in_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameExpressionColumnsInPosts < ActiveRecord::Migration[4.2]
def change
rename_column 'posts', 'expression1_count', 'off_topic_count'
diff --git a/db/migrate/20120813201426_create_forum_thread_link_clicks.rb b/db/migrate/20120813201426_create_forum_thread_link_clicks.rb
index 65e67011b7e..0869ba2b399 100644
--- a/db/migrate/20120813201426_create_forum_thread_link_clicks.rb
+++ b/db/migrate/20120813201426_create_forum_thread_link_clicks.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateForumThreadLinkClicks < ActiveRecord::Migration[4.2]
def change
create_table :forum_thread_link_clicks do |t|
diff --git a/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb b/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb
index 7ddf6d405b9..ffbfd6d2787 100644
--- a/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb
+++ b/db/migrate/20120815004411_add_unique_index_to_forum_thread_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUniqueIndexToForumThreadLinks < ActiveRecord::Migration[4.2]
def change
diff --git a/db/migrate/20120815180106_add_post_type_to_posts.rb b/db/migrate/20120815180106_add_post_type_to_posts.rb
index 4f3b00c168d..60d904e461b 100644
--- a/db/migrate/20120815180106_add_post_type_to_posts.rb
+++ b/db/migrate/20120815180106_add_post_type_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostTypeToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :post_type, :integer, default: 1, null: false
diff --git a/db/migrate/20120815204733_add_moderator_posts_count_to_forum_threads.rb b/db/migrate/20120815204733_add_moderator_posts_count_to_forum_threads.rb
index 49717c4fd92..071b0a902c9 100644
--- a/db/migrate/20120815204733_add_moderator_posts_count_to_forum_threads.rb
+++ b/db/migrate/20120815204733_add_moderator_posts_count_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddModeratorPostsCountToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :moderator_posts_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120816050526_add_unique_constraint_to_user_actions.rb b/db/migrate/20120816050526_add_unique_constraint_to_user_actions.rb
index 43bbe102d11..0b71524f63f 100644
--- a/db/migrate/20120816050526_add_unique_constraint_to_user_actions.rb
+++ b/db/migrate/20120816050526_add_unique_constraint_to_user_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUniqueConstraintToUserActions < ActiveRecord::Migration[4.2]
def change
add_index :user_actions, ['action_type', 'user_id', 'target_forum_thread_id', 'target_post_id', 'acting_user_id'], name: "idx_unique_rows", unique: true
diff --git a/db/migrate/20120816205537_add_forum_thread_states.rb b/db/migrate/20120816205537_add_forum_thread_states.rb
index 5a80831a14e..16de60e552c 100644
--- a/db/migrate/20120816205537_add_forum_thread_states.rb
+++ b/db/migrate/20120816205537_add_forum_thread_states.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddForumThreadStates < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :closed, :boolean, default: false, null: false
diff --git a/db/migrate/20120816205538_add_starred_at_to_forum_thread_user.rb b/db/migrate/20120816205538_add_starred_at_to_forum_thread_user.rb
index c2643594d43..8421b8b544d 100644
--- a/db/migrate/20120816205538_add_starred_at_to_forum_thread_user.rb
+++ b/db/migrate/20120816205538_add_starred_at_to_forum_thread_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddStarredAtToForumThreadUser < ActiveRecord::Migration[4.2]
def up
add_column :forum_thread_users, :starred_at, :datetime
diff --git a/db/migrate/20120820191804_add_search_indices.rb b/db/migrate/20120820191804_add_search_indices.rb
index 11f8c307485..3ba244f818d 100644
--- a/db/migrate/20120820191804_add_search_indices.rb
+++ b/db/migrate/20120820191804_add_search_indices.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSearchIndices < ActiveRecord::Migration[4.2]
def up
execute "CREATE INDEX idx_search_user ON users USING GIN(to_tsvector('english', username))"
diff --git a/db/migrate/20120821191616_add_bumped_at_to_forum_threads.rb b/db/migrate/20120821191616_add_bumped_at_to_forum_threads.rb
index 96217a0ad84..bc3bfdef3be 100644
--- a/db/migrate/20120821191616_add_bumped_at_to_forum_threads.rb
+++ b/db/migrate/20120821191616_add_bumped_at_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddBumpedAtToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :bumped_at, :datetime
diff --git a/db/migrate/20120823205956_add_slug_to_categories.rb b/db/migrate/20120823205956_add_slug_to_categories.rb
index 76cdab26a71..d259c838428 100644
--- a/db/migrate/20120823205956_add_slug_to_categories.rb
+++ b/db/migrate/20120823205956_add_slug_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSlugToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :slug, :string
diff --git a/db/migrate/20120824171908_create_category_featured_users.rb b/db/migrate/20120824171908_create_category_featured_users.rb
index c97fcf195f4..5a57b77214f 100644
--- a/db/migrate/20120824171908_create_category_featured_users.rb
+++ b/db/migrate/20120824171908_create_category_featured_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateCategoryFeaturedUsers < ActiveRecord::Migration[4.2]
def change
create_table :category_featured_users do |t|
diff --git a/db/migrate/20120828204209_create_onebox_renders.rb b/db/migrate/20120828204209_create_onebox_renders.rb
index 297be79b76f..1f41b4852e3 100644
--- a/db/migrate/20120828204209_create_onebox_renders.rb
+++ b/db/migrate/20120828204209_create_onebox_renders.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateOneboxRenders < ActiveRecord::Migration[4.2]
def change
create_table :onebox_renders do |t|
diff --git a/db/migrate/20120828204624_create_post_onebox_renders.rb b/db/migrate/20120828204624_create_post_onebox_renders.rb
index fae17c5052e..4eadbfbd23e 100644
--- a/db/migrate/20120828204624_create_post_onebox_renders.rb
+++ b/db/migrate/20120828204624_create_post_onebox_renders.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostOneboxRenders < ActiveRecord::Migration[4.2]
def change
create_table :post_onebox_renders, id: false do |t|
diff --git a/db/migrate/20120830182736_add_preview_to_onebox_renders.rb b/db/migrate/20120830182736_add_preview_to_onebox_renders.rb
index e41805580e2..27d677014e9 100644
--- a/db/migrate/20120830182736_add_preview_to_onebox_renders.rb
+++ b/db/migrate/20120830182736_add_preview_to_onebox_renders.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPreviewToOneboxRenders < ActiveRecord::Migration[4.2]
def change
add_column :onebox_renders, :preview, :text, null: true
diff --git a/db/migrate/20120910171504_remove_description_from_site_settings.rb b/db/migrate/20120910171504_remove_description_from_site_settings.rb
index f353e117c11..3c434a1a23a 100644
--- a/db/migrate/20120910171504_remove_description_from_site_settings.rb
+++ b/db/migrate/20120910171504_remove_description_from_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveDescriptionFromSiteSettings < ActiveRecord::Migration[4.2]
def up
remove_column :site_settings, :description
diff --git a/db/migrate/20120918152319_rename_views_to_reads.rb b/db/migrate/20120918152319_rename_views_to_reads.rb
index 8f65f1c6468..f014dd5652e 100644
--- a/db/migrate/20120918152319_rename_views_to_reads.rb
+++ b/db/migrate/20120918152319_rename_views_to_reads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameViewsToReads < ActiveRecord::Migration[4.2]
def up
rename_column :posts, :views, :reads
diff --git a/db/migrate/20120918205931_add_sub_tag_to_forum_threads.rb b/db/migrate/20120918205931_add_sub_tag_to_forum_threads.rb
index bcd4f98b6c5..2b2d4e99118 100644
--- a/db/migrate/20120918205931_add_sub_tag_to_forum_threads.rb
+++ b/db/migrate/20120918205931_add_sub_tag_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSubTagToForumThreads < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :sub_tag, :string
diff --git a/db/migrate/20120919152846_add_has_best_of_to_forum_threads.rb b/db/migrate/20120919152846_add_has_best_of_to_forum_threads.rb
index ae0b8bbb29d..c37187cef42 100644
--- a/db/migrate/20120919152846_add_has_best_of_to_forum_threads.rb
+++ b/db/migrate/20120919152846_add_has_best_of_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddHasBestOfToForumThreads < ActiveRecord::Migration[4.2]
def change
diff --git a/db/migrate/20120921055428_add_twitter_user_info.rb b/db/migrate/20120921055428_add_twitter_user_info.rb
index 48b8c34ad6e..8f27148c11b 100644
--- a/db/migrate/20120921055428_add_twitter_user_info.rb
+++ b/db/migrate/20120921055428_add_twitter_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTwitterUserInfo < ActiveRecord::Migration[4.2]
def change
create_table :twitter_user_infos do |t|
diff --git a/db/migrate/20120921155050_create_archetypes.rb b/db/migrate/20120921155050_create_archetypes.rb
index 6e9ae48981e..d8f7954bed4 100644
--- a/db/migrate/20120921155050_create_archetypes.rb
+++ b/db/migrate/20120921155050_create_archetypes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateArchetypes < ActiveRecord::Migration[4.2]
def up
create_table :archetypes do |t|
diff --git a/db/migrate/20120921162512_add_meta_data_to_forum_threads.rb b/db/migrate/20120921162512_add_meta_data_to_forum_threads.rb
index e4377a7744c..872bf935ca9 100644
--- a/db/migrate/20120921162512_add_meta_data_to_forum_threads.rb
+++ b/db/migrate/20120921162512_add_meta_data_to_forum_threads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMetaDataToForumThreads < ActiveRecord::Migration[4.2]
def change
execute "CREATE EXTENSION IF NOT EXISTS hstore"
diff --git a/db/migrate/20120921163606_create_archetype_options.rb b/db/migrate/20120921163606_create_archetype_options.rb
index f772013d90a..0d6661a2594 100644
--- a/db/migrate/20120921163606_create_archetype_options.rb
+++ b/db/migrate/20120921163606_create_archetype_options.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateArchetypeOptions < ActiveRecord::Migration[4.2]
def change
create_table :archetype_options do |t|
diff --git a/db/migrate/20120924182000_add_hstore_extension.rb b/db/migrate/20120924182000_add_hstore_extension.rb
index f8145e7e7f3..0b9847f18db 100644
--- a/db/migrate/20120924182000_add_hstore_extension.rb
+++ b/db/migrate/20120924182000_add_hstore_extension.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddHstoreExtension < ActiveRecord::Migration[4.2]
def self.up
execute "CREATE EXTENSION IF NOT EXISTS hstore"
diff --git a/db/migrate/20120924182031_add_vote_count_to_posts.rb b/db/migrate/20120924182031_add_vote_count_to_posts.rb
index 1b0e7395700..a6be1ecedb1 100644
--- a/db/migrate/20120924182031_add_vote_count_to_posts.rb
+++ b/db/migrate/20120924182031_add_vote_count_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddVoteCountToPosts < ActiveRecord::Migration[4.2]
def change
add_column :forum_threads, :vote_count, :integer, default: 0, null: false
diff --git a/db/migrate/20120925171620_remove_english_from_post_action_types.rb b/db/migrate/20120925171620_remove_english_from_post_action_types.rb
index b3d2840a22d..0ec45738992 100644
--- a/db/migrate/20120925171620_remove_english_from_post_action_types.rb
+++ b/db/migrate/20120925171620_remove_english_from_post_action_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveEnglishFromPostActionTypes < ActiveRecord::Migration[4.2]
def up
rename_column :post_action_types, :name, :name_key
diff --git a/db/migrate/20120925190802_add_sequence_to_post_action_types.rb b/db/migrate/20120925190802_add_sequence_to_post_action_types.rb
index b82c69f252c..78a1b073e7d 100644
--- a/db/migrate/20120925190802_add_sequence_to_post_action_types.rb
+++ b/db/migrate/20120925190802_add_sequence_to_post_action_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSequenceToPostActionTypes < ActiveRecord::Migration[4.2]
def change
remove_column :post_action_types, :id
diff --git a/db/migrate/20120928170023_add_sort_order_to_posts.rb b/db/migrate/20120928170023_add_sort_order_to_posts.rb
index 3965dc4a3a5..4071dee8780 100644
--- a/db/migrate/20120928170023_add_sort_order_to_posts.rb
+++ b/db/migrate/20120928170023_add_sort_order_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSortOrderToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :sort_order, :integer
diff --git a/db/migrate/20121009161116_add_email_stuff_to_users.rb b/db/migrate/20121009161116_add_email_stuff_to_users.rb
index 839a10bee6b..25afa3cd290 100644
--- a/db/migrate/20121009161116_add_email_stuff_to_users.rb
+++ b/db/migrate/20121009161116_add_email_stuff_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddEmailStuffToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :last_emailed_at, :datetime, null: true
diff --git a/db/migrate/20121011155904_create_email_logs.rb b/db/migrate/20121011155904_create_email_logs.rb
index f6a5af197c2..9d04908bb87 100644
--- a/db/migrate/20121011155904_create_email_logs.rb
+++ b/db/migrate/20121011155904_create_email_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateEmailLogs < ActiveRecord::Migration[4.2]
def change
create_table :email_logs do |t|
diff --git a/db/migrate/20121017162924_convert_archetypes.rb b/db/migrate/20121017162924_convert_archetypes.rb
index b6513f9fbc2..891c413315b 100644
--- a/db/migrate/20121017162924_convert_archetypes.rb
+++ b/db/migrate/20121017162924_convert_archetypes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ConvertArchetypes < ActiveRecord::Migration[4.2]
def up
add_column :forum_threads, :archetype, :string, default: 'regular', null: false
diff --git a/db/migrate/20121018103721_rename_forum_thread_tables.rb b/db/migrate/20121018103721_rename_forum_thread_tables.rb
index e8a3e4160d1..cdcba0994f5 100644
--- a/db/migrate/20121018103721_rename_forum_thread_tables.rb
+++ b/db/migrate/20121018103721_rename_forum_thread_tables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameForumThreadTables < ActiveRecord::Migration[4.2]
def change
rename_table 'forum_threads', 'topics'
diff --git a/db/migrate/20121018133039_create_topic_allowed_users.rb b/db/migrate/20121018133039_create_topic_allowed_users.rb
index 8975ae622f2..e926ae8fbc8 100644
--- a/db/migrate/20121018133039_create_topic_allowed_users.rb
+++ b/db/migrate/20121018133039_create_topic_allowed_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateTopicAllowedUsers < ActiveRecord::Migration[4.2]
def change
create_table :topic_allowed_users do |t|
diff --git a/db/migrate/20121018182709_fix_notification_data.rb b/db/migrate/20121018182709_fix_notification_data.rb
index cbfeb28fd24..73b6a2011e5 100644
--- a/db/migrate/20121018182709_fix_notification_data.rb
+++ b/db/migrate/20121018182709_fix_notification_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixNotificationData < ActiveRecord::Migration[4.2]
def up
execute "UPDATE notifications SET data = replace(data, 'thread_title', 'topic_title')"
diff --git a/db/migrate/20121106015500_drop_avatar_url_from_users.rb b/db/migrate/20121106015500_drop_avatar_url_from_users.rb
index 9d6662322bd..1f27171727f 100644
--- a/db/migrate/20121106015500_drop_avatar_url_from_users.rb
+++ b/db/migrate/20121106015500_drop_avatar_url_from_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# avatar_url does not function properly as it does not properly deal with scaling.
# css based scaling is inefficient and has terrible results in both firefox and ie. canvas based scaling is slow.
#
diff --git a/db/migrate/20121108193516_add_post_action_id_to_notifications.rb b/db/migrate/20121108193516_add_post_action_id_to_notifications.rb
index 01e1f7e7b1c..b67027ca375 100644
--- a/db/migrate/20121108193516_add_post_action_id_to_notifications.rb
+++ b/db/migrate/20121108193516_add_post_action_id_to_notifications.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostActionIdToNotifications < ActiveRecord::Migration[4.2]
def change
add_column :notifications, :post_action_id, :integer, null: true
diff --git a/db/migrate/20121109164630_create_trust_levels.rb b/db/migrate/20121109164630_create_trust_levels.rb
index 8b5fe68192d..108e283df61 100644
--- a/db/migrate/20121109164630_create_trust_levels.rb
+++ b/db/migrate/20121109164630_create_trust_levels.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateTrustLevels < ActiveRecord::Migration[4.2]
def change
create_table :trust_levels do |t|
diff --git a/db/migrate/20121113200844_bio_markdown_support.rb b/db/migrate/20121113200844_bio_markdown_support.rb
index 6ccd73d023f..bb474f656dc 100644
--- a/db/migrate/20121113200844_bio_markdown_support.rb
+++ b/db/migrate/20121113200844_bio_markdown_support.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BioMarkdownSupport < ActiveRecord::Migration[4.2]
def up
rename_column :users, :bio, :bio_raw
diff --git a/db/migrate/20121113200845_create_facebook_user_infos.rb b/db/migrate/20121113200845_create_facebook_user_infos.rb
index 9640031c92d..7b72b967a3d 100644
--- a/db/migrate/20121113200845_create_facebook_user_infos.rb
+++ b/db/migrate/20121113200845_create_facebook_user_infos.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateFacebookUserInfos < ActiveRecord::Migration[4.2]
def change
create_table :facebook_user_infos do |t|
diff --git a/db/migrate/20121115172544_rename_sticky_to_pinned.rb b/db/migrate/20121115172544_rename_sticky_to_pinned.rb
index 915bd3cb4e1..261296c6bc3 100644
--- a/db/migrate/20121115172544_rename_sticky_to_pinned.rb
+++ b/db/migrate/20121115172544_rename_sticky_to_pinned.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameStickyToPinned < ActiveRecord::Migration[4.2]
def up
rename_column :topics, :sticky, :pinned
diff --git a/db/migrate/20121116212424_add_more_email_settings_to_user.rb b/db/migrate/20121116212424_add_more_email_settings_to_user.rb
index 6d6e7282d17..991c39edaa7 100644
--- a/db/migrate/20121116212424_add_more_email_settings_to_user.rb
+++ b/db/migrate/20121116212424_add_more_email_settings_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMoreEmailSettingsToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :email_private_messages, :boolean, default: true
diff --git a/db/migrate/20121119190529_add_email_settings_to_users.rb b/db/migrate/20121119190529_add_email_settings_to_users.rb
index 8eea445eb03..ef1d8255f15 100644
--- a/db/migrate/20121119190529_add_email_settings_to_users.rb
+++ b/db/migrate/20121119190529_add_email_settings_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddEmailSettingsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :email_replied, :boolean, default: true
diff --git a/db/migrate/20121119200843_add_email_direct_to_users.rb b/db/migrate/20121119200843_add_email_direct_to_users.rb
index c3e9cc97012..7a0a822438d 100644
--- a/db/migrate/20121119200843_add_email_direct_to_users.rb
+++ b/db/migrate/20121119200843_add_email_direct_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddEmailDirectToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :email_direct, :boolean, default: true, null: false
diff --git a/db/migrate/20121121202035_create_invites.rb b/db/migrate/20121121202035_create_invites.rb
index 3da6834354f..46096435ab4 100644
--- a/db/migrate/20121121202035_create_invites.rb
+++ b/db/migrate/20121121202035_create_invites.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateInvites < ActiveRecord::Migration[4.2]
def change
create_table :invites do |t|
diff --git a/db/migrate/20121121205215_create_topic_invites.rb b/db/migrate/20121121205215_create_topic_invites.rb
index 30071dc1268..5ff307a5af3 100644
--- a/db/migrate/20121121205215_create_topic_invites.rb
+++ b/db/migrate/20121121205215_create_topic_invites.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateTopicInvites < ActiveRecord::Migration[4.2]
def change
create_table :topic_invites do |t|
diff --git a/db/migrate/20121122033316_add_muted_at_to_topic_user.rb b/db/migrate/20121122033316_add_muted_at_to_topic_user.rb
index 3b8119fffbd..6fb88c85ee4 100644
--- a/db/migrate/20121122033316_add_muted_at_to_topic_user.rb
+++ b/db/migrate/20121122033316_add_muted_at_to_topic_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMutedAtToTopicUser < ActiveRecord::Migration[4.2]
def change
add_column :topic_users, :muted_at, :datetime
diff --git a/db/migrate/20121123054127_make_post_number_distinct.rb b/db/migrate/20121123054127_make_post_number_distinct.rb
index 259cdbb9156..0270daec474 100644
--- a/db/migrate/20121123054127_make_post_number_distinct.rb
+++ b/db/migrate/20121123054127_make_post_number_distinct.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MakePostNumberDistinct < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20121123063630_create_user_visits.rb b/db/migrate/20121123063630_create_user_visits.rb
index 6a130d16822..994ea22d525 100644
--- a/db/migrate/20121123063630_create_user_visits.rb
+++ b/db/migrate/20121123063630_create_user_visits.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUserVisits < ActiveRecord::Migration[4.2]
def change
create_table :user_visits do |t|
diff --git a/db/migrate/20121129160035_create_email_tokens.rb b/db/migrate/20121129160035_create_email_tokens.rb
index e4011c7a328..0c74808427a 100644
--- a/db/migrate/20121129160035_create_email_tokens.rb
+++ b/db/migrate/20121129160035_create_email_tokens.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateEmailTokens < ActiveRecord::Migration[4.2]
def change
create_table :email_tokens do |t|
diff --git a/db/migrate/20121129184948_remove_email_token_from_users.rb b/db/migrate/20121129184948_remove_email_token_from_users.rb
index 4cace300c95..5146dd922b1 100644
--- a/db/migrate/20121129184948_remove_email_token_from_users.rb
+++ b/db/migrate/20121129184948_remove_email_token_from_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveEmailTokenFromUsers < ActiveRecord::Migration[4.2]
def up
execute "INSERT INTO email_tokens (user_id, email, token, created_at, updated_at)
diff --git a/db/migrate/20121130010400_create_drafts.rb b/db/migrate/20121130010400_create_drafts.rb
index 1be48658a7c..6d5bfe17235 100644
--- a/db/migrate/20121130010400_create_drafts.rb
+++ b/db/migrate/20121130010400_create_drafts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateDrafts < ActiveRecord::Migration[4.2]
def change
create_table :drafts do |t|
diff --git a/db/migrate/20121130191818_add_link_post_id_to_topic_links.rb b/db/migrate/20121130191818_add_link_post_id_to_topic_links.rb
index d6b1ccf27c0..5bfa6c1fa7a 100644
--- a/db/migrate/20121130191818_add_link_post_id_to_topic_links.rb
+++ b/db/migrate/20121130191818_add_link_post_id_to_topic_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLinkPostIdToTopicLinks < ActiveRecord::Migration[4.2]
def change
add_column :topic_links, :link_post_id, :integer
diff --git a/db/migrate/20121202225421_add_visited_at_to_topic_user.rb b/db/migrate/20121202225421_add_visited_at_to_topic_user.rb
index ea27d4a3103..bef20cc454c 100644
--- a/db/migrate/20121202225421_add_visited_at_to_topic_user.rb
+++ b/db/migrate/20121202225421_add_visited_at_to_topic_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddVisitedAtToTopicUser < ActiveRecord::Migration[4.2]
def change
add_column :topic_users, :last_visited_at, :datetime
diff --git a/db/migrate/20121203181719_rename_seen_notificaiton_id.rb b/db/migrate/20121203181719_rename_seen_notificaiton_id.rb
index 9f6996aa7b5..9e30eb294d6 100644
--- a/db/migrate/20121203181719_rename_seen_notificaiton_id.rb
+++ b/db/migrate/20121203181719_rename_seen_notificaiton_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameSeenNotificaitonId < ActiveRecord::Migration[4.2]
def up
rename_column :users, :seen_notificaiton_id, :seen_notification_id
diff --git a/db/migrate/20121204183855_fix_link_post_id.rb b/db/migrate/20121204183855_fix_link_post_id.rb
index 47491880989..2fe158b6079 100644
--- a/db/migrate/20121204183855_fix_link_post_id.rb
+++ b/db/migrate/20121204183855_fix_link_post_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixLinkPostId < ActiveRecord::Migration[4.2]
def up
to_remove = []
diff --git a/db/migrate/20121204193747_add_another_featured_user_to_topics.rb b/db/migrate/20121204193747_add_another_featured_user_to_topics.rb
index bda56c09c1f..891a020fd69 100644
--- a/db/migrate/20121204193747_add_another_featured_user_to_topics.rb
+++ b/db/migrate/20121204193747_add_another_featured_user_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAnotherFeaturedUserToTopics < ActiveRecord::Migration[4.2]
def change
add_column :topics, :featured_user4_id, :integer, null: true
diff --git a/db/migrate/20121205162143_add_approved_to_users.rb b/db/migrate/20121205162143_add_approved_to_users.rb
index 8202b725fa9..a1c739d2cff 100644
--- a/db/migrate/20121205162143_add_approved_to_users.rb
+++ b/db/migrate/20121205162143_add_approved_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddApprovedToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :approved, :boolean, null: false, default: false
diff --git a/db/migrate/20121207000741_add_notifications_to_topic_users.rb b/db/migrate/20121207000741_add_notifications_to_topic_users.rb
index ae31470d985..d21c5b037ee 100644
--- a/db/migrate/20121207000741_add_notifications_to_topic_users.rb
+++ b/db/migrate/20121207000741_add_notifications_to_topic_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNotificationsToTopicUsers < ActiveRecord::Migration[4.2]
def change
add_column :topic_users, :notifications, :integer, default: 2
diff --git a/db/migrate/20121211233131_create_site_customizations.rb b/db/migrate/20121211233131_create_site_customizations.rb
index 206f041c600..10f2547bab9 100644
--- a/db/migrate/20121211233131_create_site_customizations.rb
+++ b/db/migrate/20121211233131_create_site_customizations.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateSiteCustomizations < ActiveRecord::Migration[4.2]
def change
create_table :site_customizations do |t|
diff --git a/db/migrate/20121216230719_add_override_default_style_to_site_customization.rb b/db/migrate/20121216230719_add_override_default_style_to_site_customization.rb
index f4b21257a91..4bab4d6e007 100644
--- a/db/migrate/20121216230719_add_override_default_style_to_site_customization.rb
+++ b/db/migrate/20121216230719_add_override_default_style_to_site_customization.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddOverrideDefaultStyleToSiteCustomization < ActiveRecord::Migration[4.2]
def change
add_column :site_customizations, :override_default_style, :boolean, default: false, null: false
diff --git a/db/migrate/20121218205642_add_topics_entered_to_users.rb b/db/migrate/20121218205642_add_topics_entered_to_users.rb
index 464ffabf62e..6f1128985a3 100644
--- a/db/migrate/20121218205642_add_topics_entered_to_users.rb
+++ b/db/migrate/20121218205642_add_topics_entered_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTopicsEnteredToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :topics_entered, :integer, default: 0, null: false
diff --git a/db/migrate/20121224072204_add_last_editor_id_to_posts.rb b/db/migrate/20121224072204_add_last_editor_id_to_posts.rb
index 9651bae6789..4c31afb9f58 100644
--- a/db/migrate/20121224072204_add_last_editor_id_to_posts.rb
+++ b/db/migrate/20121224072204_add_last_editor_id_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastEditorIdToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :last_editor_id, :integer
diff --git a/db/migrate/20121224095139_create_draft_sequence.rb b/db/migrate/20121224095139_create_draft_sequence.rb
index 239a7a3851c..fbd32d4a842 100644
--- a/db/migrate/20121224095139_create_draft_sequence.rb
+++ b/db/migrate/20121224095139_create_draft_sequence.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateDraftSequence < ActiveRecord::Migration[4.2]
def change
create_table :draft_sequences do |t|
diff --git a/db/migrate/20121224100650_add_sequence_to_drafts.rb b/db/migrate/20121224100650_add_sequence_to_drafts.rb
index 555174f2618..5da9c6c8267 100644
--- a/db/migrate/20121224100650_add_sequence_to_drafts.rb
+++ b/db/migrate/20121224100650_add_sequence_to_drafts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSequenceToDrafts < ActiveRecord::Migration[4.2]
def change
add_column :drafts, :sequence, :integer, null: false, default: 0
diff --git a/db/migrate/20121228192219_add_deleted_at_to_invites.rb b/db/migrate/20121228192219_add_deleted_at_to_invites.rb
index 46ba45daf99..394348b5184 100644
--- a/db/migrate/20121228192219_add_deleted_at_to_invites.rb
+++ b/db/migrate/20121228192219_add_deleted_at_to_invites.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDeletedAtToInvites < ActiveRecord::Migration[4.2]
def change
add_column :invites, :deleted_at, :datetime
diff --git a/db/migrate/20130107165207_add_digest_after_days_to_users.rb b/db/migrate/20130107165207_add_digest_after_days_to_users.rb
index fa4e01b6a6c..d506ebc4217 100644
--- a/db/migrate/20130107165207_add_digest_after_days_to_users.rb
+++ b/db/migrate/20130107165207_add_digest_after_days_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDigestAfterDaysToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :digest_after_days, :integer, default: 7, null: false
diff --git a/db/migrate/20130108195847_add_previous_visit_at_to_users.rb b/db/migrate/20130108195847_add_previous_visit_at_to_users.rb
index b8cd19ba34b..b9dcaad37e6 100644
--- a/db/migrate/20130108195847_add_previous_visit_at_to_users.rb
+++ b/db/migrate/20130108195847_add_previous_visit_at_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPreviousVisitAtToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :previous_visit_at, :timestamp
diff --git a/db/migrate/20130115012140_merge_mute_options_on_topic_users.rb b/db/migrate/20130115012140_merge_mute_options_on_topic_users.rb
index 0fc471fcfe7..4c0235dafcc 100644
--- a/db/migrate/20130115012140_merge_mute_options_on_topic_users.rb
+++ b/db/migrate/20130115012140_merge_mute_options_on_topic_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergeMuteOptionsOnTopicUsers < ActiveRecord::Migration[4.2]
def change
execute "update topic_users set notifications = 0 where notifications = 3"
diff --git a/db/migrate/20130115021937_correct_default_on_notification_level.rb b/db/migrate/20130115021937_correct_default_on_notification_level.rb
index dda56432a9e..f1d7b7f2f23 100644
--- a/db/migrate/20130115021937_correct_default_on_notification_level.rb
+++ b/db/migrate/20130115021937_correct_default_on_notification_level.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CorrectDefaultOnNotificationLevel < ActiveRecord::Migration[4.2]
def change
change_column :topic_users, :notification_level, :integer, default: 1, null: false
diff --git a/db/migrate/20130115043603_oops_unwatch_a_boat_of_watched_stuff.rb b/db/migrate/20130115043603_oops_unwatch_a_boat_of_watched_stuff.rb
index ebf1f48b13c..d793092f440 100644
--- a/db/migrate/20130115043603_oops_unwatch_a_boat_of_watched_stuff.rb
+++ b/db/migrate/20130115043603_oops_unwatch_a_boat_of_watched_stuff.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class OopsUnwatchABoatOfWatchedStuff < ActiveRecord::Migration[4.2]
def change
execute 'update topic_users set notification_level = 1 where notifications_reason_id is null and notification_level = 2'
diff --git a/db/migrate/20130116151829_remove_sub_tag_from_topics.rb b/db/migrate/20130116151829_remove_sub_tag_from_topics.rb
index 1c6e189b14b..ef3c330f1e9 100644
--- a/db/migrate/20130116151829_remove_sub_tag_from_topics.rb
+++ b/db/migrate/20130116151829_remove_sub_tag_from_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveSubTagFromTopics < ActiveRecord::Migration[4.2]
def up
remove_column :topics, :sub_tag
diff --git a/db/migrate/20130120222728_fix_search.rb b/db/migrate/20130120222728_fix_search.rb
index 4d5dfcd4f18..48e775fb7ea 100644
--- a/db/migrate/20130120222728_fix_search.rb
+++ b/db/migrate/20130120222728_fix_search.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixSearch < ActiveRecord::Migration[4.2]
def up
execute 'drop index idx_search_thread'
diff --git a/db/migrate/20130121231352_add_tracking_to_topic_users.rb b/db/migrate/20130121231352_add_tracking_to_topic_users.rb
index b0882cde820..78173e3b6bb 100644
--- a/db/migrate/20130121231352_add_tracking_to_topic_users.rb
+++ b/db/migrate/20130121231352_add_tracking_to_topic_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTrackingToTopicUsers < ActiveRecord::Migration[4.2]
def up
execute 'update topic_users set notification_level = 3 where notification_level = 2'
diff --git a/db/migrate/20130122051134_add_auto_track_topics_to_user.rb b/db/migrate/20130122051134_add_auto_track_topics_to_user.rb
index 9339f7e25f6..9cabd9c426c 100644
--- a/db/migrate/20130122051134_add_auto_track_topics_to_user.rb
+++ b/db/migrate/20130122051134_add_auto_track_topics_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAutoTrackTopicsToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :auto_track_topics, :boolean, null: false, default: false
diff --git a/db/migrate/20130122232825_add_auto_track_after_seconds_and_banning_and_dob_to_user.rb b/db/migrate/20130122232825_add_auto_track_after_seconds_and_banning_and_dob_to_user.rb
index f654cb6fec0..10bc0fe2098 100644
--- a/db/migrate/20130122232825_add_auto_track_after_seconds_and_banning_and_dob_to_user.rb
+++ b/db/migrate/20130122232825_add_auto_track_after_seconds_and_banning_and_dob_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAutoTrackAfterSecondsAndBanningAndDobToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :banned_at, :datetime
diff --git a/db/migrate/20130123070909_auto_track_all_topics_replied_to.rb b/db/migrate/20130123070909_auto_track_all_topics_replied_to.rb
index 334566680c8..35ff0e57e14 100644
--- a/db/migrate/20130123070909_auto_track_all_topics_replied_to.rb
+++ b/db/migrate/20130123070909_auto_track_all_topics_replied_to.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AutoTrackAllTopicsRepliedTo < ActiveRecord::Migration[4.2]
def up
execute 'update topic_users set notification_level = 2, notifications_reason_id = 4
diff --git a/db/migrate/20130125002652_add_hidden_to_posts.rb b/db/migrate/20130125002652_add_hidden_to_posts.rb
index b98ee5aefde..fd1016a55e1 100644
--- a/db/migrate/20130125002652_add_hidden_to_posts.rb
+++ b/db/migrate/20130125002652_add_hidden_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddHiddenToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :hidden, :boolean, null: false, default: false
diff --git a/db/migrate/20130125030305_add_fields_to_post_action.rb b/db/migrate/20130125030305_add_fields_to_post_action.rb
index 09fef75bdb1..af7bbf41c37 100644
--- a/db/migrate/20130125030305_add_fields_to_post_action.rb
+++ b/db/migrate/20130125030305_add_fields_to_post_action.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFieldsToPostAction < ActiveRecord::Migration[4.2]
def change
add_column :post_actions, :deleted_by, :integer
diff --git a/db/migrate/20130125031122_correct_index_on_post_action.rb b/db/migrate/20130125031122_correct_index_on_post_action.rb
index d16d54c1456..3f947d4b428 100644
--- a/db/migrate/20130125031122_correct_index_on_post_action.rb
+++ b/db/migrate/20130125031122_correct_index_on_post_action.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CorrectIndexOnPostAction < ActiveRecord::Migration[4.2]
def change
remove_index "post_actions", name: "idx_unique_actions"
diff --git a/db/migrate/20130127213646_remove_trust_levels.rb b/db/migrate/20130127213646_remove_trust_levels.rb
index 9ba29eafd5f..2154d2ac0a0 100644
--- a/db/migrate/20130127213646_remove_trust_levels.rb
+++ b/db/migrate/20130127213646_remove_trust_levels.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveTrustLevels < ActiveRecord::Migration[4.2]
def up
drop_table :trust_levels
diff --git a/db/migrate/20130128182013_trust_level_default_null.rb b/db/migrate/20130128182013_trust_level_default_null.rb
index d6409650eb5..f6f26b537d2 100644
--- a/db/migrate/20130128182013_trust_level_default_null.rb
+++ b/db/migrate/20130128182013_trust_level_default_null.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TrustLevelDefaultNull < ActiveRecord::Migration[4.2]
def up
change_column_default :users, :trust_level, nil
diff --git a/db/migrate/20130129010625_remove_pm_reflections.rb b/db/migrate/20130129010625_remove_pm_reflections.rb
index eb3f73e661a..9b35294e0b5 100644
--- a/db/migrate/20130129010625_remove_pm_reflections.rb
+++ b/db/migrate/20130129010625_remove_pm_reflections.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemovePmReflections < ActiveRecord::Migration[4.2]
def up
execute 'delete from topic_links where link_topic_id in (select id from topics where archetype = \'private_message\') '
diff --git a/db/migrate/20130129163244_add_time_read_to_users.rb b/db/migrate/20130129163244_add_time_read_to_users.rb
index 3b714744d75..f063f5e219f 100644
--- a/db/migrate/20130129163244_add_time_read_to_users.rb
+++ b/db/migrate/20130129163244_add_time_read_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTimeReadToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :time_read, :integer, default: 0, null: false
diff --git a/db/migrate/20130129174845_add_days_visited_to_users.rb b/db/migrate/20130129174845_add_days_visited_to_users.rb
index b5b5dc76c82..abdd6fd4a61 100644
--- a/db/migrate/20130129174845_add_days_visited_to_users.rb
+++ b/db/migrate/20130129174845_add_days_visited_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDaysVisitedToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :days_visited, :integer, null: false, default: 0
diff --git a/db/migrate/20130130154611_remove_index_from_views.rb b/db/migrate/20130130154611_remove_index_from_views.rb
index 449dbef48c4..4af6cede796 100644
--- a/db/migrate/20130130154611_remove_index_from_views.rb
+++ b/db/migrate/20130130154611_remove_index_from_views.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveIndexFromViews < ActiveRecord::Migration[4.2]
def up
remove_index "views", name: "unique_views"
diff --git a/db/migrate/20130131055710_add_custom_flag_count_to_topics.rb b/db/migrate/20130131055710_add_custom_flag_count_to_topics.rb
index d99df1d52dd..47d6c37d064 100644
--- a/db/migrate/20130131055710_add_custom_flag_count_to_topics.rb
+++ b/db/migrate/20130131055710_add_custom_flag_count_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCustomFlagCountToTopics < ActiveRecord::Migration[4.2]
def change
add_column :topics, :custom_flag_count, :integer, null: false, default: 0
diff --git a/db/migrate/20130201000828_add_column_summaries_to_posts_and_topics.rb b/db/migrate/20130201000828_add_column_summaries_to_posts_and_topics.rb
index 0a085816056..c180e1b74ea 100644
--- a/db/migrate/20130201000828_add_column_summaries_to_posts_and_topics.rb
+++ b/db/migrate/20130201000828_add_column_summaries_to_posts_and_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddColumnSummariesToPostsAndTopics < ActiveRecord::Migration[4.2]
def change
add_column :posts, :spam_count, :integer, default: 0, null: false
diff --git a/db/migrate/20130201023409_add_position_to_post_action_type.rb b/db/migrate/20130201023409_add_position_to_post_action_type.rb
index bc9c974f837..3613b9dbf55 100644
--- a/db/migrate/20130201023409_add_position_to_post_action_type.rb
+++ b/db/migrate/20130201023409_add_position_to_post_action_type.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPositionToPostActionType < ActiveRecord::Migration[4.2]
def change
add_column :post_action_types, :position, :integer, default: 0, null: false
diff --git a/db/migrate/20130203204338_add_last_version_at_to_posts.rb b/db/migrate/20130203204338_add_last_version_at_to_posts.rb
index 44eef360dd2..6c093a05fd8 100644
--- a/db/migrate/20130203204338_add_last_version_at_to_posts.rb
+++ b/db/migrate/20130203204338_add_last_version_at_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastVersionAtToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :last_version_at, :timestamp
diff --git a/db/migrate/20130204000159_add_ip_address_to_users.rb b/db/migrate/20130204000159_add_ip_address_to_users.rb
index 6c5910ec91b..6ac3e4b9299 100644
--- a/db/migrate/20130204000159_add_ip_address_to_users.rb
+++ b/db/migrate/20130204000159_add_ip_address_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIpAddressToUsers < ActiveRecord::Migration[4.2]
def up
execute 'alter table users add column ip_address inet'
diff --git a/db/migrate/20130205021905_alter_facebook_user_id.rb b/db/migrate/20130205021905_alter_facebook_user_id.rb
index 56011785dc4..bfba3eb4b01 100644
--- a/db/migrate/20130205021905_alter_facebook_user_id.rb
+++ b/db/migrate/20130205021905_alter_facebook_user_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AlterFacebookUserId < ActiveRecord::Migration[4.2]
def up
change_column :facebook_user_infos, :facebook_user_id, :integer, limit: 8, null: false
diff --git a/db/migrate/20130207200019_add_user_deleted_to_posts.rb b/db/migrate/20130207200019_add_user_deleted_to_posts.rb
index ed6274c82c4..1527dc0ec84 100644
--- a/db/migrate/20130207200019_add_user_deleted_to_posts.rb
+++ b/db/migrate/20130207200019_add_user_deleted_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserDeletedToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :user_deleted, :boolean, null: false, default: false
diff --git a/db/migrate/20130208220635_remove_reply_below_post_number_from_posts.rb b/db/migrate/20130208220635_remove_reply_below_post_number_from_posts.rb
index 3e58b83fffc..0c3363fc7e0 100644
--- a/db/migrate/20130208220635_remove_reply_below_post_number_from_posts.rb
+++ b/db/migrate/20130208220635_remove_reply_below_post_number_from_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveReplyBelowPostNumberFromPosts < ActiveRecord::Migration[4.2]
def change
remove_column :posts, :reply_below_post_number
diff --git a/db/migrate/20130213021450_remove_topic_response_actions.rb b/db/migrate/20130213021450_remove_topic_response_actions.rb
index 076f3f557d2..2709734c8ec 100644
--- a/db/migrate/20130213021450_remove_topic_response_actions.rb
+++ b/db/migrate/20130213021450_remove_topic_response_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveTopicResponseActions < ActiveRecord::Migration[4.2]
def up
# 2 notes:
diff --git a/db/migrate/20130213203300_add_new_topic_duration_minutes_to_users.rb b/db/migrate/20130213203300_add_new_topic_duration_minutes_to_users.rb
index 8d5516f1e25..cf7257b1a43 100644
--- a/db/migrate/20130213203300_add_new_topic_duration_minutes_to_users.rb
+++ b/db/migrate/20130213203300_add_new_topic_duration_minutes_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNewTopicDurationMinutesToUsers < ActiveRecord::Migration[4.2]
def change
# note, no constants allowed here, -1 means since last visit
diff --git a/db/migrate/20130221215017_add_description_to_categories.rb b/db/migrate/20130221215017_add_description_to_categories.rb
index 24514a4720a..f7b3071e6c3 100644
--- a/db/migrate/20130221215017_add_description_to_categories.rb
+++ b/db/migrate/20130221215017_add_description_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDescriptionToCategories < ActiveRecord::Migration[4.2]
def up
add_column :categories, :description, :text, null: true
diff --git a/db/migrate/20130226015336_add_github_user_info.rb b/db/migrate/20130226015336_add_github_user_info.rb
index 775a763e963..edcfacea250 100644
--- a/db/migrate/20130226015336_add_github_user_info.rb
+++ b/db/migrate/20130226015336_add_github_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddGithubUserInfo < ActiveRecord::Migration[4.2]
def change
create_table :github_user_infos do |t|
diff --git a/db/migrate/20130306180148_add_cleared_pinned_to_topic_users.rb b/db/migrate/20130306180148_add_cleared_pinned_to_topic_users.rb
index 1182b90191f..3cca4422710 100644
--- a/db/migrate/20130306180148_add_cleared_pinned_to_topic_users.rb
+++ b/db/migrate/20130306180148_add_cleared_pinned_to_topic_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddClearedPinnedToTopicUsers < ActiveRecord::Migration[4.2]
def change
add_column :topic_users, :cleared_pinned_at, :datetime, null: true
diff --git a/db/migrate/20130311181327_remove_extra_spam_record.rb b/db/migrate/20130311181327_remove_extra_spam_record.rb
index ceee3c5d058..2191e3a3766 100644
--- a/db/migrate/20130311181327_remove_extra_spam_record.rb
+++ b/db/migrate/20130311181327_remove_extra_spam_record.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveExtraSpamRecord < ActiveRecord::Migration[4.2]
def up
execute "UPDATE post_actions SET post_action_type_id = 7 where post_action_type_id = 8"
diff --git a/db/migrate/20130313004922_add_external_links_in_new_tab_an_disable_quoting_to_user.rb b/db/migrate/20130313004922_add_external_links_in_new_tab_an_disable_quoting_to_user.rb
index 8c96e4cbbab..1a4c2a67c12 100644
--- a/db/migrate/20130313004922_add_external_links_in_new_tab_an_disable_quoting_to_user.rb
+++ b/db/migrate/20130313004922_add_external_links_in_new_tab_an_disable_quoting_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddExternalLinksInNewTabAnDisableQuotingToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :external_links_in_new_tab, :boolean, default: false, null: false
diff --git a/db/migrate/20130314093434_add_foreground_color_to_categories.rb b/db/migrate/20130314093434_add_foreground_color_to_categories.rb
index 9a149136ff4..1784d7785d9 100644
--- a/db/migrate/20130314093434_add_foreground_color_to_categories.rb
+++ b/db/migrate/20130314093434_add_foreground_color_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddForegroundColorToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :text_color, :string, limit: 6, null: false, default: 'FFFFFF'
diff --git a/db/migrate/20130315180637_enable_trigram_support.rb b/db/migrate/20130315180637_enable_trigram_support.rb
index 1b82f45aaec..89ecc9c691c 100644
--- a/db/migrate/20130315180637_enable_trigram_support.rb
+++ b/db/migrate/20130315180637_enable_trigram_support.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnableTrigramSupport < ActiveRecord::Migration[4.2]
def up
execute "CREATE EXTENSION IF NOT EXISTS pg_trgm"
diff --git a/db/migrate/20130319122248_add_reply_to_user_id_to_post.rb b/db/migrate/20130319122248_add_reply_to_user_id_to_post.rb
index 7da8abad4f6..62aec7d5317 100644
--- a/db/migrate/20130319122248_add_reply_to_user_id_to_post.rb
+++ b/db/migrate/20130319122248_add_reply_to_user_id_to_post.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReplyToUserIdToPost < ActiveRecord::Migration[4.2]
def up
# caching this column makes the topic page WAY faster
diff --git a/db/migrate/20130320012100_add_user_indexes_to_posts_and_topics.rb b/db/migrate/20130320012100_add_user_indexes_to_posts_and_topics.rb
index cdd421f34b2..88038bacb60 100644
--- a/db/migrate/20130320012100_add_user_indexes_to_posts_and_topics.rb
+++ b/db/migrate/20130320012100_add_user_indexes_to_posts_and_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserIndexesToPostsAndTopics < ActiveRecord::Migration[4.2]
def up
execute "CREATE INDEX idx_posts_user_id_deleted_at
diff --git a/db/migrate/20130320024345_add_moderator_to_user.rb b/db/migrate/20130320024345_add_moderator_to_user.rb
index e8943b7dcaf..c35b865ed15 100644
--- a/db/migrate/20130320024345_add_moderator_to_user.rb
+++ b/db/migrate/20130320024345_add_moderator_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddModeratorToUser < ActiveRecord::Migration[4.2]
def up
add_column :users, :moderator, :boolean, default: false
diff --git a/db/migrate/20130321154905_remove_oneboxes_from_db.rb b/db/migrate/20130321154905_remove_oneboxes_from_db.rb
index 75c25d064a7..e5a31a89ef1 100644
--- a/db/migrate/20130321154905_remove_oneboxes_from_db.rb
+++ b/db/migrate/20130321154905_remove_oneboxes_from_db.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveOneboxesFromDb < ActiveRecord::Migration[4.2]
def up
drop_table :post_onebox_renders
diff --git a/db/migrate/20130322183614_add_percent_rank_to_posts.rb b/db/migrate/20130322183614_add_percent_rank_to_posts.rb
index e3d54a70319..93e861cee57 100644
--- a/db/migrate/20130322183614_add_percent_rank_to_posts.rb
+++ b/db/migrate/20130322183614_add_percent_rank_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPercentRankToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :percent_rank, :float, default: 1.0
diff --git a/db/migrate/20130326210101_add_hotness_to_category.rb b/db/migrate/20130326210101_add_hotness_to_category.rb
index 3dca552afc8..ed099d93895 100644
--- a/db/migrate/20130326210101_add_hotness_to_category.rb
+++ b/db/migrate/20130326210101_add_hotness_to_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddHotnessToCategory < ActiveRecord::Migration[4.2]
def change
add_column :categories, :hotness, :float, default: 5.0, null: false
diff --git a/db/migrate/20130327185852_update_site_settings_for_hot.rb b/db/migrate/20130327185852_update_site_settings_for_hot.rb
index 46b3c06a573..9600bde63e9 100644
--- a/db/migrate/20130327185852_update_site_settings_for_hot.rb
+++ b/db/migrate/20130327185852_update_site_settings_for_hot.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UpdateSiteSettingsForHot < ActiveRecord::Migration[4.2]
def up
execute "UPDATE site_settings SET value = REPLACE(value, 'popular|', 'latest|hot|') where name = 'top_menu'"
diff --git a/db/migrate/20130328162943_create_hot_topics.rb b/db/migrate/20130328162943_create_hot_topics.rb
index 018c13fc721..e574da1aea8 100644
--- a/db/migrate/20130328162943_create_hot_topics.rb
+++ b/db/migrate/20130328162943_create_hot_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateHotTopics < ActiveRecord::Migration[4.2]
def change
create_table :hot_topics, force: true do |t|
diff --git a/db/migrate/20130328182433_add_score_to_topics.rb b/db/migrate/20130328182433_add_score_to_topics.rb
index 44fb14904dc..fdd56890a0e 100644
--- a/db/migrate/20130328182433_add_score_to_topics.rb
+++ b/db/migrate/20130328182433_add_score_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddScoreToTopics < ActiveRecord::Migration[4.2]
def change
add_column :topics, :score, :float
diff --git a/db/migrate/20130402210723_add_values_to_hot_topics.rb b/db/migrate/20130402210723_add_values_to_hot_topics.rb
index 989b91d77db..5f70d8cde60 100644
--- a/db/migrate/20130402210723_add_values_to_hot_topics.rb
+++ b/db/migrate/20130402210723_add_values_to_hot_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddValuesToHotTopics < ActiveRecord::Migration[4.2]
def change
add_column :hot_topics, :random_bias, :float
diff --git a/db/migrate/20130404143437_create_site_contents.rb b/db/migrate/20130404143437_create_site_contents.rb
index f35acd90216..cd854b04982 100644
--- a/db/migrate/20130404143437_create_site_contents.rb
+++ b/db/migrate/20130404143437_create_site_contents.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateSiteContents < ActiveRecord::Migration[4.2]
def change
create_table :site_contents, force: true, id: false do |t|
diff --git a/db/migrate/20130404232558_add_user_extras.rb b/db/migrate/20130404232558_add_user_extras.rb
index 2f2b5ec6c3f..8fc2c776af7 100644
--- a/db/migrate/20130404232558_add_user_extras.rb
+++ b/db/migrate/20130404232558_add_user_extras.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserExtras < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20130411205132_create_admin_logs.rb b/db/migrate/20130411205132_create_admin_logs.rb
index 0dc74ac8fd8..2be90129ad0 100644
--- a/db/migrate/20130411205132_create_admin_logs.rb
+++ b/db/migrate/20130411205132_create_admin_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateAdminLogs < ActiveRecord::Migration[4.2]
def up
create_table :admin_logs, force: true do |t|
diff --git a/db/migrate/20130412015502_correct_counts_on_posts.rb b/db/migrate/20130412015502_correct_counts_on_posts.rb
index abc798964a3..d4fe57e9dde 100644
--- a/db/migrate/20130412015502_correct_counts_on_posts.rb
+++ b/db/migrate/20130412015502_correct_counts_on_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CorrectCountsOnPosts < ActiveRecord::Migration[4.2]
def change
rename_column :posts, :custom_flag_count, :notify_moderators_count
diff --git a/db/migrate/20130412020156_correct_counts_on_topics.rb b/db/migrate/20130412020156_correct_counts_on_topics.rb
index 67ac99527e6..487c5488c34 100644
--- a/db/migrate/20130412020156_correct_counts_on_topics.rb
+++ b/db/migrate/20130412020156_correct_counts_on_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CorrectCountsOnTopics < ActiveRecord::Migration[4.2]
def change
rename_column :topics, :custom_flag_count, :notify_moderators_count
diff --git a/db/migrate/20130416004607_create_groups.rb b/db/migrate/20130416004607_create_groups.rb
index 5fb442d00ab..e11cda60ad8 100644
--- a/db/migrate/20130416004607_create_groups.rb
+++ b/db/migrate/20130416004607_create_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateGroups < ActiveRecord::Migration[4.2]
def change
create_table :groups, force: true do |t|
diff --git a/db/migrate/20130416004933_group_users.rb b/db/migrate/20130416004933_group_users.rb
index 238ddd19519..fb405a4f3aa 100644
--- a/db/migrate/20130416004933_group_users.rb
+++ b/db/migrate/20130416004933_group_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupUsers < ActiveRecord::Migration[4.2]
def change
create_table :group_users, force: true do |t|
diff --git a/db/migrate/20130416170855_add_subtype_to_topics.rb b/db/migrate/20130416170855_add_subtype_to_topics.rb
index a148cf76b3b..410b31a0703 100644
--- a/db/migrate/20130416170855_add_subtype_to_topics.rb
+++ b/db/migrate/20130416170855_add_subtype_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSubtypeToTopics < ActiveRecord::Migration[4.2]
def up
add_column :topics, :subtype, :string
diff --git a/db/migrate/20130419195746_increase_data_length_on_notifications.rb b/db/migrate/20130419195746_increase_data_length_on_notifications.rb
index ac3234fe0cd..246b1cbe388 100644
--- a/db/migrate/20130419195746_increase_data_length_on_notifications.rb
+++ b/db/migrate/20130419195746_increase_data_length_on_notifications.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncreaseDataLengthOnNotifications < ActiveRecord::Migration[4.2]
def up
execute "ALTER TABLE notifications ALTER COLUMN data TYPE VARCHAR(1000)"
diff --git a/db/migrate/20130422050626_add_related_post_id_to_post_actions.rb b/db/migrate/20130422050626_add_related_post_id_to_post_actions.rb
index 23a89836d57..cc0d498b29e 100644
--- a/db/migrate/20130422050626_add_related_post_id_to_post_actions.rb
+++ b/db/migrate/20130422050626_add_related_post_id_to_post_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddRelatedPostIdToPostActions < ActiveRecord::Migration[4.2]
def change
add_column :post_actions, :related_post_id, :integer
diff --git a/db/migrate/20130424015746_add_slug_to_topics.rb b/db/migrate/20130424015746_add_slug_to_topics.rb
index cd3458e590e..4e380248dd6 100644
--- a/db/migrate/20130424015746_add_slug_to_topics.rb
+++ b/db/migrate/20130424015746_add_slug_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSlugToTopics < ActiveRecord::Migration[4.2]
def change
add_column :topics, :slug, :string
diff --git a/db/migrate/20130424055025_add_user_id_to_incoming_links.rb b/db/migrate/20130424055025_add_user_id_to_incoming_links.rb
index 36a428c87dd..fb0a0c95b36 100644
--- a/db/migrate/20130424055025_add_user_id_to_incoming_links.rb
+++ b/db/migrate/20130424055025_add_user_id_to_incoming_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserIdToIncomingLinks < ActiveRecord::Migration[4.2]
def change
add_column :incoming_links, :user_id, :integer
diff --git a/db/migrate/20130426044914_allow_nulls_in_incoming_links.rb b/db/migrate/20130426044914_allow_nulls_in_incoming_links.rb
index 92827f5cd18..2c6e84cd179 100644
--- a/db/migrate/20130426044914_allow_nulls_in_incoming_links.rb
+++ b/db/migrate/20130426044914_allow_nulls_in_incoming_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AllowNullsInIncomingLinks < ActiveRecord::Migration[4.2]
def change
change_column :incoming_links, :referer, :string, limit: 1000, null: true
diff --git a/db/migrate/20130426052257_add_incoming_ip_current_user_id_to_incoming_links.rb b/db/migrate/20130426052257_add_incoming_ip_current_user_id_to_incoming_links.rb
index b89f599dbf9..ae1eb07f82a 100644
--- a/db/migrate/20130426052257_add_incoming_ip_current_user_id_to_incoming_links.rb
+++ b/db/migrate/20130426052257_add_incoming_ip_current_user_id_to_incoming_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIncomingIpCurrentUserIdToIncomingLinks < ActiveRecord::Migration[4.2]
def change
add_column :incoming_links, :ip_address, :inet
diff --git a/db/migrate/20130428194335_add_unstarred_at_to_topic_users.rb b/db/migrate/20130428194335_add_unstarred_at_to_topic_users.rb
index 279ff2fd6ac..12c42e3b245 100644
--- a/db/migrate/20130428194335_add_unstarred_at_to_topic_users.rb
+++ b/db/migrate/20130428194335_add_unstarred_at_to_topic_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUnstarredAtToTopicUsers < ActiveRecord::Migration[4.2]
def change
add_column :topic_users, :unstarred_at, :datetime
diff --git a/db/migrate/20130429000101_add_security_to_categories.rb b/db/migrate/20130429000101_add_security_to_categories.rb
index dc6bbef6684..82ecc90ed3b 100644
--- a/db/migrate/20130429000101_add_security_to_categories.rb
+++ b/db/migrate/20130429000101_add_security_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSecurityToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :secure, :boolean, default: false, null: false
diff --git a/db/migrate/20130430052751_add_topic_allowed_groups.rb b/db/migrate/20130430052751_add_topic_allowed_groups.rb
index a83f8645711..27eb25054ea 100644
--- a/db/migrate/20130430052751_add_topic_allowed_groups.rb
+++ b/db/migrate/20130430052751_add_topic_allowed_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTopicAllowedGroups < ActiveRecord::Migration[4.2]
def change
create_table :topic_allowed_groups, force: true do |t|
diff --git a/db/migrate/20130501105651_fix_topic_allowed_groups.rb b/db/migrate/20130501105651_fix_topic_allowed_groups.rb
index 02e3ec3afc5..cc0f49fbf00 100644
--- a/db/migrate/20130501105651_fix_topic_allowed_groups.rb
+++ b/db/migrate/20130501105651_fix_topic_allowed_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixTopicAllowedGroups < ActiveRecord::Migration[4.2]
def change
# big oops
diff --git a/db/migrate/20130506020935_add_automatic_to_groups.rb b/db/migrate/20130506020935_add_automatic_to_groups.rb
index e04bac57aaa..8d5169e1e65 100644
--- a/db/migrate/20130506020935_add_automatic_to_groups.rb
+++ b/db/migrate/20130506020935_add_automatic_to_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAutomaticToGroups < ActiveRecord::Migration[4.2]
def up
add_column :groups, :automatic, :boolean, default: false, null: false
diff --git a/db/migrate/20130506185042_add_auto_close_at_to_topics.rb b/db/migrate/20130506185042_add_auto_close_at_to_topics.rb
index 297608e8e7e..fe7322baec1 100644
--- a/db/migrate/20130506185042_add_auto_close_at_to_topics.rb
+++ b/db/migrate/20130506185042_add_auto_close_at_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAutoCloseAtToTopics < ActiveRecord::Migration[4.2]
def change
add_column :topics, :auto_close_at, :datetime
diff --git a/db/migrate/20130508040235_add_user_count_to_groups.rb b/db/migrate/20130508040235_add_user_count_to_groups.rb
index 7ab95b79bc7..66a662539f5 100644
--- a/db/migrate/20130508040235_add_user_count_to_groups.rb
+++ b/db/migrate/20130508040235_add_user_count_to_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserCountToGroups < ActiveRecord::Migration[4.2]
def change
add_column :groups, :user_count, :integer, null: false, default: 0
diff --git a/db/migrate/20130509040248_update_sequence_for_groups.rb b/db/migrate/20130509040248_update_sequence_for_groups.rb
index 7bf85eea4c7..8e1d3c606bc 100644
--- a/db/migrate/20130509040248_update_sequence_for_groups.rb
+++ b/db/migrate/20130509040248_update_sequence_for_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UpdateSequenceForGroups < ActiveRecord::Migration[4.2]
def up
# even if you alter a sequence you still need to set the seq
diff --git a/db/migrate/20130509041351_add_unique_name_to_groups.rb b/db/migrate/20130509041351_add_unique_name_to_groups.rb
index 587739e59b9..c3b52483381 100644
--- a/db/migrate/20130509041351_add_unique_name_to_groups.rb
+++ b/db/migrate/20130509041351_add_unique_name_to_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUniqueNameToGroups < ActiveRecord::Migration[4.2]
def change
add_index :groups, [:name], unique: true
diff --git a/db/migrate/20130515193551_add_auto_close_days_to_categories.rb b/db/migrate/20130515193551_add_auto_close_days_to_categories.rb
index 1f3478ec4d4..fc9bf4a4817 100644
--- a/db/migrate/20130515193551_add_auto_close_days_to_categories.rb
+++ b/db/migrate/20130515193551_add_auto_close_days_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAutoCloseDaysToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :auto_close_days, :float
diff --git a/db/migrate/20130521210140_create_cas_user_infos.rb b/db/migrate/20130521210140_create_cas_user_infos.rb
index fdedd07ae5b..5b86b264478 100644
--- a/db/migrate/20130521210140_create_cas_user_infos.rb
+++ b/db/migrate/20130521210140_create_cas_user_infos.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateCasUserInfos < ActiveRecord::Migration[4.2]
def change
create_table :cas_user_infos do |t|
diff --git a/db/migrate/20130522193615_rename_search_tables.rb b/db/migrate/20130522193615_rename_search_tables.rb
index 26a3991c8cb..f098bd1c4b6 100644
--- a/db/migrate/20130522193615_rename_search_tables.rb
+++ b/db/migrate/20130522193615_rename_search_tables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameSearchTables < ActiveRecord::Migration[4.2]
def up
rename_table :users_search, :user_search_data
diff --git a/db/migrate/20130527152648_add_like_score_to_posts.rb b/db/migrate/20130527152648_add_like_score_to_posts.rb
index c3a4f26c53c..7d3a258e8c6 100644
--- a/db/migrate/20130527152648_add_like_score_to_posts.rb
+++ b/db/migrate/20130527152648_add_like_score_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLikeScoreToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :like_score, :integer, default: 0, null: false
diff --git a/db/migrate/20130528174147_add_rank_to_category_featured_topics.rb b/db/migrate/20130528174147_add_rank_to_category_featured_topics.rb
index bfb29035ce7..a1dacf74ef0 100644
--- a/db/migrate/20130528174147_add_rank_to_category_featured_topics.rb
+++ b/db/migrate/20130528174147_add_rank_to_category_featured_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddRankToCategoryFeaturedTopics < ActiveRecord::Migration[4.2]
def change
add_column :category_featured_topics, :rank, :integer, default: 0, null: false
diff --git a/db/migrate/20130531210816_add_staff_took_action_to_post_actions.rb b/db/migrate/20130531210816_add_staff_took_action_to_post_actions.rb
index bb522ddf716..4497c56bfe5 100644
--- a/db/migrate/20130531210816_add_staff_took_action_to_post_actions.rb
+++ b/db/migrate/20130531210816_add_staff_took_action_to_post_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddStaffTookActionToPostActions < ActiveRecord::Migration[4.2]
def change
add_column :post_actions, :staff_took_action, :boolean, default: false, null: false
diff --git a/db/migrate/20130603192412_add_blocked_to_users.rb b/db/migrate/20130603192412_add_blocked_to_users.rb
index e80eb8c4252..d5e92685e34 100644
--- a/db/migrate/20130603192412_add_blocked_to_users.rb
+++ b/db/migrate/20130603192412_add_blocked_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddBlockedToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :blocked, :boolean, default: false
diff --git a/db/migrate/20130606190601_add_auto_close_started_at_to_topics.rb b/db/migrate/20130606190601_add_auto_close_started_at_to_topics.rb
index 95016198e4b..0fc33cebc76 100644
--- a/db/migrate/20130606190601_add_auto_close_started_at_to_topics.rb
+++ b/db/migrate/20130606190601_add_auto_close_started_at_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAutoCloseStartedAtToTopics < ActiveRecord::Migration[4.2]
def change
add_column :topics, :auto_close_started_at, :datetime
diff --git a/db/migrate/20130610201033_add_reply_key_to_email_logs.rb b/db/migrate/20130610201033_add_reply_key_to_email_logs.rb
index 266a66c06de..8f3c38be934 100644
--- a/db/migrate/20130610201033_add_reply_key_to_email_logs.rb
+++ b/db/migrate/20130610201033_add_reply_key_to_email_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReplyKeyToEmailLogs < ActiveRecord::Migration[4.2]
def change
add_column :email_logs, :reply_key, :string, limit: 32
diff --git a/db/migrate/20130612200846_create_post_upload_join_table.rb b/db/migrate/20130612200846_create_post_upload_join_table.rb
index 809b104074c..dce05c426f7 100644
--- a/db/migrate/20130612200846_create_post_upload_join_table.rb
+++ b/db/migrate/20130612200846_create_post_upload_join_table.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostUploadJoinTable < ActiveRecord::Migration[4.2]
def change
create_table :posts_uploads, force: true, id: false do |t|
diff --git a/db/migrate/20130613211700_drop_posts_uploads.rb b/db/migrate/20130613211700_drop_posts_uploads.rb
index f04de8e8b24..3998c754564 100644
--- a/db/migrate/20130613211700_drop_posts_uploads.rb
+++ b/db/migrate/20130613211700_drop_posts_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DropPostsUploads < ActiveRecord::Migration[4.2]
def up
drop_table :posts_uploads
diff --git a/db/migrate/20130613212230_create_post_uploads.rb b/db/migrate/20130613212230_create_post_uploads.rb
index 1e2b6f5b8c9..088384b3bfe 100644
--- a/db/migrate/20130613212230_create_post_uploads.rb
+++ b/db/migrate/20130613212230_create_post_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostUploads < ActiveRecord::Migration[4.2]
def up
create_table :post_uploads do |t|
diff --git a/db/migrate/20130615064344_add_dynamic_favicon_preference_to_user.rb b/db/migrate/20130615064344_add_dynamic_favicon_preference_to_user.rb
index 42564fdd60e..5d868be51fd 100644
--- a/db/migrate/20130615064344_add_dynamic_favicon_preference_to_user.rb
+++ b/db/migrate/20130615064344_add_dynamic_favicon_preference_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDynamicFaviconPreferenceToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :dynamic_favicon, :boolean, default: false, null: false
diff --git a/db/migrate/20130615073305_remove_topic_id_from_uploads.rb b/db/migrate/20130615073305_remove_topic_id_from_uploads.rb
index 01fe10714c6..5f5c3b75d71 100644
--- a/db/migrate/20130615073305_remove_topic_id_from_uploads.rb
+++ b/db/migrate/20130615073305_remove_topic_id_from_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveTopicIdFromUploads < ActiveRecord::Migration[4.2]
def up
remove_column :uploads, :topic_id
diff --git a/db/migrate/20130615075557_add_sha_to_uploads.rb b/db/migrate/20130615075557_add_sha_to_uploads.rb
index f1a27225acb..ab49e00a123 100644
--- a/db/migrate/20130615075557_add_sha_to_uploads.rb
+++ b/db/migrate/20130615075557_add_sha_to_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddShaToUploads < ActiveRecord::Migration[4.2]
def change
add_column :uploads, :sha, :string, null: true
diff --git a/db/migrate/20130616082327_create_optimized_images.rb b/db/migrate/20130616082327_create_optimized_images.rb
index d8397c3aacd..ef8272a03d0 100644
--- a/db/migrate/20130616082327_create_optimized_images.rb
+++ b/db/migrate/20130616082327_create_optimized_images.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateOptimizedImages < ActiveRecord::Migration[4.2]
def up
create_table :optimized_images do |t|
diff --git a/db/migrate/20130617014127_rename_sha_and_ext_columns.rb b/db/migrate/20130617014127_rename_sha_and_ext_columns.rb
index 359462c96c5..cf9a9fb8567 100644
--- a/db/migrate/20130617014127_rename_sha_and_ext_columns.rb
+++ b/db/migrate/20130617014127_rename_sha_and_ext_columns.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameShaAndExtColumns < ActiveRecord::Migration[4.2]
def up
rename_column :optimized_images, :sha, :sha1
diff --git a/db/migrate/20130617180009_rename_sha_column.rb b/db/migrate/20130617180009_rename_sha_column.rb
index 4f50ec4cb63..ce3ca679323 100644
--- a/db/migrate/20130617180009_rename_sha_column.rb
+++ b/db/migrate/20130617180009_rename_sha_column.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameShaColumn < ActiveRecord::Migration[4.2]
def up
remove_index :uploads, :sha
diff --git a/db/migrate/20130617181804_add_post_id_to_email_logs.rb b/db/migrate/20130617181804_add_post_id_to_email_logs.rb
index f2c6f787e1e..86e5ed3aea3 100644
--- a/db/migrate/20130617181804_add_post_id_to_email_logs.rb
+++ b/db/migrate/20130617181804_add_post_id_to_email_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostIdToEmailLogs < ActiveRecord::Migration[4.2]
def change
add_column :email_logs, :post_id, :integer, null: true
diff --git a/db/migrate/20130619063902_add_defer_to_post_actions.rb b/db/migrate/20130619063902_add_defer_to_post_actions.rb
index 7c55d2c5c2f..3616b474208 100644
--- a/db/migrate/20130619063902_add_defer_to_post_actions.rb
+++ b/db/migrate/20130619063902_add_defer_to_post_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDeferToPostActions < ActiveRecord::Migration[4.2]
def change
# an action can be deferred by a moderator, used for flags
diff --git a/db/migrate/20130621042855_change_supress_to_suppress.rb b/db/migrate/20130621042855_change_supress_to_suppress.rb
index 6f6af2ac273..cc4dc12fe45 100644
--- a/db/migrate/20130621042855_change_supress_to_suppress.rb
+++ b/db/migrate/20130621042855_change_supress_to_suppress.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ChangeSupressToSuppress < ActiveRecord::Migration[4.2]
def up
SiteSetting.where(name: "suppress_reply_directly_below").update_all(name: "supress_reply_directly_below")
diff --git a/db/migrate/20130622110348_add_url_index_to_uploads.rb b/db/migrate/20130622110348_add_url_index_to_uploads.rb
index ec4e01767d1..0d6ee3e5ccc 100644
--- a/db/migrate/20130622110348_add_url_index_to_uploads.rb
+++ b/db/migrate/20130622110348_add_url_index_to_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUrlIndexToUploads < ActiveRecord::Migration[4.2]
def change
add_index :uploads, :url
diff --git a/db/migrate/20130624203206_change_ip_to_inet_in_topic_link_clicks.rb b/db/migrate/20130624203206_change_ip_to_inet_in_topic_link_clicks.rb
index 384cbe86318..40c6de2172f 100644
--- a/db/migrate/20130624203206_change_ip_to_inet_in_topic_link_clicks.rb
+++ b/db/migrate/20130624203206_change_ip_to_inet_in_topic_link_clicks.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'ipaddr'
class ChangeIpToInetInTopicLinkClicks < ActiveRecord::Migration[4.2]
diff --git a/db/migrate/20130625022454_change_ip_to_inet_in_views.rb b/db/migrate/20130625022454_change_ip_to_inet_in_views.rb
index 178a2aecedb..050f57ab8f8 100644
--- a/db/migrate/20130625022454_change_ip_to_inet_in_views.rb
+++ b/db/migrate/20130625022454_change_ip_to_inet_in_views.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'ipaddr'
class ChangeIpToInetInViews < ActiveRecord::Migration[4.2]
diff --git a/db/migrate/20130625170842_remove_access_password.rb b/db/migrate/20130625170842_remove_access_password.rb
index 10e6d49e302..40a8fab27b9 100644
--- a/db/migrate/20130625170842_remove_access_password.rb
+++ b/db/migrate/20130625170842_remove_access_password.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveAccessPassword < ActiveRecord::Migration[4.2]
def up
result = execute("SELECT count(*) FROM site_settings where name='access_password' and char_length(value) > 0")
diff --git a/db/migrate/20130625201113_add_title_to_users.rb b/db/migrate/20130625201113_add_title_to_users.rb
index cb63d4fa5b9..69050b36f72 100644
--- a/db/migrate/20130625201113_add_title_to_users.rb
+++ b/db/migrate/20130625201113_add_title_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTitleToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :title, :string
diff --git a/db/migrate/20130709184941_add_deleted_by_id_to_posts.rb b/db/migrate/20130709184941_add_deleted_by_id_to_posts.rb
index d322f05dd76..8e23906db9e 100644
--- a/db/migrate/20130709184941_add_deleted_by_id_to_posts.rb
+++ b/db/migrate/20130709184941_add_deleted_by_id_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDeletedByIdToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :deleted_by_id, :integer, null: true
diff --git a/db/migrate/20130710201248_add_nuked_user_to_posts.rb b/db/migrate/20130710201248_add_nuked_user_to_posts.rb
index 14e9aad0efd..c47d433b0dc 100644
--- a/db/migrate/20130710201248_add_nuked_user_to_posts.rb
+++ b/db/migrate/20130710201248_add_nuked_user_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNukedUserToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :nuked_user, :boolean, default: false
diff --git a/db/migrate/20130712041133_add_permission_type_to_category_groups.rb b/db/migrate/20130712041133_add_permission_type_to_category_groups.rb
index 4ddab5fe075..0a7159bd9b5 100644
--- a/db/migrate/20130712041133_add_permission_type_to_category_groups.rb
+++ b/db/migrate/20130712041133_add_permission_type_to_category_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPermissionTypeToCategoryGroups < ActiveRecord::Migration[4.2]
def change
# 1 is full permissions
diff --git a/db/migrate/20130712163509_add_missing_id_columns.rb b/db/migrate/20130712163509_add_missing_id_columns.rb
index a81cadc696e..e07ba606f08 100644
--- a/db/migrate/20130712163509_add_missing_id_columns.rb
+++ b/db/migrate/20130712163509_add_missing_id_columns.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMissingIdColumns < ActiveRecord::Migration[4.2]
def up
add_column :category_featured_topics, :id, :primary_key
diff --git a/db/migrate/20130723212758_rename_admin_log.rb b/db/migrate/20130723212758_rename_admin_log.rb
index e7f2e5471b2..987cb59ef17 100644
--- a/db/migrate/20130723212758_rename_admin_log.rb
+++ b/db/migrate/20130723212758_rename_admin_log.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameAdminLog < ActiveRecord::Migration[4.2]
def up
rename_table :admin_logs, :staff_action_logs
diff --git a/db/migrate/20130724201552_create_blocked_emails.rb b/db/migrate/20130724201552_create_blocked_emails.rb
index e3e7b35600e..b76ef8b3f08 100644
--- a/db/migrate/20130724201552_create_blocked_emails.rb
+++ b/db/migrate/20130724201552_create_blocked_emails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateBlockedEmails < ActiveRecord::Migration[4.2]
def change
create_table :blocked_emails do |t|
diff --git a/db/migrate/20130725213613_add_more_to_staff_action_log.rb b/db/migrate/20130725213613_add_more_to_staff_action_log.rb
index dbefeedcf7d..c8b411d28e4 100644
--- a/db/migrate/20130725213613_add_more_to_staff_action_log.rb
+++ b/db/migrate/20130725213613_add_more_to_staff_action_log.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMoreToStaffActionLog < ActiveRecord::Migration[4.2]
def change
add_column :staff_action_logs, :context, :string
diff --git a/db/migrate/20130728172550_add_url_to_optimized_images.rb b/db/migrate/20130728172550_add_url_to_optimized_images.rb
index cf881a2002d..caf9cb03579 100644
--- a/db/migrate/20130728172550_add_url_to_optimized_images.rb
+++ b/db/migrate/20130728172550_add_url_to_optimized_images.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUrlToOptimizedImages < ActiveRecord::Migration[4.2]
def up
# add a nullable url column
diff --git a/db/migrate/20130731163035_add_report_index_to_incoming_links.rb b/db/migrate/20130731163035_add_report_index_to_incoming_links.rb
index c470979e0fc..6f6e5711ef3 100644
--- a/db/migrate/20130731163035_add_report_index_to_incoming_links.rb
+++ b/db/migrate/20130731163035_add_report_index_to_incoming_links.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReportIndexToIncomingLinks < ActiveRecord::Migration[4.2]
def change
add_index :incoming_links, [:created_at, :user_id]
diff --git a/db/migrate/20130807202516_add_last_match_index_to_blocked_emails.rb b/db/migrate/20130807202516_add_last_match_index_to_blocked_emails.rb
index ad3828c7a22..75cf99d3a57 100644
--- a/db/migrate/20130807202516_add_last_match_index_to_blocked_emails.rb
+++ b/db/migrate/20130807202516_add_last_match_index_to_blocked_emails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastMatchIndexToBlockedEmails < ActiveRecord::Migration[4.2]
def change
add_index :blocked_emails, :last_match_at
diff --git a/db/migrate/20130809160751_fix_seen_notification_ids.rb b/db/migrate/20130809160751_fix_seen_notification_ids.rb
index fce5ae11658..b002ec486fb 100644
--- a/db/migrate/20130809160751_fix_seen_notification_ids.rb
+++ b/db/migrate/20130809160751_fix_seen_notification_ids.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixSeenNotificationIds < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20130809204732_add_filter_indexes_to_staff_action_logs.rb b/db/migrate/20130809204732_add_filter_indexes_to_staff_action_logs.rb
index db5a1b47d8c..2a559646bd9 100644
--- a/db/migrate/20130809204732_add_filter_indexes_to_staff_action_logs.rb
+++ b/db/migrate/20130809204732_add_filter_indexes_to_staff_action_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFilterIndexesToStaffActionLogs < ActiveRecord::Migration[4.2]
def change
add_index :staff_action_logs, [:action, :id]
diff --git a/db/migrate/20130809211409_add_avatar_to_users.rb b/db/migrate/20130809211409_add_avatar_to_users.rb
index c891fbdecc3..daa78528c55 100644
--- a/db/migrate/20130809211409_add_avatar_to_users.rb
+++ b/db/migrate/20130809211409_add_avatar_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAvatarToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :use_uploaded_avatar, :boolean, default: false
diff --git a/db/migrate/20130813204212_create_screened_urls.rb b/db/migrate/20130813204212_create_screened_urls.rb
index e9887141aad..b240feffbfb 100644
--- a/db/migrate/20130813204212_create_screened_urls.rb
+++ b/db/migrate/20130813204212_create_screened_urls.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateScreenedUrls < ActiveRecord::Migration[4.2]
def change
create_table :screened_urls do |t|
diff --git a/db/migrate/20130813224817_rename_blocked_emails_to_screened_emails.rb b/db/migrate/20130813224817_rename_blocked_emails_to_screened_emails.rb
index 6518c622b69..69aaa5efcac 100644
--- a/db/migrate/20130813224817_rename_blocked_emails_to_screened_emails.rb
+++ b/db/migrate/20130813224817_rename_blocked_emails_to_screened_emails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameBlockedEmailsToScreenedEmails < ActiveRecord::Migration[4.2]
def change
rename_table :blocked_emails, :screened_emails
diff --git a/db/migrate/20130816024250_create_oauth2_user_infos.rb b/db/migrate/20130816024250_create_oauth2_user_infos.rb
index d29ec19b194..daea47c31f1 100644
--- a/db/migrate/20130816024250_create_oauth2_user_infos.rb
+++ b/db/migrate/20130816024250_create_oauth2_user_infos.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateOauth2UserInfos < ActiveRecord::Migration[4.2]
def change
create_table :oauth2_user_infos do |t|
diff --git a/db/migrate/20130819192358_add_value_columns_to_staff_action_logs.rb b/db/migrate/20130819192358_add_value_columns_to_staff_action_logs.rb
index 4251b122f8d..2fa7d189522 100644
--- a/db/migrate/20130819192358_add_value_columns_to_staff_action_logs.rb
+++ b/db/migrate/20130819192358_add_value_columns_to_staff_action_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddValueColumnsToStaffActionLogs < ActiveRecord::Migration[4.2]
def change
add_column :staff_action_logs, :subject, :text
diff --git a/db/migrate/20130820174431_add_subject_index_to_staff_action_logs.rb b/db/migrate/20130820174431_add_subject_index_to_staff_action_logs.rb
index 47459b3bfc5..b9aae2d4696 100644
--- a/db/migrate/20130820174431_add_subject_index_to_staff_action_logs.rb
+++ b/db/migrate/20130820174431_add_subject_index_to_staff_action_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSubjectIndexToStaffActionLogs < ActiveRecord::Migration[4.2]
def change
add_index :staff_action_logs, [:subject, :id]
diff --git a/db/migrate/20130822213513_add_ip_address_to_screening_tables.rb b/db/migrate/20130822213513_add_ip_address_to_screening_tables.rb
index b5a5490e73a..f226f18b2f3 100644
--- a/db/migrate/20130822213513_add_ip_address_to_screening_tables.rb
+++ b/db/migrate/20130822213513_add_ip_address_to_screening_tables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIpAddressToScreeningTables < ActiveRecord::Migration[4.2]
def change
add_column :screened_emails, :ip_address, :inet
diff --git a/db/migrate/20130823201420_drop_defaults_on_email_digest_columns_of_users.rb b/db/migrate/20130823201420_drop_defaults_on_email_digest_columns_of_users.rb
index 0f113875753..f1f3560dd48 100644
--- a/db/migrate/20130823201420_drop_defaults_on_email_digest_columns_of_users.rb
+++ b/db/migrate/20130823201420_drop_defaults_on_email_digest_columns_of_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DropDefaultsOnEmailDigestColumnsOfUsers < ActiveRecord::Migration[4.2]
def up
change_column_default :users, :email_digests, nil
diff --git a/db/migrate/20130826011521_create_plugin_store_rows.rb b/db/migrate/20130826011521_create_plugin_store_rows.rb
index c26e09e0b02..f74a9037d9a 100644
--- a/db/migrate/20130826011521_create_plugin_store_rows.rb
+++ b/db/migrate/20130826011521_create_plugin_store_rows.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePluginStoreRows < ActiveRecord::Migration[4.2]
def change
create_table :plugin_store_rows do |table|
diff --git a/db/migrate/20130828192526_fix_optimized_images_urls.rb b/db/migrate/20130828192526_fix_optimized_images_urls.rb
index 31eb7d61cb4..e6d252d9980 100644
--- a/db/migrate/20130828192526_fix_optimized_images_urls.rb
+++ b/db/migrate/20130828192526_fix_optimized_images_urls.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixOptimizedImagesUrls < ActiveRecord::Migration[4.2]
def up
# `AddUrlToOptimizedImages` was wrongly computing the URLs. This fixes it!
diff --git a/db/migrate/20130903154323_allow_null_user_id_on_posts.rb b/db/migrate/20130903154323_allow_null_user_id_on_posts.rb
index 8afa0a9d1e4..0798b0debf3 100644
--- a/db/migrate/20130903154323_allow_null_user_id_on_posts.rb
+++ b/db/migrate/20130903154323_allow_null_user_id_on_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AllowNullUserIdOnPosts < ActiveRecord::Migration[4.2]
def up
change_column :posts, :user_id, :integer, null: true
diff --git a/db/migrate/20130904181208_allow_null_user_id_on_topics.rb b/db/migrate/20130904181208_allow_null_user_id_on_topics.rb
index 1cf399f4b37..c25364365c1 100644
--- a/db/migrate/20130904181208_allow_null_user_id_on_topics.rb
+++ b/db/migrate/20130904181208_allow_null_user_id_on_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AllowNullUserIdOnTopics < ActiveRecord::Migration[4.2]
def up
change_column :topics, :user_id, :integer, null: true
diff --git a/db/migrate/20130906081326_rename_system_username.rb b/db/migrate/20130906081326_rename_system_username.rb
index 13e3dcc9127..1d18deaaa56 100644
--- a/db/migrate/20130906081326_rename_system_username.rb
+++ b/db/migrate/20130906081326_rename_system_username.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameSystemUsername < ActiveRecord::Migration[4.2]
def up
execute "update site_settings set name = 'site_contact_username' where name = 'system_username'"
diff --git a/db/migrate/20130906171631_add_index_to_uploads.rb b/db/migrate/20130906171631_add_index_to_uploads.rb
index f52a61e8b4a..ad15cd3bc93 100644
--- a/db/migrate/20130906171631_add_index_to_uploads.rb
+++ b/db/migrate/20130906171631_add_index_to_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexToUploads < ActiveRecord::Migration[4.2]
def change
add_index :uploads, [:id, :url]
diff --git a/db/migrate/20130910040235_index_topics_for_front_page.rb b/db/migrate/20130910040235_index_topics_for_front_page.rb
index 7b495958dea..746e7946fa2 100644
--- a/db/migrate/20130910040235_index_topics_for_front_page.rb
+++ b/db/migrate/20130910040235_index_topics_for_front_page.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IndexTopicsForFrontPage < ActiveRecord::Migration[4.2]
def change
add_index :topics, [:deleted_at, :visible, :archetype, :id]
diff --git a/db/migrate/20130910220317_rename_staff_action_logs_to_user_history.rb b/db/migrate/20130910220317_rename_staff_action_logs_to_user_history.rb
index b11fb90b29e..acd5f730c79 100644
--- a/db/migrate/20130910220317_rename_staff_action_logs_to_user_history.rb
+++ b/db/migrate/20130910220317_rename_staff_action_logs_to_user_history.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameStaffActionLogsToUserHistory < ActiveRecord::Migration[4.2]
def up
remove_index :staff_action_logs, [:staff_user_id, :id]
diff --git a/db/migrate/20130911182437_create_user_stats.rb b/db/migrate/20130911182437_create_user_stats.rb
index b7936b37104..9b0794e8aaf 100644
--- a/db/migrate/20130911182437_create_user_stats.rb
+++ b/db/migrate/20130911182437_create_user_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUserStats < ActiveRecord::Migration[4.2]
def up
create_table :user_stats, id: false do |t|
diff --git a/db/migrate/20130912185218_acting_user_null.rb b/db/migrate/20130912185218_acting_user_null.rb
index e6a8b92aa77..2e5c427b783 100644
--- a/db/migrate/20130912185218_acting_user_null.rb
+++ b/db/migrate/20130912185218_acting_user_null.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ActingUserNull < ActiveRecord::Migration[4.2]
def up
change_column :user_histories, :acting_user_id, :integer, null: true
diff --git a/db/migrate/20130913210454_add_mobile_to_site_customizations.rb b/db/migrate/20130913210454_add_mobile_to_site_customizations.rb
index f66162dc299..b26e52ab5f1 100644
--- a/db/migrate/20130913210454_add_mobile_to_site_customizations.rb
+++ b/db/migrate/20130913210454_add_mobile_to_site_customizations.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMobileToSiteCustomizations < ActiveRecord::Migration[4.2]
def change
add_column :site_customizations, :mobile_stylesheet, :text
diff --git a/db/migrate/20130917174738_add_topic_id_to_user_histories.rb b/db/migrate/20130917174738_add_topic_id_to_user_histories.rb
index 0347a3edc08..2cbc3f435a0 100644
--- a/db/migrate/20130917174738_add_topic_id_to_user_histories.rb
+++ b/db/migrate/20130917174738_add_topic_id_to_user_histories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTopicIdToUserHistories < ActiveRecord::Migration[4.2]
def change
add_column :user_histories, :topic_id, :integer
diff --git a/db/migrate/20131001060630_add_email_always_to_users.rb b/db/migrate/20131001060630_add_email_always_to_users.rb
index f8ef7f31a3a..093031ba209 100644
--- a/db/migrate/20131001060630_add_email_always_to_users.rb
+++ b/db/migrate/20131001060630_add_email_always_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddEmailAlwaysToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :email_always, :bool, default: false, null: false
diff --git a/db/migrate/20131002070347_add_user_id_parent_type_index_on_views.rb b/db/migrate/20131002070347_add_user_id_parent_type_index_on_views.rb
index f20ecc4545c..4c0d5535922 100644
--- a/db/migrate/20131002070347_add_user_id_parent_type_index_on_views.rb
+++ b/db/migrate/20131002070347_add_user_id_parent_type_index_on_views.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUserIdParentTypeIndexOnViews < ActiveRecord::Migration[4.2]
def change
add_index :views, [:user_id, :parent_type, :parent_id]
diff --git a/db/migrate/20131003061137_move_columns_to_user_stats.rb b/db/migrate/20131003061137_move_columns_to_user_stats.rb
index 4212b56bca7..2faa1324269 100644
--- a/db/migrate/20131003061137_move_columns_to_user_stats.rb
+++ b/db/migrate/20131003061137_move_columns_to_user_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MoveColumnsToUserStats < ActiveRecord::Migration[4.2]
def up
add_column :user_stats, :topics_entered, :integer, default: 0, null: false
diff --git a/db/migrate/20131014203951_backfill_post_upload_reverse_index.rb b/db/migrate/20131014203951_backfill_post_upload_reverse_index.rb
index d288ef1ec2d..793da0ce64a 100644
--- a/db/migrate/20131014203951_backfill_post_upload_reverse_index.rb
+++ b/db/migrate/20131014203951_backfill_post_upload_reverse_index.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BackfillPostUploadReverseIndex < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20131015131652_create_post_details.rb b/db/migrate/20131015131652_create_post_details.rb
index 20b780b9f73..4371c0efb7a 100644
--- a/db/migrate/20131015131652_create_post_details.rb
+++ b/db/migrate/20131015131652_create_post_details.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostDetails < ActiveRecord::Migration[4.2]
def change
create_table :post_details do |t|
diff --git a/db/migrate/20131017014509_add_post_count_to_categories.rb b/db/migrate/20131017014509_add_post_count_to_categories.rb
index c1db909d769..a9a0c0cfb46 100644
--- a/db/migrate/20131017014509_add_post_count_to_categories.rb
+++ b/db/migrate/20131017014509_add_post_count_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostCountToCategories < ActiveRecord::Migration[4.2]
def up
add_column :categories, :post_count, :integer, null: false, default: 0
diff --git a/db/migrate/20131017030605_add_latest_to_categories.rb b/db/migrate/20131017030605_add_latest_to_categories.rb
index 9dfb9a2e486..5166e35fd0a 100644
--- a/db/migrate/20131017030605_add_latest_to_categories.rb
+++ b/db/migrate/20131017030605_add_latest_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLatestToCategories < ActiveRecord::Migration[4.2]
def up
add_column :categories, :latest_post_id, :integer
diff --git a/db/migrate/20131017205954_create_screened_ip_addresses.rb b/db/migrate/20131017205954_create_screened_ip_addresses.rb
index aeb2f9bdb1e..71ae6f595e9 100644
--- a/db/migrate/20131017205954_create_screened_ip_addresses.rb
+++ b/db/migrate/20131017205954_create_screened_ip_addresses.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateScreenedIpAddresses < ActiveRecord::Migration[4.2]
def change
create_table :screened_ip_addresses do |t|
diff --git a/db/migrate/20131018050738_add_position_to_categories.rb b/db/migrate/20131018050738_add_position_to_categories.rb
index 7f45652ed11..548a5bb3599 100644
--- a/db/migrate/20131018050738_add_position_to_categories.rb
+++ b/db/migrate/20131018050738_add_position_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPositionToCategories < ActiveRecord::Migration[4.2]
def up
add_column :categories, :position, :integer
diff --git a/db/migrate/20131022045114_add_uncategorized_category.rb b/db/migrate/20131022045114_add_uncategorized_category.rb
index 21c3c74c983..14b17d10f09 100644
--- a/db/migrate/20131022045114_add_uncategorized_category.rb
+++ b/db/migrate/20131022045114_add_uncategorized_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUncategorizedCategory < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20131022151218_create_api_keys.rb b/db/migrate/20131022151218_create_api_keys.rb
index 4976d9fe582..1eed1250eae 100644
--- a/db/migrate/20131022151218_create_api_keys.rb
+++ b/db/migrate/20131022151218_create_api_keys.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateApiKeys < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20131023163509_add_parent_category_id_to_categories.rb b/db/migrate/20131023163509_add_parent_category_id_to_categories.rb
index c23d09f39dd..e72a112373b 100644
--- a/db/migrate/20131023163509_add_parent_category_id_to_categories.rb
+++ b/db/migrate/20131023163509_add_parent_category_id_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddParentCategoryIdToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :parent_category_id, :integer
diff --git a/db/migrate/20131105101051_add_origin_to_uploads.rb b/db/migrate/20131105101051_add_origin_to_uploads.rb
index d6c63755b47..dec029105e6 100644
--- a/db/migrate/20131105101051_add_origin_to_uploads.rb
+++ b/db/migrate/20131105101051_add_origin_to_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddOriginToUploads < ActiveRecord::Migration[4.2]
def change
add_column :uploads, :origin, :string, limit: 1000
diff --git a/db/migrate/20131107154900_rename_banned_to_suspended.rb b/db/migrate/20131107154900_rename_banned_to_suspended.rb
index 838863194bd..09d0a9f7e48 100644
--- a/db/migrate/20131107154900_rename_banned_to_suspended.rb
+++ b/db/migrate/20131107154900_rename_banned_to_suspended.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameBannedToSuspended < ActiveRecord::Migration[4.2]
def change
rename_column :users, :banned_at, :suspended_at
diff --git a/db/migrate/20131114185225_add_participant_count_to_topics.rb b/db/migrate/20131114185225_add_participant_count_to_topics.rb
index 42dda2a4b02..214d83d6283 100644
--- a/db/migrate/20131114185225_add_participant_count_to_topics.rb
+++ b/db/migrate/20131114185225_add_participant_count_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddParticipantCountToTopics < ActiveRecord::Migration[4.2]
def up
add_column :topics, :participant_count, :integer, default: 1
diff --git a/db/migrate/20131115165105_add_edit_reason_to_posts.rb b/db/migrate/20131115165105_add_edit_reason_to_posts.rb
index e84ee098804..c1321839966 100644
--- a/db/migrate/20131115165105_add_edit_reason_to_posts.rb
+++ b/db/migrate/20131115165105_add_edit_reason_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddEditReasonToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :edit_reason, :string
diff --git a/db/migrate/20131118173159_rename_best_of_to_summary.rb b/db/migrate/20131118173159_rename_best_of_to_summary.rb
index 777506f513c..cc9d40eb349 100644
--- a/db/migrate/20131118173159_rename_best_of_to_summary.rb
+++ b/db/migrate/20131118173159_rename_best_of_to_summary.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameBestOfToSummary < ActiveRecord::Migration[4.2]
def change
rename_column :topics, :has_best_of, :has_summary
diff --git a/db/migrate/20131120055018_move_emoji_to_new_location.rb b/db/migrate/20131120055018_move_emoji_to_new_location.rb
index 1863a7bad17..b564a7326df 100644
--- a/db/migrate/20131120055018_move_emoji_to_new_location.rb
+++ b/db/migrate/20131120055018_move_emoji_to_new_location.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MoveEmojiToNewLocation < ActiveRecord::Migration[4.2]
def up
execute("update posts set cooked = regexp_replace(cooked, '\(]*)assets\/emoji\/', '\\1plugins\/emoji\/images\/' , 'g') where cooked like '%emoji%'")
diff --git a/db/migrate/20131122064921_increase_twitter_user_id_length.rb b/db/migrate/20131122064921_increase_twitter_user_id_length.rb
index ab1ee73c0ad..0e5982c3fcf 100644
--- a/db/migrate/20131122064921_increase_twitter_user_id_length.rb
+++ b/db/migrate/20131122064921_increase_twitter_user_id_length.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncreaseTwitterUserIdLength < ActiveRecord::Migration[4.2]
def change
change_column :twitter_user_infos, :twitter_user_id, :bigint
diff --git a/db/migrate/20131206200009_rename_auto_close_days_to_hours.rb b/db/migrate/20131206200009_rename_auto_close_days_to_hours.rb
index f37240a3716..838d36e92bd 100644
--- a/db/migrate/20131206200009_rename_auto_close_days_to_hours.rb
+++ b/db/migrate/20131206200009_rename_auto_close_days_to_hours.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameAutoCloseDaysToHours < ActiveRecord::Migration[4.2]
def up
rename_column :categories, :auto_close_days, :auto_close_hours
diff --git a/db/migrate/20131209091702_create_post_revisions.rb b/db/migrate/20131209091702_create_post_revisions.rb
index 0cc684cf859..9e97b05bf11 100644
--- a/db/migrate/20131209091702_create_post_revisions.rb
+++ b/db/migrate/20131209091702_create_post_revisions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePostRevisions < ActiveRecord::Migration[4.2]
def up
create_table :post_revisions do |t|
diff --git a/db/migrate/20131209091742_create_topic_revisions.rb b/db/migrate/20131209091742_create_topic_revisions.rb
index ecbb4e2c37e..f4e53afc998 100644
--- a/db/migrate/20131209091742_create_topic_revisions.rb
+++ b/db/migrate/20131209091742_create_topic_revisions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateTopicRevisions < ActiveRecord::Migration[4.2]
def up
create_table :topic_revisions do |t|
diff --git a/db/migrate/20131210163702_add_word_count_to_posts.rb b/db/migrate/20131210163702_add_word_count_to_posts.rb
index 6f008f8604a..240d6806cef 100644
--- a/db/migrate/20131210163702_add_word_count_to_posts.rb
+++ b/db/migrate/20131210163702_add_word_count_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddWordCountToPosts < ActiveRecord::Migration[4.2]
def up
add_column :posts, :word_count, :integer
diff --git a/db/migrate/20131210181901_migrate_word_counts.rb b/db/migrate/20131210181901_migrate_word_counts.rb
index 1731e2cefd6..aa998891633 100644
--- a/db/migrate/20131210181901_migrate_word_counts.rb
+++ b/db/migrate/20131210181901_migrate_word_counts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateWordCounts < ActiveRecord::Migration[4.2]
disable_ddl_transaction!
diff --git a/db/migrate/20131210234530_rename_version_column.rb b/db/migrate/20131210234530_rename_version_column.rb
index f6271fc83f6..c524f13c8e6 100644
--- a/db/migrate/20131210234530_rename_version_column.rb
+++ b/db/migrate/20131210234530_rename_version_column.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameVersionColumn < ActiveRecord::Migration[4.2]
def change
diff --git a/db/migrate/20131212225511_add_post_count_stats_columns_to_categories.rb b/db/migrate/20131212225511_add_post_count_stats_columns_to_categories.rb
index 73466e65e08..dec014381c4 100644
--- a/db/migrate/20131212225511_add_post_count_stats_columns_to_categories.rb
+++ b/db/migrate/20131212225511_add_post_count_stats_columns_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostCountStatsColumnsToCategories < ActiveRecord::Migration[4.2]
def change
change_table :categories do |t|
diff --git a/db/migrate/20131216164557_make_position_nullable_in_categories.rb b/db/migrate/20131216164557_make_position_nullable_in_categories.rb
index d47d852f0b8..f987c701ed6 100644
--- a/db/migrate/20131216164557_make_position_nullable_in_categories.rb
+++ b/db/migrate/20131216164557_make_position_nullable_in_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MakePositionNullableInCategories < ActiveRecord::Migration[4.2]
def up
change_column :categories, :position, :integer, null: true
diff --git a/db/migrate/20131217174004_create_topic_embeds.rb b/db/migrate/20131217174004_create_topic_embeds.rb
index 53be7fff287..569bad298b6 100644
--- a/db/migrate/20131217174004_create_topic_embeds.rb
+++ b/db/migrate/20131217174004_create_topic_embeds.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateTopicEmbeds < ActiveRecord::Migration[4.2]
def change
create_table :topic_embeds, force: true do |t|
diff --git a/db/migrate/20131219203905_add_cook_method_to_posts.rb b/db/migrate/20131219203905_add_cook_method_to_posts.rb
index 987349d345c..0d0f1f8e217 100644
--- a/db/migrate/20131219203905_add_cook_method_to_posts.rb
+++ b/db/migrate/20131219203905_add_cook_method_to_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCookMethodToPosts < ActiveRecord::Migration[4.2]
def change
add_column :posts, :cook_method, :integer, default: 1, null: false
diff --git a/db/migrate/20131223171005_create_top_topics.rb b/db/migrate/20131223171005_create_top_topics.rb
index af3be254834..298f618b97c 100644
--- a/db/migrate/20131223171005_create_top_topics.rb
+++ b/db/migrate/20131223171005_create_top_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateTopTopics < ActiveRecord::Migration[4.2]
PERIODS = [:yearly, :monthly, :weekly, :daily]
SORT_ORDERS = [:posts, :views, :likes]
diff --git a/db/migrate/20131227164338_add_scores_to_top_topics.rb b/db/migrate/20131227164338_add_scores_to_top_topics.rb
index 4245057c828..040adc1127c 100644
--- a/db/migrate/20131227164338_add_scores_to_top_topics.rb
+++ b/db/migrate/20131227164338_add_scores_to_top_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddScoresToTopTopics < ActiveRecord::Migration[4.2]
def change
[:daily, :weekly, :monthly, :yearly].each do |period|
diff --git a/db/migrate/20131229221725_add_watch_new_topics_to_users.rb b/db/migrate/20131229221725_add_watch_new_topics_to_users.rb
index 9c3105ad8bc..4a557202672 100644
--- a/db/migrate/20131229221725_add_watch_new_topics_to_users.rb
+++ b/db/migrate/20131229221725_add_watch_new_topics_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddWatchNewTopicsToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :watch_new_topics, :boolean, default: false, null: false
diff --git a/db/migrate/20131230010239_add_last_emailed_post_number_to_topic_user.rb b/db/migrate/20131230010239_add_last_emailed_post_number_to_topic_user.rb
index b49bf2b4c22..b8cab73d651 100644
--- a/db/migrate/20131230010239_add_last_emailed_post_number_to_topic_user.rb
+++ b/db/migrate/20131230010239_add_last_emailed_post_number_to_topic_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastEmailedPostNumberToTopicUser < ActiveRecord::Migration[4.2]
def change
add_column :topic_users, :last_emailed_post_number, :integer
diff --git a/db/migrate/20140101235747_add_category_users.rb b/db/migrate/20140101235747_add_category_users.rb
index 11fc4bfffe4..2457d7f1543 100644
--- a/db/migrate/20140101235747_add_category_users.rb
+++ b/db/migrate/20140101235747_add_category_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCategoryUsers < ActiveRecord::Migration[4.2]
def change
create_table :category_users do |t|
diff --git a/db/migrate/20140102104229_add_alias_level_to_groups.rb b/db/migrate/20140102104229_add_alias_level_to_groups.rb
index 64106fdf69d..9efe9ed7669 100644
--- a/db/migrate/20140102104229_add_alias_level_to_groups.rb
+++ b/db/migrate/20140102104229_add_alias_level_to_groups.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAliasLevelToGroups < ActiveRecord::Migration[4.2]
def change
add_column :groups, :alias_level, :integer, default: 0
diff --git a/db/migrate/20140102194802_remove_default_from_external_links_in_new_tab.rb b/db/migrate/20140102194802_remove_default_from_external_links_in_new_tab.rb
index af05478d6f2..2119086cdd9 100644
--- a/db/migrate/20140102194802_remove_default_from_external_links_in_new_tab.rb
+++ b/db/migrate/20140102194802_remove_default_from_external_links_in_new_tab.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveDefaultFromExternalLinksInNewTab < ActiveRecord::Migration[4.2]
def up
change_column_default :users, :external_links_in_new_tab, nil
diff --git a/db/migrate/20140107220141_remove_enable_wide_category_list.rb b/db/migrate/20140107220141_remove_enable_wide_category_list.rb
index 0d5f52112f8..d005c8c9e63 100644
--- a/db/migrate/20140107220141_remove_enable_wide_category_list.rb
+++ b/db/migrate/20140107220141_remove_enable_wide_category_list.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveEnableWideCategoryList < ActiveRecord::Migration[4.2]
def up
execute "DELETE FROM site_settings WHERE name = 'enable_wide_category_list'"
diff --git a/db/migrate/20140109205940_rename_favorites_to_starred.rb b/db/migrate/20140109205940_rename_favorites_to_starred.rb
index bdfc6b505fe..588fb633e01 100644
--- a/db/migrate/20140109205940_rename_favorites_to_starred.rb
+++ b/db/migrate/20140109205940_rename_favorites_to_starred.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameFavoritesToStarred < ActiveRecord::Migration[4.2]
def up
execute "UPDATE site_settings SET name = 'max_stars_per_day' where name = 'max_favorites_per_day'"
diff --git a/db/migrate/20140116170655_drop_hot_topics.rb b/db/migrate/20140116170655_drop_hot_topics.rb
index 77caed34697..5c74a1b0d4d 100644
--- a/db/migrate/20140116170655_drop_hot_topics.rb
+++ b/db/migrate/20140116170655_drop_hot_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DropHotTopics < ActiveRecord::Migration[4.2]
def change
drop_table :hot_topics
diff --git a/db/migrate/20140120155706_add_lounge_category.rb b/db/migrate/20140120155706_add_lounge_category.rb
index ea9a065b45b..f2b4f5d560c 100644
--- a/db/migrate/20140120155706_add_lounge_category.rb
+++ b/db/migrate/20140120155706_add_lounge_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLoungeCategory < ActiveRecord::Migration[4.2]
def change
# replaced by fixture
diff --git a/db/migrate/20140121204628_add_invalidated_at_to_invites.rb b/db/migrate/20140121204628_add_invalidated_at_to_invites.rb
index 2c7508d6e10..aea1bf863c6 100644
--- a/db/migrate/20140121204628_add_invalidated_at_to_invites.rb
+++ b/db/migrate/20140121204628_add_invalidated_at_to_invites.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddInvalidatedAtToInvites < ActiveRecord::Migration[4.2]
def change
add_column :invites, :invalidated_at, :datetime
diff --git a/db/migrate/20140122043508_add_meta_category.rb b/db/migrate/20140122043508_add_meta_category.rb
index f139dd78dfa..e874818c5c2 100644
--- a/db/migrate/20140122043508_add_meta_category.rb
+++ b/db/migrate/20140122043508_add_meta_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMetaCategory < ActiveRecord::Migration[4.2]
def change
# replaced by fixture
diff --git a/db/migrate/20140124202427_add_posts_read_to_user_visits.rb b/db/migrate/20140124202427_add_posts_read_to_user_visits.rb
index aa8492d3975..c74353ce989 100644
--- a/db/migrate/20140124202427_add_posts_read_to_user_visits.rb
+++ b/db/migrate/20140124202427_add_posts_read_to_user_visits.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostsReadToUserVisits < ActiveRecord::Migration[4.2]
def up
add_column :user_visits, :posts_read, :integer, default: 0
diff --git a/db/migrate/20140129164541_remove_category_hotness.rb b/db/migrate/20140129164541_remove_category_hotness.rb
index af127eaacb2..d3a6b8f821b 100644
--- a/db/migrate/20140129164541_remove_category_hotness.rb
+++ b/db/migrate/20140129164541_remove_category_hotness.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveCategoryHotness < ActiveRecord::Migration[4.2]
def change
remove_column :categories, :hotness
diff --git a/db/migrate/20140206044818_add_locale_to_user.rb b/db/migrate/20140206044818_add_locale_to_user.rb
index 8771039c50a..c3c27bb0f15 100644
--- a/db/migrate/20140206044818_add_locale_to_user.rb
+++ b/db/migrate/20140206044818_add_locale_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLocaleToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :locale, :string, limit: 10
diff --git a/db/migrate/20140206195001_add_defaults_to_category_posts_and_topics_fields.rb b/db/migrate/20140206195001_add_defaults_to_category_posts_and_topics_fields.rb
index e5c7ddbdd30..c676407c074 100644
--- a/db/migrate/20140206195001_add_defaults_to_category_posts_and_topics_fields.rb
+++ b/db/migrate/20140206195001_add_defaults_to_category_posts_and_topics_fields.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddDefaultsToCategoryPostsAndTopicsFields < ActiveRecord::Migration[4.2]
def change
change_column_default :categories, :posts_week, 0
diff --git a/db/migrate/20140206215029_add_mailing_list_mode_to_users.rb b/db/migrate/20140206215029_add_mailing_list_mode_to_users.rb
index d9a0c0d9404..5ea59d402fa 100644
--- a/db/migrate/20140206215029_add_mailing_list_mode_to_users.rb
+++ b/db/migrate/20140206215029_add_mailing_list_mode_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMailingListModeToUsers < ActiveRecord::Migration[4.2]
def change
rename_column :users, :watch_new_topics, :mailing_list_mode
diff --git a/db/migrate/20140210194146_add_primary_group_id_to_users.rb b/db/migrate/20140210194146_add_primary_group_id_to_users.rb
index 71562daba9f..22458b2c45a 100644
--- a/db/migrate/20140210194146_add_primary_group_id_to_users.rb
+++ b/db/migrate/20140210194146_add_primary_group_id_to_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPrimaryGroupIdToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :primary_group_id, :integer, null: true
diff --git a/db/migrate/20140211230222_move_cas_settings.rb b/db/migrate/20140211230222_move_cas_settings.rb
index d2775e2f305..1923408e484 100644
--- a/db/migrate/20140211230222_move_cas_settings.rb
+++ b/db/migrate/20140211230222_move_cas_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MoveCasSettings < ActiveRecord::Migration[4.2]
def change
#As part of removing the build in CAS authentication we should
diff --git a/db/migrate/20140211234523_add_targets_topic_to_post_actions.rb b/db/migrate/20140211234523_add_targets_topic_to_post_actions.rb
index 5da97fe9840..998c76c6cb7 100644
--- a/db/migrate/20140211234523_add_targets_topic_to_post_actions.rb
+++ b/db/migrate/20140211234523_add_targets_topic_to_post_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTargetsTopicToPostActions < ActiveRecord::Migration[4.2]
def change
add_column :post_actions, :targets_topic, :boolean, default: false
diff --git a/db/migrate/20140214151255_add_skipped_to_email_logs.rb b/db/migrate/20140214151255_add_skipped_to_email_logs.rb
index f24b2fc09fb..8af4e016b2b 100644
--- a/db/migrate/20140214151255_add_skipped_to_email_logs.rb
+++ b/db/migrate/20140214151255_add_skipped_to_email_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSkippedToEmailLogs < ActiveRecord::Migration[4.2]
def change
add_column :email_logs, :skipped, :boolean, default: :false
diff --git a/db/migrate/20140220160510_rename_site_settings.rb b/db/migrate/20140220160510_rename_site_settings.rb
index 78da03786e2..7424d1f4b25 100644
--- a/db/migrate/20140220160510_rename_site_settings.rb
+++ b/db/migrate/20140220160510_rename_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameSiteSettings < ActiveRecord::Migration[4.2]
def up
diff --git a/db/migrate/20140220163213_rename_delete_user_max_age.rb b/db/migrate/20140220163213_rename_delete_user_max_age.rb
index 5906f36f796..92cb329f400 100644
--- a/db/migrate/20140220163213_rename_delete_user_max_age.rb
+++ b/db/migrate/20140220163213_rename_delete_user_max_age.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameDeleteUserMaxAge < ActiveRecord::Migration[4.2]
def change
execute "UPDATE site_settings SET name = 'delete_user_max_post_age' WHERE name = 'delete_user_max_age'"
diff --git a/db/migrate/20140224232712_add_profile_background_to_user.rb b/db/migrate/20140224232712_add_profile_background_to_user.rb
index ad6f4366f82..768af14d44b 100644
--- a/db/migrate/20140224232712_add_profile_background_to_user.rb
+++ b/db/migrate/20140224232712_add_profile_background_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddProfileBackgroundToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :profile_background, :string, limit: 255
diff --git a/db/migrate/20140224232913_add_single_sign_on_records.rb b/db/migrate/20140224232913_add_single_sign_on_records.rb
index 994a5cfceee..70ef2dd7803 100644
--- a/db/migrate/20140224232913_add_single_sign_on_records.rb
+++ b/db/migrate/20140224232913_add_single_sign_on_records.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSingleSignOnRecords < ActiveRecord::Migration[4.2]
def change
create_table :single_sign_on_records do |t|
diff --git a/db/migrate/20140227104930_add_custom_email_in_to_categories.rb b/db/migrate/20140227104930_add_custom_email_in_to_categories.rb
index 007c54e165a..b74a227b086 100644
--- a/db/migrate/20140227104930_add_custom_email_in_to_categories.rb
+++ b/db/migrate/20140227104930_add_custom_email_in_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCustomEmailInToCategories < ActiveRecord::Migration[4.2]
def up
add_column :categories, :email_in, :string, null: true
diff --git a/db/migrate/20140227201005_add_staff_category.rb b/db/migrate/20140227201005_add_staff_category.rb
index e18105b566f..1ac33ed6d14 100644
--- a/db/migrate/20140227201005_add_staff_category.rb
+++ b/db/migrate/20140227201005_add_staff_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddStaffCategory < ActiveRecord::Migration[4.2]
def change
# replaced by fixture
diff --git a/db/migrate/20140228005443_add_external_username_to_single_sign_on_record.rb b/db/migrate/20140228005443_add_external_username_to_single_sign_on_record.rb
index b450c55260a..55f58f80973 100644
--- a/db/migrate/20140228005443_add_external_username_to_single_sign_on_record.rb
+++ b/db/migrate/20140228005443_add_external_username_to_single_sign_on_record.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddExternalUsernameToSingleSignOnRecord < ActiveRecord::Migration[4.2]
def change
add_column :single_sign_on_records, :external_username, :string
diff --git a/db/migrate/20140228173431_add_external_email_and_external_name_to_single_sign_on_record.rb b/db/migrate/20140228173431_add_external_email_and_external_name_to_single_sign_on_record.rb
index 720a1b5e4e3..2767245165e 100644
--- a/db/migrate/20140228173431_add_external_email_and_external_name_to_single_sign_on_record.rb
+++ b/db/migrate/20140228173431_add_external_email_and_external_name_to_single_sign_on_record.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddExternalEmailAndExternalNameToSingleSignOnRecord < ActiveRecord::Migration[4.2]
def change
add_column :single_sign_on_records, :external_email, :string
diff --git a/db/migrate/20140228205743_add_admin_only_to_user_histories.rb b/db/migrate/20140228205743_add_admin_only_to_user_histories.rb
index 1a9e3a7d0bf..569cde87317 100644
--- a/db/migrate/20140228205743_add_admin_only_to_user_histories.rb
+++ b/db/migrate/20140228205743_add_admin_only_to_user_histories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAdminOnlyToUserHistories < ActiveRecord::Migration[4.2]
def up
add_column :user_histories, :admin_only, :boolean, default: false
diff --git a/db/migrate/20140303185354_add_new_since_to_user_stats.rb b/db/migrate/20140303185354_add_new_since_to_user_stats.rb
index c510ea61731..b2dc6730bbf 100644
--- a/db/migrate/20140303185354_add_new_since_to_user_stats.rb
+++ b/db/migrate/20140303185354_add_new_since_to_user_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNewSinceToUserStats < ActiveRecord::Migration[4.2]
def change
add_column :user_stats, :new_since, :datetime
diff --git a/db/migrate/20140304200606_create_badge_types.rb b/db/migrate/20140304200606_create_badge_types.rb
index 4c3d460dce1..e81bd3b55cd 100644
--- a/db/migrate/20140304200606_create_badge_types.rb
+++ b/db/migrate/20140304200606_create_badge_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateBadgeTypes < ActiveRecord::Migration[4.2]
def change
create_table :badge_types do |t|
diff --git a/db/migrate/20140304201403_create_badges.rb b/db/migrate/20140304201403_create_badges.rb
index 040468e042e..06dd3351480 100644
--- a/db/migrate/20140304201403_create_badges.rb
+++ b/db/migrate/20140304201403_create_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateBadges < ActiveRecord::Migration[4.2]
def change
create_table :badges do |t|
diff --git a/db/migrate/20140305100909_create_user_badges.rb b/db/migrate/20140305100909_create_user_badges.rb
index bb26815e72e..5ccca851e86 100644
--- a/db/migrate/20140305100909_create_user_badges.rb
+++ b/db/migrate/20140305100909_create_user_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUserBadges < ActiveRecord::Migration[4.2]
def change
create_table :user_badges do |t|
diff --git a/db/migrate/20140306223522_move_topic_revisions_to_post_revisions.rb b/db/migrate/20140306223522_move_topic_revisions_to_post_revisions.rb
index 3f810cb4526..0d7dbaa522a 100644
--- a/db/migrate/20140306223522_move_topic_revisions_to_post_revisions.rb
+++ b/db/migrate/20140306223522_move_topic_revisions_to_post_revisions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MoveTopicRevisionsToPostRevisions < ActiveRecord::Migration[4.2]
def up
execute < { 'CURRENT_TIMESTAMP' }
diff --git a/db/migrate/20180813074843_add_component_to_themes.rb b/db/migrate/20180813074843_add_component_to_themes.rb
index 54b2d39f9e1..9bd08859c0a 100644
--- a/db/migrate/20180813074843_add_component_to_themes.rb
+++ b/db/migrate/20180813074843_add_component_to_themes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddComponentToThemes < ActiveRecord::Migration[5.2]
def up
add_column :themes, :component, :boolean, null: false, default: false
diff --git a/db/migrate/20180827053514_add_filesize_to_optimized_images.rb b/db/migrate/20180827053514_add_filesize_to_optimized_images.rb
index 8840b57afe5..ed1d476add5 100644
--- a/db/migrate/20180827053514_add_filesize_to_optimized_images.rb
+++ b/db/migrate/20180827053514_add_filesize_to_optimized_images.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFilesizeToOptimizedImages < ActiveRecord::Migration[5.2]
def change
add_column :optimized_images, :filesize, :integer
diff --git a/db/migrate/20180828065005_change_bounce_score_to_float.rb b/db/migrate/20180828065005_change_bounce_score_to_float.rb
index 3164f7c2b62..e102017d0b6 100644
--- a/db/migrate/20180828065005_change_bounce_score_to_float.rb
+++ b/db/migrate/20180828065005_change_bounce_score_to_float.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ChangeBounceScoreToFloat < ActiveRecord::Migration[5.2]
def up
change_column :user_stats, :bounce_score, :float
diff --git a/db/migrate/20180831182853_add_branch_to_remote_theme.rb b/db/migrate/20180831182853_add_branch_to_remote_theme.rb
index ba3bd42655b..6859aeab3c2 100644
--- a/db/migrate/20180831182853_add_branch_to_remote_theme.rb
+++ b/db/migrate/20180831182853_add_branch_to_remote_theme.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddBranchToRemoteTheme < ActiveRecord::Migration[5.2]
def change
add_column :remote_themes, :branch, :string
diff --git a/db/migrate/20180907075713_add_last_error_text_to_remote_themes.rb b/db/migrate/20180907075713_add_last_error_text_to_remote_themes.rb
index b03498eede9..58740c407ec 100644
--- a/db/migrate/20180907075713_add_last_error_text_to_remote_themes.rb
+++ b/db/migrate/20180907075713_add_last_error_text_to_remote_themes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddLastErrorTextToRemoteThemes < ActiveRecord::Migration[5.2]
def change
add_column :remote_themes, :last_error_text, :text
diff --git a/db/migrate/20180913200027_remove_enforce_square_emoji.rb b/db/migrate/20180913200027_remove_enforce_square_emoji.rb
index a774f947952..736ec903b9a 100644
--- a/db/migrate/20180913200027_remove_enforce_square_emoji.rb
+++ b/db/migrate/20180913200027_remove_enforce_square_emoji.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveEnforceSquareEmoji < ActiveRecord::Migration[5.2]
def up
execute "DELETE FROM site_settings WHERE name = 'enforce_square_emoji'"
diff --git a/db/migrate/20180916195601_migrate_s3_backup_site_settings.rb b/db/migrate/20180916195601_migrate_s3_backup_site_settings.rb
index 064a4046276..05ac418f197 100644
--- a/db/migrate/20180916195601_migrate_s3_backup_site_settings.rb
+++ b/db/migrate/20180916195601_migrate_s3_backup_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateS3BackupSiteSettings < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20180920023559_add_external_details_to_user_fields.rb b/db/migrate/20180920023559_add_external_details_to_user_fields.rb
index 867afaeff24..b544e15fb09 100644
--- a/db/migrate/20180920023559_add_external_details_to_user_fields.rb
+++ b/db/migrate/20180920023559_add_external_details_to_user_fields.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddExternalDetailsToUserFields < ActiveRecord::Migration[5.2]
def change
add_column :user_fields, :external_name, :string
diff --git a/db/migrate/20180920042415_create_user_uploads.rb b/db/migrate/20180920042415_create_user_uploads.rb
index 034bc02bf68..5e592d00fc1 100644
--- a/db/migrate/20180920042415_create_user_uploads.rb
+++ b/db/migrate/20180920042415_create_user_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUserUploads < ActiveRecord::Migration[5.2]
def up
create_table :user_uploads do |t|
diff --git a/db/migrate/20180927135248_create_javascript_caches.rb b/db/migrate/20180927135248_create_javascript_caches.rb
index c2b3e83d12b..46658266c02 100644
--- a/db/migrate/20180927135248_create_javascript_caches.rb
+++ b/db/migrate/20180927135248_create_javascript_caches.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateJavascriptCaches < ActiveRecord::Migration[5.2]
def change
create_table :javascript_caches do |t|
diff --git a/db/migrate/20180928105835_add_index_to_tags.rb b/db/migrate/20180928105835_add_index_to_tags.rb
index 50a45870668..b964a330957 100644
--- a/db/migrate/20180928105835_add_index_to_tags.rb
+++ b/db/migrate/20180928105835_add_index_to_tags.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexToTags < ActiveRecord::Migration[5.2]
def up
# Append ID to any tags that already have duplicate names
diff --git a/db/migrate/20181005084357_add_sso_provider_secrets_to_site_settings.rb b/db/migrate/20181005084357_add_sso_provider_secrets_to_site_settings.rb
index b1c7b421a2e..777e665a6d2 100644
--- a/db/migrate/20181005084357_add_sso_provider_secrets_to_site_settings.rb
+++ b/db/migrate/20181005084357_add_sso_provider_secrets_to_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSsoProviderSecretsToSiteSettings < ActiveRecord::Migration[5.2]
def up
return unless SiteSetting.enable_sso_provider && SiteSetting.sso_secret.present?
diff --git a/db/migrate/20181005144357_add_via_email_to_invites.rb b/db/migrate/20181005144357_add_via_email_to_invites.rb
index 144987cff1d..0989b0539e2 100644
--- a/db/migrate/20181005144357_add_via_email_to_invites.rb
+++ b/db/migrate/20181005144357_add_via_email_to_invites.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddViaEmailToInvites < ActiveRecord::Migration[5.2]
def change
add_column :invites, :via_email, :boolean, default: false, null: false
diff --git a/db/migrate/20181010150631_add_hide_profile_and_presence_to_user_options.rb b/db/migrate/20181010150631_add_hide_profile_and_presence_to_user_options.rb
index b5eef3b307c..94b7b9449e0 100644
--- a/db/migrate/20181010150631_add_hide_profile_and_presence_to_user_options.rb
+++ b/db/migrate/20181010150631_add_hide_profile_and_presence_to_user_options.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddHideProfileAndPresenceToUserOptions < ActiveRecord::Migration[5.2]
def change
add_column :user_options, :hide_profile_and_presence, :boolean, default: false, null: false
diff --git a/db/migrate/20181031165343_add_flag_stats_to_user.rb b/db/migrate/20181031165343_add_flag_stats_to_user.rb
index 847aed08f14..22c5cb5f761 100644
--- a/db/migrate/20181031165343_add_flag_stats_to_user.rb
+++ b/db/migrate/20181031165343_add_flag_stats_to_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFlagStatsToUser < ActiveRecord::Migration[5.2]
def up
add_column :user_stats, :flags_agreed, :integer, default: 0, null: false
diff --git a/db/migrate/20181108115009_create_user_associated_accounts.rb b/db/migrate/20181108115009_create_user_associated_accounts.rb
index f9994f77ff3..6dd4e00d803 100644
--- a/db/migrate/20181108115009_create_user_associated_accounts.rb
+++ b/db/migrate/20181108115009_create_user_associated_accounts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateUserAssociatedAccounts < ActiveRecord::Migration[5.2]
def change
create_table :user_associated_accounts do |t|
diff --git a/db/migrate/20181120140552_migrate_corporate_site_settings.rb b/db/migrate/20181120140552_migrate_corporate_site_settings.rb
index c1c62db6696..26500c67d8f 100644
--- a/db/migrate/20181120140552_migrate_corporate_site_settings.rb
+++ b/db/migrate/20181120140552_migrate_corporate_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateCorporateSiteSettings < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20181128140547_migrate_facebook_user_info.rb b/db/migrate/20181128140547_migrate_facebook_user_info.rb
index 9209991d13d..9041635b9c2 100644
--- a/db/migrate/20181128140547_migrate_facebook_user_info.rb
+++ b/db/migrate/20181128140547_migrate_facebook_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateFacebookUserInfo < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20181129094518_add_not_null_minimum_required_tags_on_categories.rb b/db/migrate/20181129094518_add_not_null_minimum_required_tags_on_categories.rb
index eebefd96119..fa2df1744d9 100644
--- a/db/migrate/20181129094518_add_not_null_minimum_required_tags_on_categories.rb
+++ b/db/migrate/20181129094518_add_not_null_minimum_required_tags_on_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddNotNullMinimumRequiredTagsOnCategories < ActiveRecord::Migration[5.2]
def change
change_column_null :categories, :minimum_required_tags, false, 0
diff --git a/db/migrate/20181204123042_add_uploaded_meta_id_to_categories.rb b/db/migrate/20181204123042_add_uploaded_meta_id_to_categories.rb
index ea64d6cff01..847e16a9a17 100644
--- a/db/migrate/20181204123042_add_uploaded_meta_id_to_categories.rb
+++ b/db/migrate/20181204123042_add_uploaded_meta_id_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUploadedMetaIdToCategories < ActiveRecord::Migration[5.2]
def change
add_column :categories, :uploaded_meta_id, :integer
diff --git a/db/migrate/20181204193426_create_join_table_web_hooks_tags.rb b/db/migrate/20181204193426_create_join_table_web_hooks_tags.rb
index 9b74621b4a2..c6c34b6d635 100644
--- a/db/migrate/20181204193426_create_join_table_web_hooks_tags.rb
+++ b/db/migrate/20181204193426_create_join_table_web_hooks_tags.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateJoinTableWebHooksTags < ActiveRecord::Migration[5.2]
def change
create_join_table :web_hooks, :tags do |t|
diff --git a/db/migrate/20181207141900_migrate_twitter_user_info.rb b/db/migrate/20181207141900_migrate_twitter_user_info.rb
index f47798fe303..b6e0cf67df1 100644
--- a/db/migrate/20181207141900_migrate_twitter_user_info.rb
+++ b/db/migrate/20181207141900_migrate_twitter_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateTwitterUserInfo < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20181210122522_remove_not_null_user_associated_account_user.rb b/db/migrate/20181210122522_remove_not_null_user_associated_account_user.rb
index b9613412bf3..aae98f99b67 100644
--- a/db/migrate/20181210122522_remove_not_null_user_associated_account_user.rb
+++ b/db/migrate/20181210122522_remove_not_null_user_associated_account_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveNotNullUserAssociatedAccountUser < ActiveRecord::Migration[5.2]
def change
begin
diff --git a/db/migrate/20181218071253_add_etag_to_uploads.rb b/db/migrate/20181218071253_add_etag_to_uploads.rb
index dacc0957c1c..63bf28acda5 100644
--- a/db/migrate/20181218071253_add_etag_to_uploads.rb
+++ b/db/migrate/20181218071253_add_etag_to_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddEtagToUploads < ActiveRecord::Migration[5.2]
def change
add_column :uploads, :etag, :string
diff --git a/db/migrate/20181221121805_create_theme_translation_override.rb b/db/migrate/20181221121805_create_theme_translation_override.rb
index 3c918cbaedc..bcf41901724 100644
--- a/db/migrate/20181221121805_create_theme_translation_override.rb
+++ b/db/migrate/20181221121805_create_theme_translation_override.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateThemeTranslationOverride < ActiveRecord::Migration[5.2]
def change
create_table :theme_translation_overrides do |t|
diff --git a/db/migrate/20190103051737_add_version_to_optimized_images.rb b/db/migrate/20190103051737_add_version_to_optimized_images.rb
index 88d2fb99586..9548a95b1db 100644
--- a/db/migrate/20190103051737_add_version_to_optimized_images.rb
+++ b/db/migrate/20190103051737_add_version_to_optimized_images.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddVersionToOptimizedImages < ActiveRecord::Migration[5.2]
def change
add_column :optimized_images, :version, :integer
diff --git a/db/migrate/20190103060819_force_rebake_on_posts_with_images.rb b/db/migrate/20190103060819_force_rebake_on_posts_with_images.rb
index 3837aae59e0..535ea684a66 100644
--- a/db/migrate/20190103060819_force_rebake_on_posts_with_images.rb
+++ b/db/migrate/20190103060819_force_rebake_on_posts_with_images.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ForceRebakeOnPostsWithImages < ActiveRecord::Migration[5.2]
def up
diff --git a/db/migrate/20190103160533_create_reviewables.rb b/db/migrate/20190103160533_create_reviewables.rb
index 90da14223b5..79d13f889e8 100644
--- a/db/migrate/20190103160533_create_reviewables.rb
+++ b/db/migrate/20190103160533_create_reviewables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateReviewables < ActiveRecord::Migration[5.2]
def change
create_table :reviewables do |t|
diff --git a/db/migrate/20190103185626_create_reviewable_users.rb b/db/migrate/20190103185626_create_reviewable_users.rb
index 5b078027073..e1306be9fda 100644
--- a/db/migrate/20190103185626_create_reviewable_users.rb
+++ b/db/migrate/20190103185626_create_reviewable_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateReviewableUsers < ActiveRecord::Migration[5.2]
def up
# Create reviewables for approved users
diff --git a/db/migrate/20190106041015_add_topic_id_index_to_user_histories.rb b/db/migrate/20190106041015_add_topic_id_index_to_user_histories.rb
index 8172657fb10..d3b6d6366d2 100644
--- a/db/migrate/20190106041015_add_topic_id_index_to_user_histories.rb
+++ b/db/migrate/20190106041015_add_topic_id_index_to_user_histories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTopicIdIndexToUserHistories < ActiveRecord::Migration[5.2]
def change
add_index :user_histories, [:topic_id, :target_user_id, :action]
diff --git a/db/migrate/20190108110630_add_text_size_key_to_user_options.rb b/db/migrate/20190108110630_add_text_size_key_to_user_options.rb
index 61edee561e6..e6423102ed2 100644
--- a/db/migrate/20190108110630_add_text_size_key_to_user_options.rb
+++ b/db/migrate/20190108110630_add_text_size_key_to_user_options.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTextSizeKeyToUserOptions < ActiveRecord::Migration[5.2]
def change
add_column :user_options, :text_size_key, :integer, null: false, default: 0
diff --git a/db/migrate/20190110142917_enable_content_security_policy_for_new_sites.rb b/db/migrate/20190110142917_enable_content_security_policy_for_new_sites.rb
index abe55353a06..c5b8e11d813 100644
--- a/db/migrate/20190110142917_enable_content_security_policy_for_new_sites.rb
+++ b/db/migrate/20190110142917_enable_content_security_policy_for_new_sites.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnableContentSecurityPolicyForNewSites < ActiveRecord::Migration[5.2]
def up
return if Rails.env.test?
diff --git a/db/migrate/20190110201340_remove_google_plus_from_share_links_site_setting.rb b/db/migrate/20190110201340_remove_google_plus_from_share_links_site_setting.rb
index b6268b737a5..73246a4e971 100644
--- a/db/migrate/20190110201340_remove_google_plus_from_share_links_site_setting.rb
+++ b/db/migrate/20190110201340_remove_google_plus_from_share_links_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveGooglePlusFromShareLinksSiteSetting < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20190110212005_create_reviewable_histories.rb b/db/migrate/20190110212005_create_reviewable_histories.rb
index b3cdfcecb92..6bf9ae5b32b 100644
--- a/db/migrate/20190110212005_create_reviewable_histories.rb
+++ b/db/migrate/20190110212005_create_reviewable_histories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateReviewableHistories < ActiveRecord::Migration[5.2]
def change
create_table :reviewable_histories do |t|
diff --git a/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb b/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb
index b83b1166eb8..8569f61d0c8 100644
--- a/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb
+++ b/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateReviewableQueuedPosts < ActiveRecord::Migration[5.2]
def up
execute(<<~SQL)
diff --git a/db/migrate/20190117191606_create_group_requests.rb b/db/migrate/20190117191606_create_group_requests.rb
index 0453b99a219..0a288f08249 100644
--- a/db/migrate/20190117191606_create_group_requests.rb
+++ b/db/migrate/20190117191606_create_group_requests.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateGroupRequests < ActiveRecord::Migration[5.2]
def change
create_table :group_requests do |t|
diff --git a/db/migrate/20190121202656_remove_user_action_pending.rb b/db/migrate/20190121202656_remove_user_action_pending.rb
index f48e87e2ea5..8da24ac5c74 100644
--- a/db/migrate/20190121202656_remove_user_action_pending.rb
+++ b/db/migrate/20190121202656_remove_user_action_pending.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveUserActionPending < ActiveRecord::Migration[5.2]
def up
execute "DELETE FROM user_actions WHERE action_type = 14"
diff --git a/db/migrate/20190122132732_add_fields_to_remote_themes.rb b/db/migrate/20190122132732_add_fields_to_remote_themes.rb
index 8cd22f963a9..1d0400849ca 100644
--- a/db/migrate/20190122132732_add_fields_to_remote_themes.rb
+++ b/db/migrate/20190122132732_add_fields_to_remote_themes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFieldsToRemoteThemes < ActiveRecord::Migration[5.2]
def change
add_column :remote_themes, :authors, :string
diff --git a/db/migrate/20190125103246_copy_login_required_welcome_message.rb b/db/migrate/20190125103246_copy_login_required_welcome_message.rb
index 1d6c54a7f39..2f749c0904b 100644
--- a/db/migrate/20190125103246_copy_login_required_welcome_message.rb
+++ b/db/migrate/20190125103246_copy_login_required_welcome_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CopyLoginRequiredWelcomeMessage < ActiveRecord::Migration[5.2]
def change
execute <<~SQL
diff --git a/db/migrate/20190125153345_add_text_size_seq_to_user_option.rb b/db/migrate/20190125153345_add_text_size_seq_to_user_option.rb
index b1d0a4c4d98..69034f480d1 100644
--- a/db/migrate/20190125153345_add_text_size_seq_to_user_option.rb
+++ b/db/migrate/20190125153345_add_text_size_seq_to_user_option.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTextSizeSeqToUserOption < ActiveRecord::Migration[5.2]
def change
add_column :user_options, :text_size_seq, :integer, null: false, default: 0
diff --git a/db/migrate/20190130013015_add_index_on_user_id_to_single_sign_on_records.rb b/db/migrate/20190130013015_add_index_on_user_id_to_single_sign_on_records.rb
index 2eb26d5ca57..f7cf9dda296 100644
--- a/db/migrate/20190130013015_add_index_on_user_id_to_single_sign_on_records.rb
+++ b/db/migrate/20190130013015_add_index_on_user_id_to_single_sign_on_records.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexOnUserIdToSingleSignOnRecords < ActiveRecord::Migration[5.2]
def change
add_index :single_sign_on_records, :user_id
diff --git a/db/migrate/20190130163000_create_reviewable_scores.rb b/db/migrate/20190130163000_create_reviewable_scores.rb
index 2fa7a5a87b4..f30430e312f 100644
--- a/db/migrate/20190130163000_create_reviewable_scores.rb
+++ b/db/migrate/20190130163000_create_reviewable_scores.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateReviewableScores < ActiveRecord::Migration[5.2]
def change
create_table :reviewable_scores do |t|
diff --git a/db/migrate/20190130163001_migrate_reviewable_flagged_posts.rb b/db/migrate/20190130163001_migrate_reviewable_flagged_posts.rb
index c3b98b2dedd..a2c18668696 100644
--- a/db/migrate/20190130163001_migrate_reviewable_flagged_posts.rb
+++ b/db/migrate/20190130163001_migrate_reviewable_flagged_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateReviewableFlaggedPosts < ActiveRecord::Migration[5.2]
def up
diff --git a/db/migrate/20190215204033_add_score_bonus_to_post_action_types.rb b/db/migrate/20190215204033_add_score_bonus_to_post_action_types.rb
index 95bcfcf18fa..4a5400031be 100644
--- a/db/migrate/20190215204033_add_score_bonus_to_post_action_types.rb
+++ b/db/migrate/20190215204033_add_score_bonus_to_post_action_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddScoreBonusToPostActionTypes < ActiveRecord::Migration[5.2]
def change
add_column :post_action_types, :score_bonus, :float, default: 0.0, null: false
diff --git a/db/migrate/20190225133654_add_ignored_users_table.rb b/db/migrate/20190225133654_add_ignored_users_table.rb
index 9ae56155660..d2f164a984a 100644
--- a/db/migrate/20190225133654_add_ignored_users_table.rb
+++ b/db/migrate/20190225133654_add_ignored_users_table.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIgnoredUsersTable < ActiveRecord::Migration[5.2]
def change
create_table :ignored_users do |t|
diff --git a/db/migrate/20190227150413_migrate_instagram_user_info.rb b/db/migrate/20190227150413_migrate_instagram_user_info.rb
index bc87c018183..4ebd79d810e 100644
--- a/db/migrate/20190227150413_migrate_instagram_user_info.rb
+++ b/db/migrate/20190227150413_migrate_instagram_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateInstagramUserInfo < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb b/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb
index c47ff9295d5..1840b1ff07e 100644
--- a/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb
+++ b/db/migrate/20190227210035_add_missing_topic_id_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMissingTopicIdSiteSettings < ActiveRecord::Migration[5.2]
def up
# Welcome Topic
diff --git a/db/migrate/20190304170931_migrate_uncategorized_category_name.rb b/db/migrate/20190304170931_migrate_uncategorized_category_name.rb
index cb9e1546b63..376ea948a04 100644
--- a/db/migrate/20190304170931_migrate_uncategorized_category_name.rb
+++ b/db/migrate/20190304170931_migrate_uncategorized_category_name.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateUncategorizedCategoryName < ActiveRecord::Migration[5.2]
def change
execute <<~SQL
diff --git a/db/migrate/20190306154335_migrate_google_user_info.rb b/db/migrate/20190306154335_migrate_google_user_info.rb
index a3a9c0e1c37..d2636aabaf4 100644
--- a/db/migrate/20190306154335_migrate_google_user_info.rb
+++ b/db/migrate/20190306154335_migrate_google_user_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateGoogleUserInfo < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20190306184409_add_reviewable_score_to_topics.rb b/db/migrate/20190306184409_add_reviewable_score_to_topics.rb
index 474c1f1ad16..48889634a86 100644
--- a/db/migrate/20190306184409_add_reviewable_score_to_topics.rb
+++ b/db/migrate/20190306184409_add_reviewable_score_to_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReviewableScoreToTopics < ActiveRecord::Migration[5.2]
def up
add_column :topics, :reviewable_score, :float, null: false, default: 0
diff --git a/db/migrate/20190312181641_migrate_email_user_options.rb b/db/migrate/20190312181641_migrate_email_user_options.rb
index 05ed0c1489b..b8014b0ec26 100644
--- a/db/migrate/20190312181641_migrate_email_user_options.rb
+++ b/db/migrate/20190312181641_migrate_email_user_options.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateEmailUserOptions < ActiveRecord::Migration[5.2]
def up
# see UserOption.email_level_types
diff --git a/db/migrate/20190313134642_migrate_default_user_email_options.rb b/db/migrate/20190313134642_migrate_default_user_email_options.rb
index 974e146dee2..961789b92ae 100644
--- a/db/migrate/20190313134642_migrate_default_user_email_options.rb
+++ b/db/migrate/20190313134642_migrate_default_user_email_options.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateDefaultUserEmailOptions < ActiveRecord::Migration[5.2]
def up
# see UserOption.email_level_types
diff --git a/db/migrate/20190313171338_add_indexes_to_reviewables.rb b/db/migrate/20190313171338_add_indexes_to_reviewables.rb
index 3473c1957ec..245ad2a916f 100644
--- a/db/migrate/20190313171338_add_indexes_to_reviewables.rb
+++ b/db/migrate/20190313171338_add_indexes_to_reviewables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexesToReviewables < ActiveRecord::Migration[5.2]
def up
remove_index :reviewables, :status
diff --git a/db/migrate/20190313205652_rename_moderator_site_settings.rb b/db/migrate/20190313205652_rename_moderator_site_settings.rb
index ff0747c98de..c971bb0ba24 100644
--- a/db/migrate/20190313205652_rename_moderator_site_settings.rb
+++ b/db/migrate/20190313205652_rename_moderator_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameModeratorSiteSettings < ActiveRecord::Migration[5.2]
def up
execute "UPDATE site_settings SET name = 'moderators_view_emails' WHERE name = 'show_email_on_profile'"
diff --git a/db/migrate/20190314082018_add_search_priority_to_categories.rb b/db/migrate/20190314082018_add_search_priority_to_categories.rb
index af2c67365f8..81a8700370b 100644
--- a/db/migrate/20190314082018_add_search_priority_to_categories.rb
+++ b/db/migrate/20190314082018_add_search_priority_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSearchPriorityToCategories < ActiveRecord::Migration[5.2]
def change
add_column :categories, :search_priority, :integer, default: 0
diff --git a/db/migrate/20190314144755_add_summarized_at_column_to_ignored_users_table.rb b/db/migrate/20190314144755_add_summarized_at_column_to_ignored_users_table.rb
index 6acb32cd796..245f55dc14f 100644
--- a/db/migrate/20190314144755_add_summarized_at_column_to_ignored_users_table.rb
+++ b/db/migrate/20190314144755_add_summarized_at_column_to_ignored_users_table.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSummarizedAtColumnToIgnoredUsersTable < ActiveRecord::Migration[5.2]
def change
add_column :ignored_users, :summarized_at, :datetime
diff --git a/db/migrate/20190315025804_migrate_blank_override_for_upload_site_settings.rb b/db/migrate/20190315025804_migrate_blank_override_for_upload_site_settings.rb
index d0d3bc348d8..1e5a3c5e339 100644
--- a/db/migrate/20190315025804_migrate_blank_override_for_upload_site_settings.rb
+++ b/db/migrate/20190315025804_migrate_blank_override_for_upload_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateBlankOverrideForUploadSiteSettings < ActiveRecord::Migration[5.2]
def up
{
diff --git a/db/migrate/20190315055432_migrate_null_override_for_upload_site_settings.rb b/db/migrate/20190315055432_migrate_null_override_for_upload_site_settings.rb
index bbc47802a60..f47b35276f5 100644
--- a/db/migrate/20190315055432_migrate_null_override_for_upload_site_settings.rb
+++ b/db/migrate/20190315055432_migrate_null_override_for_upload_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateNullOverrideForUploadSiteSettings < ActiveRecord::Migration[5.2]
def up
{
diff --git a/db/migrate/20190315170411_add_index_to_reviewable_histories.rb b/db/migrate/20190315170411_add_index_to_reviewable_histories.rb
index 6953eaefbc7..e5f5d8d29f7 100644
--- a/db/migrate/20190315170411_add_index_to_reviewable_histories.rb
+++ b/db/migrate/20190315170411_add_index_to_reviewable_histories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexToReviewableHistories < ActiveRecord::Migration[5.2]
def change
add_index :reviewable_histories, :created_by_id
diff --git a/db/migrate/20190315174428_migrate_flag_history.rb b/db/migrate/20190315174428_migrate_flag_history.rb
index 37fc7a5cd35..dbeefd3c111 100644
--- a/db/migrate/20190315174428_migrate_flag_history.rb
+++ b/db/migrate/20190315174428_migrate_flag_history.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateFlagHistory < ActiveRecord::Migration[5.2]
def up
diff --git a/db/migrate/20190320091323_add_index_post_action_type_id_disagreed_at_on_post_actions.rb b/db/migrate/20190320091323_add_index_post_action_type_id_disagreed_at_on_post_actions.rb
index 6b23f10974c..6e4344236f1 100644
--- a/db/migrate/20190320091323_add_index_post_action_type_id_disagreed_at_on_post_actions.rb
+++ b/db/migrate/20190320091323_add_index_post_action_type_id_disagreed_at_on_post_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexPostActionTypeIdDisagreedAtOnPostActions < ActiveRecord::Migration[5.2]
def change
add_index :post_actions, [:post_action_type_id, :disagreed_at],
diff --git a/db/migrate/20190320104640_remove_s3_force_path_style.rb b/db/migrate/20190320104640_remove_s3_force_path_style.rb
index 81b33447e62..266b46096bf 100644
--- a/db/migrate/20190320104640_remove_s3_force_path_style.rb
+++ b/db/migrate/20190320104640_remove_s3_force_path_style.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveS3ForcePathStyle < ActiveRecord::Migration[5.2]
def up
execute "DELETE FROM site_settings WHERE name = 's3_force_path_style'"
diff --git a/db/migrate/20190321072029_add_index_method_enabled_on_user_second_factors.rb b/db/migrate/20190321072029_add_index_method_enabled_on_user_second_factors.rb
index 72242258a9c..2f915d0c101 100644
--- a/db/migrate/20190321072029_add_index_method_enabled_on_user_second_factors.rb
+++ b/db/migrate/20190321072029_add_index_method_enabled_on_user_second_factors.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexMethodEnabledOnUserSecondFactors < ActiveRecord::Migration[5.2]
def change
add_index :user_second_factors, [:method, :enabled]
diff --git a/db/migrate/20190322152347_force_rebake_on_posts_with_lightboxes.rb b/db/migrate/20190322152347_force_rebake_on_posts_with_lightboxes.rb
index c87ce20bbd8..22210fa1a5d 100644
--- a/db/migrate/20190322152347_force_rebake_on_posts_with_lightboxes.rb
+++ b/db/migrate/20190322152347_force_rebake_on_posts_with_lightboxes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ForceRebakeOnPostsWithLightboxes < ActiveRecord::Migration[5.2]
def up
# Picking up changes to lightbox HTML in cooked_post_processor
diff --git a/db/migrate/20190325162154_make_site_settings_unique.rb b/db/migrate/20190325162154_make_site_settings_unique.rb
index 27baec0055d..927bb940cc8 100644
--- a/db/migrate/20190325162154_make_site_settings_unique.rb
+++ b/db/migrate/20190325162154_make_site_settings_unique.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MakeSiteSettingsUnique < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
diff --git a/db/migrate/20190326123708_add_index_created_at_on_search_logs.rb b/db/migrate/20190326123708_add_index_created_at_on_search_logs.rb
index a70d76a18ca..8cd1dfc93f8 100644
--- a/db/migrate/20190326123708_add_index_created_at_on_search_logs.rb
+++ b/db/migrate/20190326123708_add_index_created_at_on_search_logs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexCreatedAtOnSearchLogs < ActiveRecord::Migration[5.2]
def change
add_index :search_logs, :created_at
diff --git a/db/migrate/20190327090918_add_expiring_at_column_to_ignored_users_table.rb b/db/migrate/20190327090918_add_expiring_at_column_to_ignored_users_table.rb
index d6b91ce1013..8baae0b44ff 100644
--- a/db/migrate/20190327090918_add_expiring_at_column_to_ignored_users_table.rb
+++ b/db/migrate/20190327090918_add_expiring_at_column_to_ignored_users_table.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddExpiringAtColumnToIgnoredUsersTable < ActiveRecord::Migration[5.2]
def change
add_column :ignored_users, :expiring_at, :datetime
diff --git a/db/migrate/20190327205525_require_reviewable_scores.rb b/db/migrate/20190327205525_require_reviewable_scores.rb
index 217661eda10..916aed09398 100644
--- a/db/migrate/20190327205525_require_reviewable_scores.rb
+++ b/db/migrate/20190327205525_require_reviewable_scores.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RequireReviewableScores < ActiveRecord::Migration[5.2]
def up
min_score = DB.query_single("SELECT value FROM site_settings WHERE name = 'min_score_default_visibility'")[0].to_f
diff --git a/db/migrate/20190402024053_add_first_unread_at_to_user_stats.rb b/db/migrate/20190402024053_add_first_unread_at_to_user_stats.rb
index 1d2eb432f12..df0631443d4 100644
--- a/db/migrate/20190402024053_add_first_unread_at_to_user_stats.rb
+++ b/db/migrate/20190402024053_add_first_unread_at_to_user_stats.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddFirstUnreadAtToUserStats < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
diff --git a/db/migrate/20190402142223_disable_invite_only_sso.rb b/db/migrate/20190402142223_disable_invite_only_sso.rb
index abeab5cb4bd..a33e200e16e 100644
--- a/db/migrate/20190402142223_disable_invite_only_sso.rb
+++ b/db/migrate/20190402142223_disable_invite_only_sso.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DisableInviteOnlySso < ActiveRecord::Migration[5.2]
def up
execute(<<~SQL)
diff --git a/db/migrate/20190403180142_add_allow_global_tags_to_categories.rb b/db/migrate/20190403180142_add_allow_global_tags_to_categories.rb
index 3ab37e74829..a8f10bae3e8 100644
--- a/db/migrate/20190403180142_add_allow_global_tags_to_categories.rb
+++ b/db/migrate/20190403180142_add_allow_global_tags_to_categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddAllowGlobalTagsToCategories < ActiveRecord::Migration[5.2]
def change
add_column :categories, :allow_global_tags, :boolean, default: false, null: false
diff --git a/db/migrate/20190403202001_fix_reviewable_users.rb b/db/migrate/20190403202001_fix_reviewable_users.rb
index eb953264949..611e432f71a 100644
--- a/db/migrate/20190403202001_fix_reviewable_users.rb
+++ b/db/migrate/20190403202001_fix_reviewable_users.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FixReviewableUsers < ActiveRecord::Migration[5.2]
def up
execute(<<~SQL)
diff --git a/db/migrate/20190405044140_add_index_action_type_created_at_on_user_actions.rb b/db/migrate/20190405044140_add_index_action_type_created_at_on_user_actions.rb
index b0d8be1adc8..c04f43dbec3 100644
--- a/db/migrate/20190405044140_add_index_action_type_created_at_on_user_actions.rb
+++ b/db/migrate/20190405044140_add_index_action_type_created_at_on_user_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexActionTypeCreatedAtOnUserActions < ActiveRecord::Migration[5.2]
def change
add_index :user_actions, [:action_type, :created_at]
diff --git a/db/migrate/20190408072550_add_index_id_baked_version_on_posts.rb b/db/migrate/20190408072550_add_index_id_baked_version_on_posts.rb
index 5bcb2be5371..6035119b47c 100644
--- a/db/migrate/20190408072550_add_index_id_baked_version_on_posts.rb
+++ b/db/migrate/20190408072550_add_index_id_baked_version_on_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexIdBakedVersionOnPosts < ActiveRecord::Migration[5.2]
def change
add_index :posts, [:id, :baked_version],
diff --git a/db/migrate/20190408082101_add_search_data_indexes.rb b/db/migrate/20190408082101_add_search_data_indexes.rb
index c8c56c2b9fd..bb20a59530d 100644
--- a/db/migrate/20190408082101_add_search_data_indexes.rb
+++ b/db/migrate/20190408082101_add_search_data_indexes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddSearchDataIndexes < ActiveRecord::Migration[5.2]
def change
add_index :topic_search_data, [:topic_id, :version, :locale]
diff --git a/db/migrate/20190409054736_add_index_for_rebake_old_on_posts.rb b/db/migrate/20190409054736_add_index_for_rebake_old_on_posts.rb
index 05746115e5c..900ea7de38f 100644
--- a/db/migrate/20190409054736_add_index_for_rebake_old_on_posts.rb
+++ b/db/migrate/20190409054736_add_index_for_rebake_old_on_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexForRebakeOldOnPosts < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
diff --git a/db/migrate/20190410055459_add_index_reply_id_on_post_replies.rb b/db/migrate/20190410055459_add_index_reply_id_on_post_replies.rb
index 0577049d4bc..343ae5b376d 100644
--- a/db/migrate/20190410055459_add_index_reply_id_on_post_replies.rb
+++ b/db/migrate/20190410055459_add_index_reply_id_on_post_replies.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexReplyIdOnPostReplies < ActiveRecord::Migration[5.2]
def change
add_index :post_replies, :reply_id
diff --git a/db/migrate/20190410102915_remove_ignore_user_enabled_site_setting.rb b/db/migrate/20190410102915_remove_ignore_user_enabled_site_setting.rb
index 126a7d15a8a..6c255cdc56d 100644
--- a/db/migrate/20190410102915_remove_ignore_user_enabled_site_setting.rb
+++ b/db/migrate/20190410102915_remove_ignore_user_enabled_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RemoveIgnoreUserEnabledSiteSetting < ActiveRecord::Migration[5.2]
def up
execute "DELETE FROM site_settings WHERE name = 'ignore_user_enabled'"
diff --git a/db/migrate/20190410122835_add_missing_uploads_index_to_post_custom_fields.rb b/db/migrate/20190410122835_add_missing_uploads_index_to_post_custom_fields.rb
index 7cca4548ba4..1377a013b9f 100644
--- a/db/migrate/20190410122835_add_missing_uploads_index_to_post_custom_fields.rb
+++ b/db/migrate/20190410122835_add_missing_uploads_index_to_post_custom_fields.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMissingUploadsIndexToPostCustomFields < ActiveRecord::Migration[5.2]
def change
add_index :post_custom_fields, :post_id, unique: true, where: "name = 'missing uploads'"
diff --git a/db/migrate/20190411121312_add_title_count_mode_to_user_options.rb b/db/migrate/20190411121312_add_title_count_mode_to_user_options.rb
index afc1106a8df..4b9ba9b3c14 100644
--- a/db/migrate/20190411121312_add_title_count_mode_to_user_options.rb
+++ b/db/migrate/20190411121312_add_title_count_mode_to_user_options.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddTitleCountModeToUserOptions < ActiveRecord::Migration[5.2]
def change
add_column :user_options, :title_count_mode_key, :integer, null: false, default: 0
diff --git a/db/migrate/20190411144545_add_reason_to_reviewable_scores.rb b/db/migrate/20190411144545_add_reason_to_reviewable_scores.rb
index a6105c6b271..936470e3aa9 100644
--- a/db/migrate/20190411144545_add_reason_to_reviewable_scores.rb
+++ b/db/migrate/20190411144545_add_reason_to_reviewable_scores.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReasonToReviewableScores < ActiveRecord::Migration[5.2]
def change
add_column :reviewable_scores, :reason, :string
diff --git a/db/migrate/20190412161430_add_created_by_index_to_reviewables.rb b/db/migrate/20190412161430_add_created_by_index_to_reviewables.rb
index 243a0a1f3c1..02187168b8e 100644
--- a/db/migrate/20190412161430_add_created_by_index_to_reviewables.rb
+++ b/db/migrate/20190412161430_add_created_by_index_to_reviewables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddCreatedByIndexToReviewables < ActiveRecord::Migration[5.2]
def change
add_index :reviewables, [:topic_id, :status, :created_by_id]
diff --git a/db/migrate/20190414162753_rename_post_notices.rb b/db/migrate/20190414162753_rename_post_notices.rb
index 63ab83632e8..997fb5f9071 100644
--- a/db/migrate/20190414162753_rename_post_notices.rb
+++ b/db/migrate/20190414162753_rename_post_notices.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenamePostNotices < ActiveRecord::Migration[5.2]
def up
add_index :post_custom_fields, :post_id, unique: true, name: "index_post_custom_fields_on_notice_type", where: "name = 'notice_type'"
diff --git a/db/migrate/20190417135049_migrate_native_app_banner_site_setting.rb b/db/migrate/20190417135049_migrate_native_app_banner_site_setting.rb
index 57423a7be97..bda337437e7 100644
--- a/db/migrate/20190417135049_migrate_native_app_banner_site_setting.rb
+++ b/db/migrate/20190417135049_migrate_native_app_banner_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateNativeAppBannerSiteSetting < ActiveRecord::Migration[5.2]
def up
execute "INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
diff --git a/db/migrate/20190417203622_add_review_group_to_category.rb b/db/migrate/20190417203622_add_review_group_to_category.rb
index 7dc6626336d..6d6093dede6 100644
--- a/db/migrate/20190417203622_add_review_group_to_category.rb
+++ b/db/migrate/20190417203622_add_review_group_to_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddReviewGroupToCategory < ActiveRecord::Migration[5.2]
def change
add_column :categories, :reviewable_by_group_id, :integer, null: true
diff --git a/db/migrate/20190418113814_add_unique_index_to_group_requests.rb b/db/migrate/20190418113814_add_unique_index_to_group_requests.rb
index 194777d6af1..54b0e85c660 100644
--- a/db/migrate/20190418113814_add_unique_index_to_group_requests.rb
+++ b/db/migrate/20190418113814_add_unique_index_to_group_requests.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddUniqueIndexToGroupRequests < ActiveRecord::Migration[5.2]
def change
execute "DELETE FROM group_requests WHERE id NOT IN (SELECT MIN(id) FROM group_requests GROUP BY group_id, user_id)"
diff --git a/db/migrate/20190423112954_increase_theme_field_name_length.rb b/db/migrate/20190423112954_increase_theme_field_name_length.rb
index 52f3b2c1ff3..5de853b8baf 100644
--- a/db/migrate/20190423112954_increase_theme_field_name_length.rb
+++ b/db/migrate/20190423112954_increase_theme_field_name_length.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IncreaseThemeFieldNameLength < ActiveRecord::Migration[5.2]
def change
change_column :theme_fields, :name, :string, limit: 255
diff --git a/db/migrate/20190424065841_add_post_image_indexes.rb b/db/migrate/20190424065841_add_post_image_indexes.rb
index eb1e4aa07a8..496358bd459 100644
--- a/db/migrate/20190424065841_add_post_image_indexes.rb
+++ b/db/migrate/20190424065841_add_post_image_indexes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddPostImageIndexes < ActiveRecord::Migration[5.2]
def change
diff --git a/db/migrate/20190426074404_add_missing_user_destroyer_indexes.rb b/db/migrate/20190426074404_add_missing_user_destroyer_indexes.rb
index 864697dd82a..9ef1e93ae37 100644
--- a/db/migrate/20190426074404_add_missing_user_destroyer_indexes.rb
+++ b/db/migrate/20190426074404_add_missing_user_destroyer_indexes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddMissingUserDestroyerIndexes < ActiveRecord::Migration[5.2]
def change
# these indexes are required to make deletions of users fast
diff --git a/db/migrate/20190426123026_add_incoming_email_by_user_id_index.rb b/db/migrate/20190426123026_add_incoming_email_by_user_id_index.rb
index c870924abda..ecbe8381a91 100644
--- a/db/migrate/20190426123026_add_incoming_email_by_user_id_index.rb
+++ b/db/migrate/20190426123026_add_incoming_email_by_user_id_index.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIncomingEmailByUserIdIndex < ActiveRecord::Migration[5.2]
def change
add_index :incoming_emails, [:user_id], where: 'user_id IS NOT NULL'
diff --git a/db/migrate/20190426123658_add_index_on_user_auth_token_user.rb b/db/migrate/20190426123658_add_index_on_user_auth_token_user.rb
index 7f0a0501a0d..daf282b341a 100644
--- a/db/migrate/20190426123658_add_index_on_user_auth_token_user.rb
+++ b/db/migrate/20190426123658_add_index_on_user_auth_token_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AddIndexOnUserAuthTokenUser < ActiveRecord::Migration[5.2]
def change
add_index :user_auth_tokens, [:user_id]
diff --git a/db/post_migrate/20180917024729_remove_superfluous_columns.rb b/db/post_migrate/20180917024729_remove_superfluous_columns.rb
index 3b7d915e19d..128c3e810ef 100644
--- a/db/post_migrate/20180917024729_remove_superfluous_columns.rb
+++ b/db/post_migrate/20180917024729_remove_superfluous_columns.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'migration/column_dropper'
require 'badge_posts_view_manager'
diff --git a/db/post_migrate/20180917034056_remove_superfluous_tables.rb b/db/post_migrate/20180917034056_remove_superfluous_tables.rb
index 0c713b3a5c8..21cba12ec4e 100644
--- a/db/post_migrate/20180917034056_remove_superfluous_tables.rb
+++ b/db/post_migrate/20180917034056_remove_superfluous_tables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'migration/table_dropper'
class RemoveSuperfluousTables < ActiveRecord::Migration[5.2]
diff --git a/db/post_migrate/20181012123001_drop_group_locked_trust_level_from_user.rb b/db/post_migrate/20181012123001_drop_group_locked_trust_level_from_user.rb
index 1db54582345..b1ec42c26b9 100644
--- a/db/post_migrate/20181012123001_drop_group_locked_trust_level_from_user.rb
+++ b/db/post_migrate/20181012123001_drop_group_locked_trust_level_from_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'migration/column_dropper'
class DropGroupLockedTrustLevelFromUser < ActiveRecord::Migration[5.2]
diff --git a/db/post_migrate/20181112013117_migrate_url_site_settings.rb b/db/post_migrate/20181112013117_migrate_url_site_settings.rb
index 127fcc0665d..def8f2b45f7 100644
--- a/db/post_migrate/20181112013117_migrate_url_site_settings.rb
+++ b/db/post_migrate/20181112013117_migrate_url_site_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigrateUrlSiteSettings < ActiveRecord::Migration[5.2]
def change
# Do nothing, the migration was moved into a onceoff job
diff --git a/db/post_migrate/20190103065652_remove_uploaded_meta_id_from_category.rb b/db/post_migrate/20190103065652_remove_uploaded_meta_id_from_category.rb
index 997ae5e5805..484a31c6c41 100644
--- a/db/post_migrate/20190103065652_remove_uploaded_meta_id_from_category.rb
+++ b/db/post_migrate/20190103065652_remove_uploaded_meta_id_from_category.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'migration/column_dropper'
class RemoveUploadedMetaIdFromCategory < ActiveRecord::Migration[5.2]
diff --git a/db/post_migrate/20190121203023_drop_queued_post_id_from_user_actions.rb b/db/post_migrate/20190121203023_drop_queued_post_id_from_user_actions.rb
index 2d504d5401c..0a1f2b6c76f 100644
--- a/db/post_migrate/20190121203023_drop_queued_post_id_from_user_actions.rb
+++ b/db/post_migrate/20190121203023_drop_queued_post_id_from_user_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DropQueuedPostIdFromUserActions < ActiveRecord::Migration[5.2]
def up
remove_column :user_actions, :queued_post_id
diff --git a/db/post_migrate/20190123171817_drop_queued_posts.rb b/db/post_migrate/20190123171817_drop_queued_posts.rb
index 6f58fa63a48..704b98428e2 100644
--- a/db/post_migrate/20190123171817_drop_queued_posts.rb
+++ b/db/post_migrate/20190123171817_drop_queued_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DropQueuedPosts < ActiveRecord::Migration[5.2]
def up
drop_table :queued_posts
diff --git a/db/post_migrate/20190205104116_drop_unused_auth_tables.rb b/db/post_migrate/20190205104116_drop_unused_auth_tables.rb
index ebd7feacbc2..99fa6f75850 100644
--- a/db/post_migrate/20190205104116_drop_unused_auth_tables.rb
+++ b/db/post_migrate/20190205104116_drop_unused_auth_tables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'migration/table_dropper'
class DropUnusedAuthTables < ActiveRecord::Migration[5.2]
diff --git a/db/post_migrate/20190208144706_drop_unused_auth_tables_again.rb b/db/post_migrate/20190208144706_drop_unused_auth_tables_again.rb
index bd67293e9ad..c82137c9e66 100644
--- a/db/post_migrate/20190208144706_drop_unused_auth_tables_again.rb
+++ b/db/post_migrate/20190208144706_drop_unused_auth_tables_again.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'migration/table_dropper'
class DropUnusedAuthTablesAgain < ActiveRecord::Migration[5.2]
diff --git a/db/post_migrate/20190312194528_drop_email_user_options_columns.rb b/db/post_migrate/20190312194528_drop_email_user_options_columns.rb
index bc901c40fc6..bb9ec958c1a 100644
--- a/db/post_migrate/20190312194528_drop_email_user_options_columns.rb
+++ b/db/post_migrate/20190312194528_drop_email_user_options_columns.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'migration/column_dropper'
class DropEmailUserOptionsColumns < ActiveRecord::Migration[5.2]
diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb
index 186b342814a..7094eb5053b 100644
--- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb
+++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'active_record/connection_adapters/abstract_adapter'
require 'active_record/connection_adapters/postgresql_adapter'
require 'discourse'
diff --git a/lib/admin_confirmation.rb b/lib/admin_confirmation.rb
index cb756750525..d21b8aaac95 100644
--- a/lib/admin_confirmation.rb
+++ b/lib/admin_confirmation.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AdminConfirmation
attr_accessor :token
attr_reader :performed_by
diff --git a/lib/admin_constraint.rb b/lib/admin_constraint.rb
index c14e0aa16b8..f7077b7e7dd 100644
--- a/lib/admin_constraint.rb
+++ b/lib/admin_constraint.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'current_user'
class AdminConstraint
diff --git a/lib/age_words.rb b/lib/age_words.rb
index 92587ec30f4..814cc219e56 100644
--- a/lib/age_words.rb
+++ b/lib/age_words.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module AgeWords
def self.age_words(secs)
diff --git a/lib/archetype.rb b/lib/archetype.rb
index 8c8f3591ae6..e3fc8e53540 100644
--- a/lib/archetype.rb
+++ b/lib/archetype.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Archetype
include ActiveModel::Serialization
diff --git a/lib/auth.rb b/lib/auth.rb
index 0e2ace56036..2c4594de9d5 100644
--- a/lib/auth.rb
+++ b/lib/auth.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Auth; end
require_dependency 'auth/auth_provider'
diff --git a/lib/auth/auth_provider.rb b/lib/auth/auth_provider.rb
index 853d2fbfb46..138bbea1934 100644
--- a/lib/auth/auth_provider.rb
+++ b/lib/auth/auth_provider.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::AuthProvider
include ActiveModel::Serialization
diff --git a/lib/auth/authenticator.rb b/lib/auth/authenticator.rb
index b5d795662cc..b306b2c206d 100644
--- a/lib/auth/authenticator.rb
+++ b/lib/auth/authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# this class is used by the user and omniauth controllers, it controls how
# an authentication system interacts with our database and middleware
diff --git a/lib/auth/current_user_provider.rb b/lib/auth/current_user_provider.rb
index f03a1135cb9..479a44d57d1 100644
--- a/lib/auth/current_user_provider.rb
+++ b/lib/auth/current_user_provider.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Auth; end
class Auth::CurrentUserProvider
diff --git a/lib/auth/facebook_authenticator.rb b/lib/auth/facebook_authenticator.rb
index a8c2ffff911..a92aefb97f0 100644
--- a/lib/auth/facebook_authenticator.rb
+++ b/lib/auth/facebook_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::FacebookAuthenticator < Auth::ManagedAuthenticator
AVATAR_SIZE ||= 480
diff --git a/lib/auth/github_authenticator.rb b/lib/auth/github_authenticator.rb
index 4e352ef430a..b59030fe06e 100644
--- a/lib/auth/github_authenticator.rb
+++ b/lib/auth/github_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'has_errors'
class Auth::GithubAuthenticator < Auth::Authenticator
diff --git a/lib/auth/google_oauth2_authenticator.rb b/lib/auth/google_oauth2_authenticator.rb
index 118d0812af5..fd401a87b66 100644
--- a/lib/auth/google_oauth2_authenticator.rb
+++ b/lib/auth/google_oauth2_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::GoogleOAuth2Authenticator < Auth::ManagedAuthenticator
def name
"google_oauth2"
diff --git a/lib/auth/instagram_authenticator.rb b/lib/auth/instagram_authenticator.rb
index 5ecb3a14884..b9ba5e8940e 100644
--- a/lib/auth/instagram_authenticator.rb
+++ b/lib/auth/instagram_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::InstagramAuthenticator < Auth::ManagedAuthenticator
def name
"instagram"
diff --git a/lib/auth/managed_authenticator.rb b/lib/auth/managed_authenticator.rb
index 12c9b8d2d2d..b47e7e17d66 100644
--- a/lib/auth/managed_authenticator.rb
+++ b/lib/auth/managed_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::ManagedAuthenticator < Auth::Authenticator
def description_for_user(user)
info = UserAssociatedAccount.find_by(provider_name: name, user_id: user.id)&.info
diff --git a/lib/auth/oauth2_authenticator.rb b/lib/auth/oauth2_authenticator.rb
index e5288c29df2..cff6d0c6e46 100644
--- a/lib/auth/oauth2_authenticator.rb
+++ b/lib/auth/oauth2_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::OAuth2Authenticator < Auth::Authenticator
def name
diff --git a/lib/auth/open_id_authenticator.rb b/lib/auth/open_id_authenticator.rb
index 7cd54a77316..403ac1936bb 100644
--- a/lib/auth/open_id_authenticator.rb
+++ b/lib/auth/open_id_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::OpenIdAuthenticator < Auth::Authenticator
attr_reader :name, :identifier
diff --git a/lib/auth/result.rb b/lib/auth/result.rb
index 47d7005c224..7b9f9f8d1b7 100644
--- a/lib/auth/result.rb
+++ b/lib/auth/result.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::Result
attr_accessor :user, :name, :username, :email, :user,
:email_valid, :extra_data, :awaiting_activation,
diff --git a/lib/auth/twitter_authenticator.rb b/lib/auth/twitter_authenticator.rb
index 06b4ee14b12..cf61591bcd8 100644
--- a/lib/auth/twitter_authenticator.rb
+++ b/lib/auth/twitter_authenticator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Auth::TwitterAuthenticator < Auth::ManagedAuthenticator
def name
"twitter"
diff --git a/lib/autospec/base_runner.rb b/lib/autospec/base_runner.rb
index 30bd513a714..bc78371f5c3 100644
--- a/lib/autospec/base_runner.rb
+++ b/lib/autospec/base_runner.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Autospec
class BaseRunner
diff --git a/lib/autospec/formatter.rb b/lib/autospec/formatter.rb
index 51ac6fd4b91..c923e558b6f 100644
--- a/lib/autospec/formatter.rb
+++ b/lib/autospec/formatter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rspec/core/formatters/base_text_formatter"
require "parallel_tests/rspec/logger_base"
diff --git a/lib/autospec/manager.rb b/lib/autospec/manager.rb
index b570bfafbe6..6c3e88a9510 100644
--- a/lib/autospec/manager.rb
+++ b/lib/autospec/manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "listen"
require "thread"
require "fileutils"
@@ -222,7 +224,7 @@ class Autospec::Manager
server.start do |line|
file, line = line.split(' ')
file = reverse_symlink(file)
- file = file.sub(Rails.root.to_s << "/", "")
+ file = file.sub(Rails.root.to_s + "/", "")
# process_change can aquire a mutex and block
# the acceptor
Thread.new do
diff --git a/lib/autospec/qunit_runner.rb b/lib/autospec/qunit_runner.rb
index 7df2f5ac65f..e2960bcfb6f 100644
--- a/lib/autospec/qunit_runner.rb
+++ b/lib/autospec/qunit_runner.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "demon/rails_autospec"
module Autospec
diff --git a/lib/autospec/reload_css.rb b/lib/autospec/reload_css.rb
index 379058666cd..0e9da1da35b 100644
--- a/lib/autospec/reload_css.rb
+++ b/lib/autospec/reload_css.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Autospec; end
class Autospec::ReloadCss
diff --git a/lib/autospec/rspec_runner.rb b/lib/autospec/rspec_runner.rb
index 64cb0302080..b4ebbf3ca2f 100644
--- a/lib/autospec/rspec_runner.rb
+++ b/lib/autospec/rspec_runner.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Autospec
class RspecRunner < BaseRunner
diff --git a/lib/autospec/simple_runner.rb b/lib/autospec/simple_runner.rb
index f8001b9621e..3cea5302546 100644
--- a/lib/autospec/simple_runner.rb
+++ b/lib/autospec/simple_runner.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "autospec/rspec_runner"
module Autospec
@@ -8,7 +10,7 @@ module Autospec
end
def run(specs)
- puts "Running Rspec: " << specs
+ puts "Running Rspec: #{specs}"
# kill previous rspec instance
@mutex.synchronize do
self.abort
diff --git a/lib/avatar_lookup.rb b/lib/avatar_lookup.rb
index 8bfcd78fbe1..535c64ebf2a 100644
--- a/lib/avatar_lookup.rb
+++ b/lib/avatar_lookup.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AvatarLookup
def initialize(user_ids = [])
diff --git a/lib/backup_restore/backup_restore.rb b/lib/backup_restore/backup_restore.rb
index 8e69ed997a5..81b05196b35 100644
--- a/lib/backup_restore/backup_restore.rb
+++ b/lib/backup_restore/backup_restore.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "backup_restore/backuper"
require_dependency "backup_restore/restorer"
diff --git a/lib/backup_restore/backup_store.rb b/lib/backup_restore/backup_store.rb
index e9c6340e645..45da21d643d 100644
--- a/lib/backup_restore/backup_store.rb
+++ b/lib/backup_restore/backup_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module BackupRestore
# @abstract
class BackupStore
diff --git a/lib/backup_restore/backuper.rb b/lib/backup_restore/backuper.rb
index 758a09bb015..51a12410c0a 100644
--- a/lib/backup_restore/backuper.rb
+++ b/lib/backup_restore/backuper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mini_mime"
module BackupRestore
diff --git a/lib/backup_restore/local_backup_store.rb b/lib/backup_restore/local_backup_store.rb
index b80b3fb031e..5717329e425 100644
--- a/lib/backup_restore/local_backup_store.rb
+++ b/lib/backup_restore/local_backup_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "backup_restore/backup_store"
require_dependency "disk_space"
diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb
index 781f7f7898a..b7f7cdd1e30 100644
--- a/lib/backup_restore/restorer.rb
+++ b/lib/backup_restore/restorer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "db_helper"
module BackupRestore
diff --git a/lib/backup_restore/s3_backup_store.rb b/lib/backup_restore/s3_backup_store.rb
index 84dad56ec67..4504314fa64 100644
--- a/lib/backup_restore/s3_backup_store.rb
+++ b/lib/backup_restore/s3_backup_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "backup_restore/backup_store"
require_dependency "s3_helper"
diff --git a/lib/badge_posts_view_manager.rb b/lib/badge_posts_view_manager.rb
index 8ec2138f9fd..52ef2084c33 100644
--- a/lib/badge_posts_view_manager.rb
+++ b/lib/badge_posts_view_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class BadgePostsViewManager
VIEW_NAME = "badge_posts".freeze
diff --git a/lib/badge_queries.rb b/lib/badge_queries.rb
index 1a8faf597e3..e71ff8d72e5 100644
--- a/lib/badge_queries.rb
+++ b/lib/badge_queries.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module BadgeQueries
Reader = < 0 && SiteSetting.port.to_i != default_port
if Rails.env.development? && SiteSetting.port.blank?
@@ -285,7 +287,7 @@ module Discourse
return unless uri
- path = uri.path || ""
+ path = +(uri.path || "")
if !uri.host || (uri.host == Discourse.current_hostname && path.start_with?(Discourse.base_uri))
path.slice!(Discourse.base_uri)
return Rails.application.routes.recognize_path(path)
@@ -302,9 +304,9 @@ module Discourse
end
READONLY_MODE_KEY_TTL ||= 60
- READONLY_MODE_KEY ||= 'readonly_mode'.freeze
- PG_READONLY_MODE_KEY ||= 'readonly_mode:postgres'.freeze
- USER_READONLY_MODE_KEY ||= 'readonly_mode:user'.freeze
+ READONLY_MODE_KEY ||= 'readonly_mode'
+ PG_READONLY_MODE_KEY ||= 'readonly_mode:postgres'
+ USER_READONLY_MODE_KEY ||= 'readonly_mode:user'
READONLY_KEYS ||= [
READONLY_MODE_KEY,
diff --git a/lib/discourse_cookie_store.rb b/lib/discourse_cookie_store.rb
index 2dbd56792f0..91a32f4545a 100644
--- a/lib/discourse_cookie_store.rb
+++ b/lib/discourse_cookie_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ActionDispatch::Session::DiscourseCookieStore < ActionDispatch::Session::CookieStore
def initialize(app, options = {})
super(app, options)
diff --git a/lib/discourse_diff.rb b/lib/discourse_diff.rb
index 89d293e4319..8126b87b37e 100644
--- a/lib/discourse_diff.rb
+++ b/lib/discourse_diff.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "onpdiff"
class DiscourseDiff
diff --git a/lib/discourse_event.rb b/lib/discourse_event.rb
index c61a70b031e..c44307157cd 100644
--- a/lib/discourse_event.rb
+++ b/lib/discourse_event.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This is meant to be used by plugins to trigger and listen to events
# So we can execute code when things happen.
class DiscourseEvent
diff --git a/lib/discourse_hub.rb b/lib/discourse_hub.rb
index 6e3ea6cae30..cf42009b3f8 100644
--- a/lib/discourse_hub.rb
+++ b/lib/discourse_hub.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'version'
require_dependency 'site_setting'
diff --git a/lib/discourse_iife.rb b/lib/discourse_iife.rb
index 4810aae4c31..946aa2f59f9 100644
--- a/lib/discourse_iife.rb
+++ b/lib/discourse_iife.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiscourseIIFE
def initialize(options = {}, &block)
end
diff --git a/lib/discourse_logstash_logger.rb b/lib/discourse_logstash_logger.rb
index 32376b49600..301354e991f 100644
--- a/lib/discourse_logstash_logger.rb
+++ b/lib/discourse_logstash_logger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'logstash-logger'
class DiscourseLogstashLogger
diff --git a/lib/discourse_plugin.rb b/lib/discourse_plugin.rb
index b2488af93c4..990df5b4e05 100644
--- a/lib/discourse_plugin.rb
+++ b/lib/discourse_plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# A basic plugin for Discourse. Meant to be extended and filled in.
# Most work is delegated to a registry.
diff --git a/lib/discourse_plugin_registry.rb b/lib/discourse_plugin_registry.rb
index ab0db1a0927..a8cefe0ae9d 100644
--- a/lib/discourse_plugin_registry.rb
+++ b/lib/discourse_plugin_registry.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# A class that handles interaction between a plugin and the Discourse App.
#
diff --git a/lib/discourse_redis.rb b/lib/discourse_redis.rb
index f0e8df2dc1a..85aa7077b51 100644
--- a/lib/discourse_redis.rb
+++ b/lib/discourse_redis.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# A wrapper around redis that namespaces keys with the current site id
#
diff --git a/lib/discourse_tagging.rb b/lib/discourse_tagging.rb
index 0ef5fba265d..ab276c51589 100644
--- a/lib/discourse_tagging.rb
+++ b/lib/discourse_tagging.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseTagging
TAGS_FIELD_NAME = "tags"
diff --git a/lib/discourse_updates.rb b/lib/discourse_updates.rb
index b0c1aaaff59..a203bd2ea12 100644
--- a/lib/discourse_updates.rb
+++ b/lib/discourse_updates.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseUpdates
class << self
diff --git a/lib/disk_space.rb b/lib/disk_space.rb
index 2f8d010dc5c..c817c68f3bb 100644
--- a/lib/disk_space.rb
+++ b/lib/disk_space.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DiskSpace
def self.uploads_used_bytes
# used(uploads_path)
diff --git a/lib/distributed_memoizer.rb b/lib/distributed_memoizer.rb
index 3be926658a5..a93ea9a90cd 100644
--- a/lib/distributed_memoizer.rb
+++ b/lib/distributed_memoizer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class DistributedMemoizer
# never wait for longer that 1 second for a cross process lock
@@ -39,11 +41,11 @@ class DistributedMemoizer
end
def self.redis_lock_key(key)
- "memoize_lock_" << key
+ +"memoize_lock_" << key
end
def self.redis_key(key)
- "memoize_" << key
+ +"memoize_" << key
end
# Used for testing
diff --git a/lib/distributed_mutex.rb b/lib/distributed_mutex.rb
index cf9d3c48c90..e17377436ff 100644
--- a/lib/distributed_mutex.rb
+++ b/lib/distributed_mutex.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Cross-process locking using Redis.
class DistributedMutex
DEFAULT_VALIDITY ||= 60
diff --git a/lib/edit_rate_limiter.rb b/lib/edit_rate_limiter.rb
index d30c7c66fc7..04d095f66dc 100644
--- a/lib/edit_rate_limiter.rb
+++ b/lib/edit_rate_limiter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rate_limiter'
class EditRateLimiter < RateLimiter
def initialize(user)
diff --git a/lib/email.rb b/lib/email.rb
index 9b7e13e81de..44417b721aa 100644
--- a/lib/email.rb
+++ b/lib/email.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mail'
require_dependency 'email/message_builder'
require_dependency 'email/renderer'
diff --git a/lib/email/message_builder.rb b/lib/email/message_builder.rb
index d57665a23be..92f4a2bab89 100644
--- a/lib/email/message_builder.rb
+++ b/lib/email/message_builder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Builds a Mail::Message we can use for sending. Optionally supports using a template
# for the body and subject
module Email
@@ -39,10 +41,10 @@ module Email
@template_args[:respond_instructions] = I18n.t('user_notifications.pm_participants', @template_args) if @opts[:private_reply]
else
if @opts[:only_reply_by_email]
- string = "user_notifications.only_reply_by_email"
+ string = +"user_notifications.only_reply_by_email"
string << "_pm" if @opts[:private_reply]
else
- string = allow_reply_by_email? ? "user_notifications.reply_by_email" : "user_notifications.visit_link_to_respond"
+ string = allow_reply_by_email? ? +"user_notifications.reply_by_email" : +"user_notifications.visit_link_to_respond"
string << "_pm" if @opts[:private_reply]
end
@template_args[:respond_instructions] = "---\n" + I18n.t(string, @template_args)
diff --git a/lib/email/processor.rb b/lib/email/processor.rb
index 469acfaca9c..6cb5d88272b 100644
--- a/lib/email/processor.rb
+++ b/lib/email/processor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Email
class Processor
diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb
index 904f83308aa..6013afd3fb3 100644
--- a/lib/email/receiver.rb
+++ b/lib/email/receiver.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "digest"
require_dependency "new_post_manager"
require_dependency "html_to_markdown"
@@ -1012,6 +1014,8 @@ module Email
end
def add_attachments(raw, user, options = {})
+ raw = raw.dup
+
rejected_attachments = []
attachments.each do |attachment|
tmp = Tempfile.new(["discourse-email-attachment", File.extname(attachment.filename)])
@@ -1128,7 +1132,7 @@ module Email
end
def self.elided_html(elided)
- html = "\n\n" << "" << "\n"
+ html = +"\n\n" << "" << "\n"
html << "···
" << "\n\n"
html << elided << "\n\n"
html << " " << "\n"
diff --git a/lib/email/renderer.rb b/lib/email/renderer.rb
index 77721ab4c52..f8d0328dc40 100644
--- a/lib/email/renderer.rb
+++ b/lib/email/renderer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email/styles'
module Email
diff --git a/lib/email/sender.rb b/lib/email/sender.rb
index 488a15edf66..ffe18cb95a6 100644
--- a/lib/email/sender.rb
+++ b/lib/email/sender.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# A helper class to send an email. It will also handle a nil message, which it considers
# to be "do nothing". This is because some Mailers will decide not to do work for some
diff --git a/lib/email/styles.rb b/lib/email/styles.rb
index 04f2935fa4f..7dc7f14b3ae 100644
--- a/lib/email/styles.rb
+++ b/lib/email/styles.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# HTML emails don't support CSS, so we can use nokogiri to inline attributes based on
# matchers.
diff --git a/lib/email_backup_token.rb b/lib/email_backup_token.rb
index e1f9e6dac72..0e49b69609b 100644
--- a/lib/email_backup_token.rb
+++ b/lib/email_backup_token.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmailBackupToken
def self.key(user_id)
diff --git a/lib/email_cook.rb b/lib/email_cook.rb
index 7a5056167df..751b190d1d9 100644
--- a/lib/email_cook.rb
+++ b/lib/email_cook.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'pretty_text'
# A very simple formatter for imported emails
@@ -40,12 +42,12 @@ class EmailCook
end
def htmlify(text)
- result = ""
+ result = +""
+ quote_buffer = +""
in_text = false
in_quote = false
- quote_buffer = ""
text.each_line do |line|
# replace indentation with non-breaking spaces
line.sub!(/^\s{2,}/) { |s| "\u00A0" * s.length }
diff --git a/lib/email_updater.rb b/lib/email_updater.rb
index dd7670f75b6..9c2797aa9f8 100644
--- a/lib/email_updater.rb
+++ b/lib/email_updater.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'email'
require_dependency 'has_errors'
require_dependency 'email_validator'
@@ -30,7 +32,7 @@ class EmailUpdater
if SiteSetting.hide_email_address_taken
Jobs.enqueue(:critical_user_email, type: :account_exists, user_id: existing_user.id)
else
- error_message = 'change_email.error'
+ error_message = +'change_email.error'
error_message << '_staged' if existing_user.staged?
errors.add(:base, I18n.t(error_message))
end
diff --git a/lib/encodings.rb b/lib/encodings.rb
index f323deff07a..8bf0c7c72be 100644
--- a/lib/encodings.rb
+++ b/lib/encodings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rchardet'
module Encodings
diff --git a/lib/enum.rb b/lib/enum.rb
index 7db1845dc4d..d4401219002 100644
--- a/lib/enum.rb
+++ b/lib/enum.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Enum < Hash
# Public: Initialize an enum.
#
diff --git a/lib/enum_site_setting.rb b/lib/enum_site_setting.rb
index 9305a8f7df8..51ce16d9e93 100644
--- a/lib/enum_site_setting.rb
+++ b/lib/enum_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnumSiteSetting
def self.translate_names?
false
diff --git a/lib/es6_module_transpiler/rails.rb b/lib/es6_module_transpiler/rails.rb
index f932d6761fe..9f72ac0a74e 100644
--- a/lib/es6_module_transpiler/rails.rb
+++ b/lib/es6_module_transpiler/rails.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'es6_module_transpiler/rails/version'
require 'es6_module_transpiler/tilt'
require 'es6_module_transpiler/sprockets'
diff --git a/lib/es6_module_transpiler/rails/version.rb b/lib/es6_module_transpiler/rails/version.rb
index 46a297c669e..0e1e981f8ec 100644
--- a/lib/es6_module_transpiler/rails/version.rb
+++ b/lib/es6_module_transpiler/rails/version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ES6ModuleTranspiler
module Rails
VERSION = '0.4.0'
diff --git a/lib/es6_module_transpiler/sprockets.rb b/lib/es6_module_transpiler/sprockets.rb
index aefccbcb9af..f55e52b26b6 100644
--- a/lib/es6_module_transpiler/sprockets.rb
+++ b/lib/es6_module_transpiler/sprockets.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'sprockets'
Sprockets.register_mime_type 'application/ecmascript6', extensions: ['.es6', '.js.es6', '.js.no-module.es6'], charset: :unicode
diff --git a/lib/es6_module_transpiler/tilt.rb b/lib/es6_module_transpiler/tilt.rb
index a24df56661d..5d399256c34 100644
--- a/lib/es6_module_transpiler/tilt.rb
+++ b/lib/es6_module_transpiler/tilt.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'tilt'
require 'es6_module_transpiler/tilt/es6_module_transpiler_template'
diff --git a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb
index f45884fb8b5..21e786665fe 100644
--- a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb
+++ b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'execjs'
require 'mini_racer'
@@ -161,8 +163,8 @@ JS
result = "Route" if result == "DiscourseRoute"
result = "View" if result == "ViewView"
- result.gsub!(/Mixin$/, '')
- result.gsub!(/Model$/, '')
+ result = result.gsub(/Mixin$/, '')
+ result = result.gsub(/Model$/, '')
if result != "PostMenuView"
@output << "\n\nDiscourse.#{result} = require('#{require_name}').default;\n"
diff --git a/lib/excerpt_parser.rb b/lib/excerpt_parser.rb
index 96400ade31c..9b17240d9f9 100644
--- a/lib/excerpt_parser.rb
+++ b/lib/excerpt_parser.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ExcerptParser < Nokogiri::XML::SAX::Document
attr_reader :excerpt
@@ -6,7 +8,7 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
def initialize(length, options = nil)
@length = length
- @excerpt = ""
+ @excerpt = +""
@current_length = 0
options || {}
@strip_links = options[:strip_links] == true
@@ -19,8 +21,8 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
@remap_emoji = options[:remap_emoji] == true
@start_excerpt = false
@in_details_depth = 0
- @summary_contents = ""
- @detail_contents = ""
+ @summary_contents = +""
+ @detail_contents = +""
end
def self.get_excerpt(html, length, options)
@@ -104,7 +106,7 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
when "div", "span"
if attributes.include?(["class", "excerpt"])
- @excerpt = ""
+ @excerpt = +""
@current_length = 0
@start_excerpt = true
end
@@ -115,12 +117,12 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
end
when "details"
- @detail_contents = "" if @in_details_depth == 0
+ @detail_contents = +"" if @in_details_depth == 0
@in_details_depth += 1
when "summary"
if @in_details_depth == 1 && !@in_summary
- @summary_contents = ""
+ @summary_contents = +""
@in_summary = true
end
diff --git a/lib/feed_element_installer.rb b/lib/feed_element_installer.rb
index c9354e4287a..2e0ecd40ec3 100644
--- a/lib/feed_element_installer.rb
+++ b/lib/feed_element_installer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rexml/document'
require 'rss'
diff --git a/lib/feed_item_accessor.rb b/lib/feed_item_accessor.rb
index af8908d02ce..4ef70cbf855 100644
--- a/lib/feed_item_accessor.rb
+++ b/lib/feed_item_accessor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FeedItemAccessor
attr_accessor :rss_item
diff --git a/lib/file_helper.rb b/lib/file_helper.rb
index feed479b0b4..6fc6f660b93 100644
--- a/lib/file_helper.rb
+++ b/lib/file_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "final_destination"
require "mini_mime"
require "open-uri"
diff --git a/lib/file_store/base_store.rb b/lib/file_store/base_store.rb
index 37226070abc..85c3be2ab0f 100644
--- a/lib/file_store/base_store.rb
+++ b/lib/file_store/base_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module FileStore
class BaseStore
diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb
index 09af9701f3a..6c3d3ca99cd 100644
--- a/lib/file_store/local_store.rb
+++ b/lib/file_store/local_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'file_store/base_store'
module FileStore
diff --git a/lib/file_store/s3_store.rb b/lib/file_store/s3_store.rb
index 7428879d91e..9ca94b98f79 100644
--- a/lib/file_store/s3_store.rb
+++ b/lib/file_store/s3_store.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "uri"
require "mini_mime"
require_dependency "file_store/base_store"
@@ -34,6 +36,8 @@ module FileStore
# - content_type
# - cache_locally
def store_file(file, path, opts = {})
+ path = path.dup
+
filename = opts[:filename].presence || File.basename(path)
# cache file locally when needed
cache_file(file, File.basename(path)) if opts[:cache_locally]
diff --git a/lib/filter_best_posts.rb b/lib/filter_best_posts.rb
index b5171497083..a243156b231 100644
--- a/lib/filter_best_posts.rb
+++ b/lib/filter_best_posts.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FilterBestPosts
attr_accessor :filtered_posts, :posts
diff --git a/lib/final_destination.rb b/lib/final_destination.rb
index beda159c838..3e1417f00b2 100644
--- a/lib/final_destination.rb
+++ b/lib/final_destination.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'socket'
require 'ipaddr'
require 'excon'
diff --git a/lib/flag_query.rb b/lib/flag_query.rb
index 3ea549fce3a..148477286a7 100644
--- a/lib/flag_query.rb
+++ b/lib/flag_query.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'ostruct'
module FlagQuery
diff --git a/lib/flag_settings.rb b/lib/flag_settings.rb
index d82a97ff30c..7a6b83d73a1 100644
--- a/lib/flag_settings.rb
+++ b/lib/flag_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class FlagSettings
attr_reader(
diff --git a/lib/freedom_patches/active_record_attribute_methods.rb b/lib/freedom_patches/active_record_attribute_methods.rb
index 22710613154..fbaf5afce61 100644
--- a/lib/freedom_patches/active_record_attribute_methods.rb
+++ b/lib/freedom_patches/active_record_attribute_methods.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# see: https://github.com/rails/rails/issues/32995
#
# Rails 5.2 forces us to add Arel.sql to #order and #pluck
diff --git a/lib/freedom_patches/active_record_base.rb b/lib/freedom_patches/active_record_base.rb
index e21eefe4bd9..0a7a54e763c 100644
--- a/lib/freedom_patches/active_record_base.rb
+++ b/lib/freedom_patches/active_record_base.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ActiveRecord::Base
# Handle PG::UniqueViolation as well due to concurrency
diff --git a/lib/freedom_patches/ams_include_without_root.rb b/lib/freedom_patches/ams_include_without_root.rb
index 67c4cf185b6..c614d606d13 100644
--- a/lib/freedom_patches/ams_include_without_root.rb
+++ b/lib/freedom_patches/ams_include_without_root.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Just ignore included associations that are to be embedded in the root instead of
# throwing an exception in AMS 0.8.x.
#
diff --git a/lib/freedom_patches/better_handlebars_errors.rb b/lib/freedom_patches/better_handlebars_errors.rb
index 940afe71a20..c308f744106 100644
--- a/lib/freedom_patches/better_handlebars_errors.rb
+++ b/lib/freedom_patches/better_handlebars_errors.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Ember
module Handlebars
class Template
diff --git a/lib/freedom_patches/fast_pluck.rb b/lib/freedom_patches/fast_pluck.rb
index 367c38cc854..bc79177e73d 100644
--- a/lib/freedom_patches/fast_pluck.rb
+++ b/lib/freedom_patches/fast_pluck.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Speeds up #pluck so its about 2.2x faster, importantly makes pluck avoid creation of a slew
# of AR objects
#
diff --git a/lib/freedom_patches/inflector_backport.rb b/lib/freedom_patches/inflector_backport.rb
index 66c60e52a16..e61f3135ad2 100644
--- a/lib/freedom_patches/inflector_backport.rb
+++ b/lib/freedom_patches/inflector_backport.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# review per rails release, this speeds up the inflector, we are not inflecting too much at the moment, except in dev
#
# note: I am working with the rails team on including this in official rails
diff --git a/lib/freedom_patches/match.rb b/lib/freedom_patches/match.rb
index 56084edaf6a..4190aec3525 100644
--- a/lib/freedom_patches/match.rb
+++ b/lib/freedom_patches/match.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class String
# new to Ruby 2.4, fastest way of matching a string to a regex
unless method_defined? :match?
diff --git a/lib/freedom_patches/open_uri_redirections.rb b/lib/freedom_patches/open_uri_redirections.rb
index 044d0279cbc..b6772798052 100644
--- a/lib/freedom_patches/open_uri_redirections.rb
+++ b/lib/freedom_patches/open_uri_redirections.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#####
# Patch to allow open-uri to follow safe (http to https)
# and unsafe redirections (https to http).
diff --git a/lib/freedom_patches/performance_fixes.rb b/lib/freedom_patches/performance_fixes.rb
index ca0807f7ca4..00b8a92cda0 100644
--- a/lib/freedom_patches/performance_fixes.rb
+++ b/lib/freedom_patches/performance_fixes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# perf fixes, review for each rails upgrade.
# This speeds up calls to present? and blank? on model instances
diff --git a/lib/freedom_patches/postgresql_adapter.rb b/lib/freedom_patches/postgresql_adapter.rb
index 30cea9f81ea..c790461f93f 100644
--- a/lib/freedom_patches/postgresql_adapter.rb
+++ b/lib/freedom_patches/postgresql_adapter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Awaiting decision on https://github.com/rails/rails/issues/31190
if ENV['DISABLE_MIGRATION_ADVISORY_LOCK']
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
diff --git a/lib/freedom_patches/rack_patches.rb b/lib/freedom_patches/rack_patches.rb
index 4cdc2dce11b..6443e4b9b63 100644
--- a/lib/freedom_patches/rack_patches.rb
+++ b/lib/freedom_patches/rack_patches.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# patch https://github.com/rack/rack/pull/600
#
class Rack::ETag
diff --git a/lib/freedom_patches/rails4.rb b/lib/freedom_patches/rails4.rb
index 5052dd86542..894c3dad904 100644
--- a/lib/freedom_patches/rails4.rb
+++ b/lib/freedom_patches/rails4.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Sam: This has now forked of rails. Trouble is we would never like to use "about 1 month" ever, we only want months for 2 or more months.
#
# Backporting a fix to rails itself may get too complex
diff --git a/lib/freedom_patches/rails6.rb b/lib/freedom_patches/rails6.rb
index b9aace631b4..f3ebbed3270 100644
--- a/lib/freedom_patches/rails6.rb
+++ b/lib/freedom_patches/rails6.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# this is a quick backport of a new method introduced in Rails 6
# to be removed after we upgrade to Rails 6
if ! defined? ActionView::Base.with_view_paths
diff --git a/lib/freedom_patches/raw_handlebars.rb b/lib/freedom_patches/raw_handlebars.rb
index 3d3a8a84f2d..acb63c8cd30 100644
--- a/lib/freedom_patches/raw_handlebars.rb
+++ b/lib/freedom_patches/raw_handlebars.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# barber patches to re-route raw compilation via ember compat handlebars
class Barber::Precompiler
diff --git a/lib/freedom_patches/reaper.rb b/lib/freedom_patches/reaper.rb
index c603ac70bbc..dc49a528f84 100644
--- a/lib/freedom_patches/reaper.rb
+++ b/lib/freedom_patches/reaper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Discourse ships with a connection reaper
# this patch ensures that the connection reaper never runs in Rails
#
diff --git a/lib/freedom_patches/redis.rb b/lib/freedom_patches/redis.rb
index 8bab1e7141d..8945ece473e 100644
--- a/lib/freedom_patches/redis.rb
+++ b/lib/freedom_patches/redis.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# https://github.com/redis/redis-rb/pull/591
class Redis
class Client
diff --git a/lib/freedom_patches/regexp.rb b/lib/freedom_patches/regexp.rb
index 5ff804c4900..4dd6f7a55d1 100644
--- a/lib/freedom_patches/regexp.rb
+++ b/lib/freedom_patches/regexp.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
unless ::Regexp.instance_methods.include?(:match?)
class ::Regexp
# this is the fast way of checking a regex (zero string allocs) added in Ruby 2.4
diff --git a/lib/freedom_patches/safe_buffer.rb b/lib/freedom_patches/safe_buffer.rb
index 8c8a294bfd0..545096e0d77 100644
--- a/lib/freedom_patches/safe_buffer.rb
+++ b/lib/freedom_patches/safe_buffer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# For some reason safe buffer is getting invalid encoding in some cases
# we work around the issue and log the problems
#
@@ -15,9 +17,9 @@ class ActiveSupport::SafeBuffer
raise
else
- encoding_diags = "internal encoding #{Encoding.default_internal}, external encoding #{Encoding.default_external}"
+ encoding_diags = +"internal encoding #{Encoding.default_internal}, external encoding #{Encoding.default_external}"
- unless encoding == Encoding::UTF_8
+ if encoding != Encoding::UTF_8
encoding_diags << " my encoding is #{encoding} "
self.force_encoding("UTF-8")
@@ -28,7 +30,7 @@ class ActiveSupport::SafeBuffer
Rails.logger.warn("Encountered a non UTF-8 string in SafeBuffer - #{self} - #{encoding_diags}")
end
- unless value.encoding == Encoding::UTF_8
+ if value.encoding != Encoding::UTF_8
encoding_diags << " attempted to append encoding #{value.encoding} "
diff --git a/lib/freedom_patches/safe_migrations.rb b/lib/freedom_patches/safe_migrations.rb
index 59eb1f7ce42..718ffffb89f 100644
--- a/lib/freedom_patches/safe_migrations.rb
+++ b/lib/freedom_patches/safe_migrations.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'migration/safe_migrate'
Migration::SafeMigrate.patch_active_record!
diff --git a/lib/freedom_patches/schema_migration_details.rb b/lib/freedom_patches/schema_migration_details.rb
index 790676c8ec6..0f60581a698 100644
--- a/lib/freedom_patches/schema_migration_details.rb
+++ b/lib/freedom_patches/schema_migration_details.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module FreedomPatches
module SchemaMigrationDetails
def exec_migration(conn, direction)
diff --git a/lib/freedom_patches/sprockets_patches.rb b/lib/freedom_patches/sprockets_patches.rb
index 7cbf529aff2..78fc2264bd2 100644
--- a/lib/freedom_patches/sprockets_patches.rb
+++ b/lib/freedom_patches/sprockets_patches.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This contains two patches to make sprockets more tolerable in dev
#
# 1. Stop computing asset paths which triggers sprockets to do mountains of work
diff --git a/lib/freedom_patches/translate_accelerator.rb b/lib/freedom_patches/translate_accelerator.rb
index 0d5090b80b4..593e9d1e858 100644
--- a/lib/freedom_patches/translate_accelerator.rb
+++ b/lib/freedom_patches/translate_accelerator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This patch performs 2 functions
#
# 1. It caches all translations which drastically improves
diff --git a/lib/gaps.rb b/lib/gaps.rb
index 0bf52b14fc0..6b6dac16bb1 100644
--- a/lib/gaps.rb
+++ b/lib/gaps.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# This is used for finding the gaps between a subset of elements in an array
# and the original layout. We use this in Discourse to find gaps between posts.
diff --git a/lib/generators/plugin/plugin_generator.rb b/lib/generators/plugin/plugin_generator.rb
index 94f9d2441dd..a1926abbcac 100644
--- a/lib/generators/plugin/plugin_generator.rb
+++ b/lib/generators/plugin/plugin_generator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails/generators/named_base'
class PluginGenerator < Rails::Generators::NamedBase
diff --git a/lib/global_path.rb b/lib/global_path.rb
index 17479b60ebb..79147568407 100644
--- a/lib/global_path.rb
+++ b/lib/global_path.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module GlobalPath
def path(p)
"#{GlobalSetting.relative_url_root}#{p}"
diff --git a/lib/guardian.rb b/lib/guardian.rb
index 3d62e18b320..87565ba42dd 100644
--- a/lib/guardian.rb
+++ b/lib/guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'guardian/category_guardian'
require_dependency 'guardian/ensure_magic'
require_dependency 'guardian/post_guardian'
diff --git a/lib/guardian/category_guardian.rb b/lib/guardian/category_guardian.rb
index 116105f5640..5787642161d 100644
--- a/lib/guardian/category_guardian.rb
+++ b/lib/guardian/category_guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#mixin for all guardian methods dealing with category permisions
module CategoryGuardian
diff --git a/lib/guardian/ensure_magic.rb b/lib/guardian/ensure_magic.rb
index cb8b5c0ed77..bff9f402dca 100644
--- a/lib/guardian/ensure_magic.rb
+++ b/lib/guardian/ensure_magic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Support for ensure_{blah}! methods.
module EnsureMagic
diff --git a/lib/guardian/group_guardian.rb b/lib/guardian/group_guardian.rb
index a9ad9741d63..fbcf72b7f5e 100644
--- a/lib/guardian/group_guardian.rb
+++ b/lib/guardian/group_guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#mixin for all guardian methods dealing with group permissions
module GroupGuardian
diff --git a/lib/guardian/post_guardian.rb b/lib/guardian/post_guardian.rb
index a0931226417..baf2b77848c 100644
--- a/lib/guardian/post_guardian.rb
+++ b/lib/guardian/post_guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#mixin for all guardian methods dealing with post permissions
module PostGuardian
diff --git a/lib/guardian/post_revision_guardian.rb b/lib/guardian/post_revision_guardian.rb
index 9b9d1b9caf8..4372728b955 100644
--- a/lib/guardian/post_revision_guardian.rb
+++ b/lib/guardian/post_revision_guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# mixin for all Guardian methods dealing with post_revisions permissions
module PostRevisionGuardian
diff --git a/lib/guardian/tag_guardian.rb b/lib/guardian/tag_guardian.rb
index 8e407073538..e1b5a211e27 100644
--- a/lib/guardian/tag_guardian.rb
+++ b/lib/guardian/tag_guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#mixin for all guardian methods dealing with tagging permisions
module TagGuardian
def can_create_tag?
diff --git a/lib/guardian/topic_guardian.rb b/lib/guardian/topic_guardian.rb
index cd78f2eff36..242cfbdb4d1 100644
--- a/lib/guardian/topic_guardian.rb
+++ b/lib/guardian/topic_guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#mixin for all guardian methods dealing with topic permisions
module TopicGuardian
diff --git a/lib/guardian/user_guardian.rb b/lib/guardian/user_guardian.rb
index 4b7fda4135c..0d19f64fe70 100644
--- a/lib/guardian/user_guardian.rb
+++ b/lib/guardian/user_guardian.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# mixin for all Guardian methods dealing with user permissions
module UserGuardian
diff --git a/lib/has_errors.rb b/lib/has_errors.rb
index e7379c31628..907e537d1c0 100644
--- a/lib/has_errors.rb
+++ b/lib/has_errors.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Helper functions for dealing with errors and objects that have
# child objects with errors
module HasErrors
diff --git a/lib/homepage_constraint.rb b/lib/homepage_constraint.rb
index 7520bfe560b..7c04acebb26 100644
--- a/lib/homepage_constraint.rb
+++ b/lib/homepage_constraint.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class HomePageConstraint
def initialize(filter)
@filter = filter
diff --git a/lib/html_prettify.rb b/lib/html_prettify.rb
index 0b940664172..db3bd14e08f 100644
--- a/lib/html_prettify.rb
+++ b/lib/html_prettify.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# heavily based off
# https://github.com/vmg/redcarpet/blob/master/ext/redcarpet/html_smartypants.c
# and
@@ -97,7 +99,7 @@ class HtmlPrettify < String
in_pre = false
# Here is the result stored in.
- result = ""
+ result = +""
# This is a cheat, used to get some context for one-character
# tokens that consist of just a quote char. What we do is remember
diff --git a/lib/html_to_markdown.rb b/lib/html_to_markdown.rb
index 57a95799601..a17a78eb2b0 100644
--- a/lib/html_to_markdown.rb
+++ b/lib/html_to_markdown.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
require "nokogiri"
class HtmlToMarkdown
class Block < Struct.new(:name, :head, :body, :opened, :markdown)
- def initialize(name, head = "", body = "", opened = false, markdown = "")
+ def initialize(name, head = "", body = "", opened = false, markdown = +"")
super
end
end
@@ -42,10 +44,12 @@ class HtmlToMarkdown
def to_markdown
@stack = [Block.new("root")]
- @markdown = ""
+ @markdown = +""
traverse(@doc)
@markdown << format_block
- @markdown.gsub(/\n{3,}/, "\n\n").strip
+ @markdown.gsub!(/\n{3,}/, "\n\n")
+ @markdown.strip!
+ @markdown
end
def traverse(node)
@@ -58,7 +62,7 @@ class HtmlToMarkdown
if node.description&.block? && node.parent&.description&.block? && @stack[-1].markdown.size > 0
block = @stack[-1].dup
@markdown << format_block
- block.markdown = ""
+ block.markdown = +""
block.opened = true
@stack << block
end
@@ -81,7 +85,7 @@ class HtmlToMarkdown
code_class = code ? code["class"] : ""
lang = code_class ? code_class[/lang-(\w+)/, 1] : ""
pre = Block.new("pre")
- pre.markdown = "```#{lang}\n"
+ pre.markdown = +"```#{lang}\n"
@stack << pre
traverse(node)
pre.markdown << "\n```\n"
diff --git a/lib/i18n/backend/discourse_i18n.rb b/lib/i18n/backend/discourse_i18n.rb
index 46ca58d26ee..2b63b7994f6 100644
--- a/lib/i18n/backend/discourse_i18n.rb
+++ b/lib/i18n/backend/discourse_i18n.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'i18n/backend/pluralization'
require_dependency 'locale_site_setting'
diff --git a/lib/i18n/backend/fallback_locale_list.rb b/lib/i18n/backend/fallback_locale_list.rb
index 6b4faf1bf1b..600e86b58cc 100644
--- a/lib/i18n/backend/fallback_locale_list.rb
+++ b/lib/i18n/backend/fallback_locale_list.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module I18n
module Backend
# Configure custom fallback order
diff --git a/lib/i18n/duplicate_key_finder.rb b/lib/i18n/duplicate_key_finder.rb
index f23221d13e9..c1e99c93a7f 100644
--- a/lib/i18n/duplicate_key_finder.rb
+++ b/lib/i18n/duplicate_key_finder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative "locale_file_walker"
class DuplicateKeyFinder < LocaleFileWalker
diff --git a/lib/i18n/i18n_interpolation_keys_finder.rb b/lib/i18n/i18n_interpolation_keys_finder.rb
index 7c5fe9288a4..6b0fff0efce 100644
--- a/lib/i18n/i18n_interpolation_keys_finder.rb
+++ b/lib/i18n/i18n_interpolation_keys_finder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class I18nInterpolationKeysFinder
def self.find(text)
keys = text.scan(Regexp.union(I18n::INTERPOLATION_PATTERN, /\{\{(\w+)\}\}/))
diff --git a/lib/i18n/locale_file_checker.rb b/lib/i18n/locale_file_checker.rb
index 54b27d9a71f..7d6cd4d9a21 100644
--- a/lib/i18n/locale_file_checker.rb
+++ b/lib/i18n/locale_file_checker.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'i18n/i18n_interpolation_keys_finder'
require 'yaml'
diff --git a/lib/i18n/locale_file_walker.rb b/lib/i18n/locale_file_walker.rb
index e433f1a4e24..facc7235c02 100644
--- a/lib/i18n/locale_file_walker.rb
+++ b/lib/i18n/locale_file_walker.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class LocaleFileWalker
protected
diff --git a/lib/image_sizer.rb b/lib/image_sizer.rb
index ee368ce3d1e..ddb86396d58 100644
--- a/lib/image_sizer.rb
+++ b/lib/image_sizer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImageSizer
# Resize an image to the aspect ratio we want
diff --git a/lib/import/normalize.rb b/lib/import/normalize.rb
index 5279439dc4d..c9c6dc74998 100644
--- a/lib/import/normalize.rb
+++ b/lib/import/normalize.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# markdown normalizer to be used by importers
#
#
diff --git a/lib/import_export/base_exporter.rb b/lib/import_export/base_exporter.rb
index ec47246033e..9c63af42cb2 100644
--- a/lib/import_export/base_exporter.rb
+++ b/lib/import_export/base_exporter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportExport
class BaseExporter
diff --git a/lib/import_export/category_exporter.rb b/lib/import_export/category_exporter.rb
index 5568fb5180d..85f857a6aa5 100644
--- a/lib/import_export/category_exporter.rb
+++ b/lib/import_export/category_exporter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "import_export/base_exporter"
require "import_export/topic_exporter"
diff --git a/lib/import_export/category_structure_exporter.rb b/lib/import_export/category_structure_exporter.rb
index 7c6f3c61db1..e3b1773cdb4 100644
--- a/lib/import_export/category_structure_exporter.rb
+++ b/lib/import_export/category_structure_exporter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "import_export/base_exporter"
module ImportExport
diff --git a/lib/import_export/import_export.rb b/lib/import_export/import_export.rb
index 4523bb779d8..f5abe5f1aa4 100644
--- a/lib/import_export/import_export.rb
+++ b/lib/import_export/import_export.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "import_export/importer"
require "import_export/category_structure_exporter"
require "import_export/category_exporter"
diff --git a/lib/import_export/importer.rb b/lib/import_export/importer.rb
index 90d787a5294..7dbfb73d4bb 100644
--- a/lib/import_export/importer.rb
+++ b/lib/import_export/importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(Rails.root, 'script', 'import_scripts', 'base.rb')
module ImportExport
diff --git a/lib/import_export/topic_exporter.rb b/lib/import_export/topic_exporter.rb
index 4603e3d1b66..64ab80aaf0f 100644
--- a/lib/import_export/topic_exporter.rb
+++ b/lib/import_export/topic_exporter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "import_export/base_exporter"
module ImportExport
diff --git a/lib/inline_oneboxer.rb b/lib/inline_oneboxer.rb
index b21a6c8fa5e..04d8ea348c8 100644
--- a/lib/inline_oneboxer.rb
+++ b/lib/inline_oneboxer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'retrieve_title'
class InlineOneboxer
diff --git a/lib/introduction_updater.rb b/lib/introduction_updater.rb
index 3def6a42242..d22f084a639 100644
--- a/lib/introduction_updater.rb
+++ b/lib/introduction_updater.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IntroductionUpdater
def initialize(user)
diff --git a/lib/ip_addr.rb b/lib/ip_addr.rb
index 22886a5ec38..e9b118b8d06 100644
--- a/lib/ip_addr.rb
+++ b/lib/ip_addr.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IPAddr
def self.handle_wildcards(val)
diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb
index 4fd5ab1c749..2a602a11b51 100644
--- a/lib/js_locale_helper.rb
+++ b/lib/js_locale_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module JsLocaleHelper
def self.plugin_client_files(locale_str)
@@ -214,7 +216,7 @@ module JsLocaleHelper
end
def self.moment_formats
- result = ""
+ result = +""
result << moment_format_function('short_date_no_year')
result << moment_format_function('short_date')
result << moment_format_function('long_date')
@@ -234,7 +236,7 @@ module JsLocaleHelper
def self.generate_message_format(message_formats, locale, filename)
formats = message_formats.map { |k, v| k.inspect << " : " << compile_message_format(filename, locale, v) }.join(", ")
- result = "MessageFormat = {locale: {}};\n"
+ result = +"MessageFormat = {locale: {}};\n"
result << "I18n._compiledMFs = {#{formats}};\n"
result << File.read(filename) << "\n"
result << File.read("#{Rails.root}/lib/javascripts/messageformat-lookup.js") << "\n"
@@ -263,7 +265,7 @@ module JsLocaleHelper
ctx.eval("mf.precompile(mf.parse(#{format.inspect}))")
end
rescue MiniRacer::EvalError => e
- message = "Invalid Format: " << e.message
+ message = +"Invalid Format: " << e.message
"function(){ return #{message.inspect};}"
end
diff --git a/lib/json_error.rb b/lib/json_error.rb
index 7d763a23085..5366c43c27e 100644
--- a/lib/json_error.rb
+++ b/lib/json_error.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module JsonError
def create_errors_json(obj, opts = nil)
diff --git a/lib/letter_avatar.rb b/lib/letter_avatar.rb
index cad64a83c5f..6c4aa1d2f9d 100644
--- a/lib/letter_avatar.rb
+++ b/lib/letter_avatar.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class LetterAvatar
class Identity
diff --git a/lib/markdown_linker.rb b/lib/markdown_linker.rb
index 9e69f6c1060..fe48d4f5f2b 100644
--- a/lib/markdown_linker.rb
+++ b/lib/markdown_linker.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Helps create links using markdown (where references are at the bottom)
class MarkdownLinker
@@ -16,7 +18,7 @@ class MarkdownLinker
end
def references
- result = ""
+ result = +""
(@rendered..@index - 1).each do |i|
result << "[#{i}]: #{@markdown_links[i]}\n"
end
diff --git a/lib/mem_info.rb b/lib/mem_info.rb
index 6c227cdfd33..6404fa8733d 100644
--- a/lib/mem_info.rb
+++ b/lib/mem_info.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MemInfo
# Total memory in kb. On Mac OS uses "sysctl", elsewhere expects the system has /proc/meminfo.
diff --git a/lib/message_bus_diags.rb b/lib/message_bus_diags.rb
index 6db37c10959..d56badfe620 100644
--- a/lib/message_bus_diags.rb
+++ b/lib/message_bus_diags.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MessageBusDiags
@host_info = {}
diff --git a/lib/method_profiler.rb b/lib/method_profiler.rb
index e1398e02eb9..3e4c841419b 100644
--- a/lib/method_profiler.rb
+++ b/lib/method_profiler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# see https://samsaffron.com/archive/2017/10/18/fastest-way-to-profile-a-method-in-ruby
class MethodProfiler
def self.patch(klass, methods, name, no_recurse: false)
diff --git a/lib/middleware/discourse_public_exceptions.rb b/lib/middleware/discourse_public_exceptions.rb
index 089366d438d..ffc281d85a2 100644
--- a/lib/middleware/discourse_public_exceptions.rb
+++ b/lib/middleware/discourse_public_exceptions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# since all the rescue from clauses are not caught by the application controller for matches
# we need to handle certain exceptions here
module Middleware
diff --git a/lib/middleware/missing_avatars.rb b/lib/middleware/missing_avatars.rb
index 73bda77ab3a..f0f2da5d5c1 100644
--- a/lib/middleware/missing_avatars.rb
+++ b/lib/middleware/missing_avatars.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Middleware
# In development mode, it is common to use a database from a production site for testing
diff --git a/lib/migration/base_dropper.rb b/lib/migration/base_dropper.rb
index 0616257f443..d013bea9808 100644
--- a/lib/migration/base_dropper.rb
+++ b/lib/migration/base_dropper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Migration
class BaseDropper
FUNCTION_SCHEMA_NAME = "discourse_functions".freeze
diff --git a/lib/migration/column_dropper.rb b/lib/migration/column_dropper.rb
index ee892af6e09..62c8ad97f4b 100644
--- a/lib/migration/column_dropper.rb
+++ b/lib/migration/column_dropper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'migration/base_dropper'
module Migration
diff --git a/lib/migration/safe_migrate.rb b/lib/migration/safe_migrate.rb
index 4ec48aa8f7b..417b11d7123 100644
--- a/lib/migration/safe_migrate.rb
+++ b/lib/migration/safe_migrate.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Migration; end
class Discourse::InvalidMigration < StandardError; end
diff --git a/lib/migration/table_dropper.rb b/lib/migration/table_dropper.rb
index 23568d0c35a..d710b88ff09 100644
--- a/lib/migration/table_dropper.rb
+++ b/lib/migration/table_dropper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'migration/base_dropper'
module Migration
diff --git a/lib/mini_sql_multisite_connection.rb b/lib/mini_sql_multisite_connection.rb
index 280ee9e851f..ee1129c65fa 100644
--- a/lib/mini_sql_multisite_connection.rb
+++ b/lib/mini_sql_multisite_connection.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MiniSqlMultisiteConnection < MiniSql::Postgres::Connection
class CustomBuilder < MiniSql::Builder
@@ -8,9 +10,9 @@ class MiniSqlMultisiteConnection < MiniSql::Postgres::Connection
def secure_category(secure_category_ids, category_alias = 'c')
if secure_category_ids.present?
- where("NOT COALESCE(" << category_alias << ".read_restricted, false) OR " << category_alias << ".id in (:secure_category_ids)", secure_category_ids: secure_category_ids)
+ where("NOT COALESCE(#{category_alias}.read_restricted, false) OR #{category_alias}.id in (:secure_category_ids)", secure_category_ids: secure_category_ids)
else
- where("NOT COALESCE(" << category_alias << ".read_restricted, false)")
+ where("NOT COALESCE(#{category_alias}.read_restricted, false)")
end
self
end
diff --git a/lib/mobile_detection.rb b/lib/mobile_detection.rb
index a1acbc6e0ee..9d99f46d531 100644
--- a/lib/mobile_detection.rb
+++ b/lib/mobile_detection.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module MobileDetection
def self.mobile_device?(user_agent)
user_agent =~ /Mobile/ && !(user_agent =~ /iPad/)
diff --git a/lib/new_post_manager.rb b/lib/new_post_manager.rb
index 2beacba7206..cd01e20e951 100644
--- a/lib/new_post_manager.rb
+++ b/lib/new_post_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'post_creator'
require_dependency 'new_post_result'
require_dependency 'word_watcher'
diff --git a/lib/new_post_result.rb b/lib/new_post_result.rb
index 3b82b90b71e..b8d4fe49f0e 100644
--- a/lib/new_post_result.rb
+++ b/lib/new_post_result.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'has_errors'
class NewPostResult
diff --git a/lib/notification_levels.rb b/lib/notification_levels.rb
index a0e3aa9eff1..ccf24541600 100644
--- a/lib/notification_levels.rb
+++ b/lib/notification_levels.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module NotificationLevels
def self.all
@all_levels ||= Enum.new(muted: 0,
diff --git a/lib/onebox/discourse_onebox_sanitize_config.rb b/lib/onebox/discourse_onebox_sanitize_config.rb
index 2b2d83f9895..5072f53c307 100644
--- a/lib/onebox/discourse_onebox_sanitize_config.rb
+++ b/lib/onebox/discourse_onebox_sanitize_config.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Sanitize
module Config
diff --git a/lib/onebox/engine/flash_video_onebox.rb b/lib/onebox/engine/flash_video_onebox.rb
index a5414aaf97c..f3de5eda360 100644
--- a/lib/onebox/engine/flash_video_onebox.rb
+++ b/lib/onebox/engine/flash_video_onebox.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Onebox
module Engine
class FlashVideoOnebox
diff --git a/lib/onebox/engine/whitelisted_generic_onebox.rb b/lib/onebox/engine/whitelisted_generic_onebox.rb
index 64b22dae9cc..a10f22e83b4 100644
--- a/lib/onebox/engine/whitelisted_generic_onebox.rb
+++ b/lib/onebox/engine/whitelisted_generic_onebox.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "ipaddr"
module Onebox
diff --git a/lib/oneboxer.rb b/lib/oneboxer.rb
index adb646a6a2a..94e9c402157 100644
--- a/lib/oneboxer.rb
+++ b/lib/oneboxer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'uri'
require_dependency "onebox/discourse_onebox_sanitize_config"
require_dependency 'final_destination'
diff --git a/lib/onpdiff.rb b/lib/onpdiff.rb
index ab5ee6d4e20..bcca737ba2b 100644
--- a/lib/onpdiff.rb
+++ b/lib/onpdiff.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Use "An O(NP) Sequence Comparison Algorithm" as described by Sun Wu, Udi Manber and Gene Myers
# in http://www.itu.dk/stud/speciale/bepjea/xwebtex/litt/an-onp-sequence-comparison-algorithm.pdf
class ONPDiff
diff --git a/lib/pbkdf2.rb b/lib/pbkdf2.rb
index c73639326b9..ece07e2a4d4 100644
--- a/lib/pbkdf2.rb
+++ b/lib/pbkdf2.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Note: the pbkdf2 gem is bust on 2.0, the logic is so simple I am not sure it makes sense to have this in a gem atm (Sam)
#
# Also PBKDF2 monkey patches string ... don't like that at all
diff --git a/lib/permalink_constraint.rb b/lib/permalink_constraint.rb
index 8fc9520290a..2e049e6c7a7 100644
--- a/lib/permalink_constraint.rb
+++ b/lib/permalink_constraint.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PermalinkConstraint
def matches?(request)
diff --git a/lib/pinned_check.rb b/lib/pinned_check.rb
index 54543499b34..eb9edcb84f8 100644
--- a/lib/pinned_check.rb
+++ b/lib/pinned_check.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Helps us determine whether a topic should be displayed as pinned or not,
# taking into account anonymous users and users who have dismissed it
class PinnedCheck
diff --git a/lib/plain_text_to_markdown.rb b/lib/plain_text_to_markdown.rb
index ce785ca50f8..ae32557c132 100644
--- a/lib/plain_text_to_markdown.rb
+++ b/lib/plain_text_to_markdown.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PlainTextToMarkdown
SIGNATURE_SEPARATOR ||= "-- ".freeze
@@ -15,7 +17,7 @@ class PlainTextToMarkdown
prepare_lines
classify_lines
- markdown = ""
+ markdown = +""
last_quote_level = 0
last_line_blank = false
@@ -172,7 +174,7 @@ class PlainTextToMarkdown
end
def escape_special_characters(text)
- escaped_text = ""
+ escaped_text = +""
text.split(URL_REGEX).each do |text_part|
if text_part =~ URL_REGEX
diff --git a/lib/plugin/filter.rb b/lib/plugin/filter.rb
index 771de6e95a1..78c5d652548 100644
--- a/lib/plugin/filter.rb
+++ b/lib/plugin/filter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'plugin/filter_manager'
# this concept is borrowed straight out of wordpress
module Plugin
diff --git a/lib/plugin/filter_manager.rb b/lib/plugin/filter_manager.rb
index 34b76a1e1e3..7342197b759 100644
--- a/lib/plugin/filter_manager.rb
+++ b/lib/plugin/filter_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Plugin
class FilterManager
diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb
index eb66e91c017..7059844987a 100644
--- a/lib/plugin/instance.rb
+++ b/lib/plugin/instance.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'digest/sha1'
require 'fileutils'
require_dependency 'plugin/metadata'
diff --git a/lib/plugin/metadata.rb b/lib/plugin/metadata.rb
index 5156bb23c14..84351f1febf 100644
--- a/lib/plugin/metadata.rb
+++ b/lib/plugin/metadata.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# loaded really early
module Plugin; end
diff --git a/lib/plugin_gem.rb b/lib/plugin_gem.rb
index 6bf9d96a2bd..fe0e4cbb4b4 100644
--- a/lib/plugin_gem.rb
+++ b/lib/plugin_gem.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module PluginGem
def self.load(path, name, version, opts = nil)
opts ||= {}
diff --git a/lib/post_action_creator.rb b/lib/post_action_creator.rb
index 1638552a486..d38b30c3a75 100644
--- a/lib/post_action_creator.rb
+++ b/lib/post_action_creator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'post_action_result'
class PostActionCreator
diff --git a/lib/post_action_destroyer.rb b/lib/post_action_destroyer.rb
index f4569f13011..c06e8d30aa1 100644
--- a/lib/post_action_destroyer.rb
+++ b/lib/post_action_destroyer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'post_action_result'
class PostActionDestroyer
diff --git a/lib/post_action_result.rb b/lib/post_action_result.rb
index a6586e628ed..9959821f248 100644
--- a/lib/post_action_result.rb
+++ b/lib/post_action_result.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'has_errors'
class PostActionResult
diff --git a/lib/post_creator.rb b/lib/post_creator.rb
index 380ce3b1de1..95363cd2043 100644
--- a/lib/post_creator.rb
+++ b/lib/post_creator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Responsible for creating posts and topics
#
require_dependency 'rate_limiter'
diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rb
index 97ffd52c748..ddd03120902 100644
--- a/lib/post_destroyer.rb
+++ b/lib/post_destroyer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# How a post is deleted is affected by who is performing the action.
# this class contains the logic to delete it.
diff --git a/lib/post_jobs_enqueuer.rb b/lib/post_jobs_enqueuer.rb
index cbcd68623a8..bc302eda3ec 100644
--- a/lib/post_jobs_enqueuer.rb
+++ b/lib/post_jobs_enqueuer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostJobsEnqueuer
def initialize(post, topic, new_topic, opts = {})
@post = post
diff --git a/lib/post_locker.rb b/lib/post_locker.rb
index d78951231c4..9d79b7e3517 100644
--- a/lib/post_locker.rb
+++ b/lib/post_locker.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostLocker
def initialize(post, user)
@post, @user = post, user
diff --git a/lib/post_merger.rb b/lib/post_merger.rb
index 4beb6cd6023..e80a2ac8c09 100644
--- a/lib/post_merger.rb
+++ b/lib/post_merger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PostMerger
class CannotMergeError < StandardError; end
diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb
index fa9fd988c1a..1f94183f186 100644
--- a/lib/post_revisor.rb
+++ b/lib/post_revisor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "edit_rate_limiter"
require 'post_locker'
diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb
index f3e1aa81b4a..94d5d02e772 100644
--- a/lib/pretty_text.rb
+++ b/lib/pretty_text.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mini_racer'
require 'nokogiri'
require 'erb'
@@ -144,7 +146,7 @@ module PrettyText
custom_emoji = {}
Emoji.custom.map { |e| custom_emoji[e.name] = e.url }
- buffer = <<~JS
+ buffer = +<<~JS
__optInput = {};
__optInput.siteSettings = #{SiteSetting.client_settings_json};
__paths = #{paths_json};
@@ -286,8 +288,8 @@ module PrettyText
if !uri.host.present? ||
uri.host == site_uri.host ||
- uri.host.ends_with?("." << site_uri.host) ||
- whitelist.any? { |u| uri.host == u || uri.host.ends_with?("." << u) }
+ uri.host.ends_with?(".#{site_uri.host}") ||
+ whitelist.any? { |u| uri.host == u || uri.host.ends_with?(".#{u}") }
# we are good no need for nofollow
l.remove_attribute("rel")
else
@@ -319,7 +321,7 @@ module PrettyText
# extract quotes
doc.css("aside.quote[data-topic]").each do |aside|
if aside["data-topic"].present?
- url = "/t/topic/#{aside["data-topic"]}"
+ url = +"/t/topic/#{aside["data-topic"]}"
url << "/#{aside["data-post"]}" if aside["data-post"].present?
links << DetectedLink.new(url, true)
end
diff --git a/lib/pretty_text/helpers.rb b/lib/pretty_text/helpers.rb
index d66e7e0e6b6..3337282268b 100644
--- a/lib/pretty_text/helpers.rb
+++ b/lib/pretty_text/helpers.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'inline_oneboxer'
module PrettyText
diff --git a/lib/primary_group_lookup.rb b/lib/primary_group_lookup.rb
index ad3b4a5e01c..4dd9ce1020b 100644
--- a/lib/primary_group_lookup.rb
+++ b/lib/primary_group_lookup.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PrimaryGroupLookup
def initialize(user_ids = [])
@user_ids = user_ids.tap(&:compact!).tap(&:uniq!).tap(&:flatten!)
diff --git a/lib/promotion.rb b/lib/promotion.rb
index 8e070b58ca6..fe810aebcd4 100644
--- a/lib/promotion.rb
+++ b/lib/promotion.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# Check whether a user is ready for a new trust level.
#
diff --git a/lib/quote_comparer.rb b/lib/quote_comparer.rb
index c466d718c65..e3aeb797172 100644
--- a/lib/quote_comparer.rb
+++ b/lib/quote_comparer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class QuoteComparer
def self.whitespace
" \t\r\n".freeze
diff --git a/lib/rate_limiter.rb b/lib/rate_limiter.rb
index 73d322ab11d..99defc60108 100644
--- a/lib/rate_limiter.rb
+++ b/lib/rate_limiter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'rate_limiter/limit_exceeded'
require_dependency 'rate_limiter/on_create_record'
diff --git a/lib/rate_limiter/limit_exceeded.rb b/lib/rate_limiter/limit_exceeded.rb
index 6e910b3732b..8b624a074ed 100644
--- a/lib/rate_limiter/limit_exceeded.rb
+++ b/lib/rate_limiter/limit_exceeded.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RateLimiter
# A rate limit has been exceeded.
diff --git a/lib/rate_limiter/on_create_record.rb b/lib/rate_limiter/on_create_record.rb
index c4689adb1a8..327a1c15fab 100644
--- a/lib/rate_limiter/on_create_record.rb
+++ b/lib/rate_limiter/on_create_record.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RateLimiter
# A mixin we can use on ActiveRecord Models to automatically rate limit them
diff --git a/lib/remap.rb b/lib/remap.rb
index 020cc2c2bba..17ab2d6a44f 100644
--- a/lib/remap.rb
+++ b/lib/remap.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Remap
def initialize(from, to, regex: false, verbose: false)
@from = from
diff --git a/lib/retrieve_title.rb b/lib/retrieve_title.rb
index 62c4a4022d4..6fc724075f3 100644
--- a/lib/retrieve_title.rb
+++ b/lib/retrieve_title.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'final_destination'
module RetrieveTitle
diff --git a/lib/reviewable/actions.rb b/lib/reviewable/actions.rb
index 030ef673da8..5d584b5123b 100644
--- a/lib/reviewable/actions.rb
+++ b/lib/reviewable/actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'reviewable/collection'
class Reviewable < ActiveRecord::Base
diff --git a/lib/reviewable/collection.rb b/lib/reviewable/collection.rb
index 8604045efdc..1a9b354fbc5 100644
--- a/lib/reviewable/collection.rb
+++ b/lib/reviewable/collection.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Reviewable < ActiveRecord::Base
class Collection
class Item
diff --git a/lib/reviewable/conversation.rb b/lib/reviewable/conversation.rb
index 9ca7194d280..116c79cc897 100644
--- a/lib/reviewable/conversation.rb
+++ b/lib/reviewable/conversation.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Reviewable < ActiveRecord::Base
class Conversation
include ActiveModel::Serialization
diff --git a/lib/reviewable/editable_fields.rb b/lib/reviewable/editable_fields.rb
index 0106d20e1e2..12aa60fad35 100644
--- a/lib/reviewable/editable_fields.rb
+++ b/lib/reviewable/editable_fields.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'reviewable/collection'
class Reviewable < ActiveRecord::Base
diff --git a/lib/reviewable/perform_result.rb b/lib/reviewable/perform_result.rb
index bc19ba9f0c2..dbaa7fe56cc 100644
--- a/lib/reviewable/perform_result.rb
+++ b/lib/reviewable/perform_result.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Reviewable < ActiveRecord::Base
class PerformResult
include ActiveModel::Serialization
diff --git a/lib/route_format.rb b/lib/route_format.rb
index 14bc0398b1c..b502f8c83f8 100644
--- a/lib/route_format.rb
+++ b/lib/route_format.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module RouteFormat
def self.username
diff --git a/lib/rtl.rb b/lib/rtl.rb
index b6df383b587..2df7acb4fc6 100644
--- a/lib/rtl.rb
+++ b/lib/rtl.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Rtl
attr_reader :user
diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb
index c2c6557092c..3706b24868a 100644
--- a/lib/s3_helper.rb
+++ b/lib/s3_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "aws-sdk-s3"
class S3Helper
@@ -47,6 +49,8 @@ class S3Helper
end
def remove(s3_filename, copy_to_tombstone = false)
+ s3_filename = s3_filename.dup
+
# copy the file in tombstone
if copy_to_tombstone && @tombstone_prefix.present?
self.copy(
diff --git a/lib/score_calculator.rb b/lib/score_calculator.rb
index cdb70afd355..a4e7bfec775 100644
--- a/lib/score_calculator.rb
+++ b/lib/score_calculator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ScoreCalculator
def self.default_score_weights
diff --git a/lib/screening_model.rb b/lib/screening_model.rb
index 62cc0eb8a1a..2e4bfcda115 100644
--- a/lib/screening_model.rb
+++ b/lib/screening_model.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ScreeningModel
extend ActiveSupport::Concern
diff --git a/lib/search.rb b/lib/search.rb
index db25ecd4864..48f54f721e8 100644
--- a/lib/search.rb
+++ b/lib/search.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'search/grouped_search_results'
class Search
diff --git a/lib/search/grouped_search_results.rb b/lib/search/grouped_search_results.rb
index 055682afc82..1cd6dae587e 100644
--- a/lib/search/grouped_search_results.rb
+++ b/lib/search/grouped_search_results.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'sanitize'
class Search
diff --git a/lib/secure_session.rb b/lib/secure_session.rb
index ecb46a6f67e..bced4807d90 100644
--- a/lib/secure_session.rb
+++ b/lib/secure_session.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# session that is not stored in cookie, expires after 1.hour unconditionally
class SecureSession
def initialize(prefix)
diff --git a/lib/seed_data/categories.rb b/lib/seed_data/categories.rb
index abc4a615635..f0617c91291 100644
--- a/lib/seed_data/categories.rb
+++ b/lib/seed_data/categories.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SeedData
class Categories
def self.with_default_locale
diff --git a/lib/seed_data/topics.rb b/lib/seed_data/topics.rb
index 769b20cad62..4f54c5716bd 100644
--- a/lib/seed_data/topics.rb
+++ b/lib/seed_data/topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SeedData
class Topics
def self.with_default_locale
diff --git a/lib/sidekiq/pausable.rb b/lib/sidekiq/pausable.rb
index 79ebf9772c7..132bed3055c 100644
--- a/lib/sidekiq/pausable.rb
+++ b/lib/sidekiq/pausable.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'thread'
class SidekiqPauser
diff --git a/lib/single_sign_on.rb b/lib/single_sign_on.rb
index 359006c4910..4966efff511 100644
--- a/lib/single_sign_on.rb
+++ b/lib/single_sign_on.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SingleSignOn
class ParseError < RuntimeError; end
diff --git a/lib/single_sign_on_provider.rb b/lib/single_sign_on_provider.rb
index a6b6a9e39d9..c55118719bc 100644
--- a/lib/single_sign_on_provider.rb
+++ b/lib/single_sign_on_provider.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'single_sign_on'
class SingleSignOnProvider < SingleSignOn
diff --git a/lib/site_icon_manager.rb b/lib/site_icon_manager.rb
index ae3a21e177c..ea87a8a4644 100644
--- a/lib/site_icon_manager.rb
+++ b/lib/site_icon_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SiteIconManager
extend GlobalPath
diff --git a/lib/site_settings/db_provider.rb b/lib/site_settings/db_provider.rb
index 9300be2dba1..40c3f823e2d 100644
--- a/lib/site_settings/db_provider.rb
+++ b/lib/site_settings/db_provider.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SiteSettings; end
class SiteSettings::DbProvider
diff --git a/lib/site_settings/deprecated_settings.rb b/lib/site_settings/deprecated_settings.rb
index 377e540c842..8e760ae57b5 100644
--- a/lib/site_settings/deprecated_settings.rb
+++ b/lib/site_settings/deprecated_settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SiteSettings; end
module SiteSettings::DeprecatedSettings
diff --git a/lib/site_settings/local_process_provider.rb b/lib/site_settings/local_process_provider.rb
index aaff9f8ed78..50ad937a191 100644
--- a/lib/site_settings/local_process_provider.rb
+++ b/lib/site_settings/local_process_provider.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SiteSettings; end
class SiteSettings::LocalProcessProvider
diff --git a/lib/site_settings/type_supervisor.rb b/lib/site_settings/type_supervisor.rb
index 29fda7075ef..f90a2312410 100644
--- a/lib/site_settings/type_supervisor.rb
+++ b/lib/site_settings/type_supervisor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'site_settings/validations'
require_dependency 'enum'
diff --git a/lib/site_settings/validations.rb b/lib/site_settings/validations.rb
index 327aa7b6807..a9ee77c2cbe 100644
--- a/lib/site_settings/validations.rb
+++ b/lib/site_settings/validations.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SiteSettings; end
module SiteSettings::Validations
diff --git a/lib/site_settings/yaml_loader.rb b/lib/site_settings/yaml_loader.rb
index c9352664dbc..49984f644c2 100644
--- a/lib/site_settings/yaml_loader.rb
+++ b/lib/site_settings/yaml_loader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module SiteSettings; end
class SiteSettings::YamlLoader
diff --git a/lib/slug.rb b/lib/slug.rb
index 27ded2ac9f0..12fe660c436 100644
--- a/lib/slug.rb
+++ b/lib/slug.rb
@@ -1,4 +1,5 @@
# encoding: utf-8
+# frozen_string_literal: true
module Slug
diff --git a/lib/socket_server.rb b/lib/socket_server.rb
index 32865489573..2ae36978e0b 100644
--- a/lib/socket_server.rb
+++ b/lib/socket_server.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'socket'
class SocketServer
@@ -49,7 +51,7 @@ class SocketServer
end
start = Time.now
- line = ""
+ line = +""
while Time.now - start < 10
if IO.select([socket], nil, nil, 10)
diff --git a/lib/source_url.rb b/lib/source_url.rb
index 90a4391f5b1..a7d2ea465a7 100644
--- a/lib/source_url.rb
+++ b/lib/source_url.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SourceURL < Tilt::Template
self.default_mime_type = 'application/javascript'
diff --git a/lib/spam_handler.rb b/lib/spam_handler.rb
index 2b8253512c3..77e189fb640 100644
--- a/lib/spam_handler.rb
+++ b/lib/spam_handler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SpamHandler
def self.should_prevent_registration_from_ip?(ip_address)
diff --git a/lib/sql_builder.rb b/lib/sql_builder.rb
index fdf0a8582e4..669cf177160 100644
--- a/lib/sql_builder.rb
+++ b/lib/sql_builder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SqlBuilder
def initialize(template, klass = nil)
diff --git a/lib/staff_constraint.rb b/lib/staff_constraint.rb
index 4d46de3399d..a310cc65ad8 100644
--- a/lib/staff_constraint.rb
+++ b/lib/staff_constraint.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'current_user'
class StaffConstraint
diff --git a/lib/staff_message_format.rb b/lib/staff_message_format.rb
index e6005d0fac1..aed85227b02 100644
--- a/lib/staff_message_format.rb
+++ b/lib/staff_message_format.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This is used for formatting Suspension/Silencing messages.
# It can be extended by plugins to provide custom message formats.
class StaffMessageFormat
@@ -15,7 +17,7 @@ class StaffMessageFormat
# Overwrite this to change formatting
def format
- result = ""
+ result = +""
result << @reason if @reason.present?
result << "\n\n#{@message}" if @message.present?
result
diff --git a/lib/stylesheet/common.rb b/lib/stylesheet/common.rb
index e133e7cd2d0..880d1945a53 100644
--- a/lib/stylesheet/common.rb
+++ b/lib/stylesheet/common.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'sassc'
module Stylesheet
diff --git a/lib/stylesheet/compiler.rb b/lib/stylesheet/compiler.rb
index 3b05f70a2d3..19925513a38 100644
--- a/lib/stylesheet/compiler.rb
+++ b/lib/stylesheet/compiler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'stylesheet/common'
require_dependency 'stylesheet/importer'
require_dependency 'stylesheet/functions'
diff --git a/lib/stylesheet/functions.rb b/lib/stylesheet/functions.rb
index 4d2f7c4e1ff..fa1c3330d33 100644
--- a/lib/stylesheet/functions.rb
+++ b/lib/stylesheet/functions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Stylesheet
module ScssFunctions
def asset_url(path)
diff --git a/lib/stylesheet/importer.rb b/lib/stylesheet/importer.rb
index 2e19d7d229d..473bec80a74 100644
--- a/lib/stylesheet/importer.rb
+++ b/lib/stylesheet/importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'stylesheet/common'
require_dependency 'global_path'
@@ -34,18 +36,17 @@ module Stylesheet
end
register_import "theme_colors" do
- contents = ""
+ contents = +""
colors = (@theme_id && theme.color_scheme) ? theme.color_scheme.resolved_colors : ColorScheme.base_colors
colors.each do |n, hex|
contents << "$#{n}: ##{hex} !default;\n"
end
- contents
Import.new("theme_colors.scss", source: contents)
end
register_import "theme_variables" do
- contents = ""
+ contents = +""
theme&.all_theme_variables&.each do |field|
if field.type_id == ThemeField.types[:theme_upload_var]
@@ -66,7 +67,7 @@ module Stylesheet
end
register_import "category_backgrounds" do
- contents = ""
+ contents = +""
Category.where('uploaded_background_id IS NOT NULL').each do |c|
contents << category_css(c) if c.uploaded_background&.url.present?
end
diff --git a/lib/stylesheet/manager.rb b/lib/stylesheet/manager.rb
index bea70ed1c78..bd7ccc8b443 100644
--- a/lib/stylesheet/manager.rb
+++ b/lib/stylesheet/manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'distributed_cache'
require_dependency 'stylesheet/compiler'
diff --git a/lib/stylesheet/watcher.rb b/lib/stylesheet/watcher.rb
index 7d73ec51160..1bfc7c2994e 100644
--- a/lib/stylesheet/watcher.rb
+++ b/lib/stylesheet/watcher.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'listen'
module Stylesheet
diff --git a/lib/suggested_topics_builder.rb b/lib/suggested_topics_builder.rb
index 4d5888db8ea..701922b7088 100644
--- a/lib/suggested_topics_builder.rb
+++ b/lib/suggested_topics_builder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'topic_list'
class SuggestedTopicsBuilder
diff --git a/lib/system_message.rb b/lib/system_message.rb
index 4d10c554ae3..14b70fcfb9e 100644
--- a/lib/system_message.rb
+++ b/lib/system_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Handle sending a message to a user from the system.
require_dependency 'post_creator'
require_dependency 'topic_subtype'
diff --git a/lib/tasks/add_topic_to_quotes.rake b/lib/tasks/add_topic_to_quotes.rake
index ff36e46bf06..12dfbe498f4 100644
--- a/lib/tasks/add_topic_to_quotes.rake
+++ b/lib/tasks/add_topic_to_quotes.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "Add the topic to quotes"
task "add_topic_to_quotes" => :environment do
Post.where("raw like '%topic:%'").each do |p|
diff --git a/lib/tasks/admin.rake b/lib/tasks/admin.rake
index 6c8ae0b8f45..b323e52668e 100644
--- a/lib/tasks/admin.rake
+++ b/lib/tasks/admin.rake
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
desc "invite an admin to this discourse instance"
task "admin:invite", [:email] => [:environment] do |_, args|
diff --git a/lib/tasks/api.rake b/lib/tasks/api.rake
index 5a4ef6c85e0..8bff7dd5a2a 100644
--- a/lib/tasks/api.rake
+++ b/lib/tasks/api.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "generate api key if missing, return existing if already there"
task "api_key:get" => :environment do
api_key = ApiKey.create_master_key
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index d5d028c37f1..9fe3a485d60 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
task 'assets:precompile:before' do
require 'uglifier'
diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake
index e80e9015377..95f3090d1bc 100644
--- a/lib/tasks/auto_annotate_models.rake
+++ b/lib/tasks/auto_annotate_models.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# NOTE: only doing this in development as some production environments (Heroku)
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
diff --git a/lib/tasks/autospec.rake b/lib/tasks/autospec.rake
index 2f1de2c4863..895eb6da20b 100644
--- a/lib/tasks/autospec.rake
+++ b/lib/tasks/autospec.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# I like guard, don't get me wrong, but it is just not working right
# architectually it can not do what I want it to do, this is how I want
# it to behave
diff --git a/lib/tasks/avatars.rake b/lib/tasks/avatars.rake
index 5b045d29ff9..7ccb1fe2f01 100644
--- a/lib/tasks/avatars.rake
+++ b/lib/tasks/avatars.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "Refresh all avatars (download missing gravatars, refresh system)"
task "avatars:refresh" => :environment do
i = 0
diff --git a/lib/tasks/backfill.thor b/lib/tasks/backfill.thor
index 44afebbda59..6690de54bac 100644
--- a/lib/tasks/backfill.thor
+++ b/lib/tasks/backfill.thor
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Backfill < Thor
desc "link_titles", "Backfills link titles"
diff --git a/lib/tasks/build.rake b/lib/tasks/build.rake
index 443d675a61f..3f719c8ea24 100644
--- a/lib/tasks/build.rake
+++ b/lib/tasks/build.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "stamp the current build with the git hash placed in version.rb"
task "build:stamp" => :environment do
git_version = `git rev-parse HEAD`.strip
diff --git a/lib/tasks/build_test_topic.rake b/lib/tasks/build_test_topic.rake
index 7c64a76566e..4e34d882169 100644
--- a/lib/tasks/build_test_topic.rake
+++ b/lib/tasks/build_test_topic.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Build a test topic full of links to test our replaceState/pushState functionality.
desc 'create pushstate/replacestate test topic'
diff --git a/lib/tasks/categories.rake b/lib/tasks/categories.rake
index 87e5fc878a0..97341f59b8b 100644
--- a/lib/tasks/categories.rake
+++ b/lib/tasks/categories.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
task "categories:move_topics", [:from_category, :to_category] => [:environment] do |_, args|
from_category_id = args[:from_category]
to_category_id = args[:to_category]
diff --git a/lib/tasks/cdn.rake b/lib/tasks/cdn.rake
index 0e13c3ae8c7..438e1020fce 100644
--- a/lib/tasks/cdn.rake
+++ b/lib/tasks/cdn.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# cdn related tasks
#
desc 'pre-stage assets on cdn'
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index 0b464d8435e..33b2fd04989 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# we should set the locale before the migration
task 'set_locale' do
begin
diff --git a/lib/tasks/destroy.rake b/lib/tasks/destroy.rake
index ffcf829df47..767f14370c9 100644
--- a/lib/tasks/destroy.rake
+++ b/lib/tasks/destroy.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
## These tasks are destructive and are for clearing out all the
# content and users from your site, but keeping your site settings,
# theme, and category structure.
diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake
index 95d81aaafe1..b35a2b655ef 100644
--- a/lib/tasks/docker.rake
+++ b/lib/tasks/docker.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# rake docker:test is designed to be used inside the discourse/docker_test image
# running it anywhere else will likely fail
#
diff --git a/lib/tasks/emails.rake b/lib/tasks/emails.rake
index b6db20f18a8..73be7343635 100644
--- a/lib/tasks/emails.rake
+++ b/lib/tasks/emails.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
def process_popmail(popmail)
begin
mail_string = popmail.pop
diff --git a/lib/tasks/emoji.rake b/lib/tasks/emoji.rake
index a8a7f68f6c0..ad05c0d1b24 100644
--- a/lib/tasks/emoji.rake
+++ b/lib/tasks/emoji.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "active_support/test_case"
require "fileutils"
require "json"
diff --git a/lib/tasks/export.rake b/lib/tasks/export.rake
index 121a8647716..d1d4e3826da 100644
--- a/lib/tasks/export.rake
+++ b/lib/tasks/export.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc 'Export all the categories'
task 'export:categories', [:category_ids] => [:environment] do |_, args|
require "import_export/import_export"
diff --git a/lib/tasks/i18n.rake b/lib/tasks/i18n.rake
index 17e8cb4c8b9..64fce0e1483 100644
--- a/lib/tasks/i18n.rake
+++ b/lib/tasks/i18n.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'i18n/locale_file_checker'
require 'seed_data/categories'
require 'seed_data/topics'
diff --git a/lib/tasks/images.rake b/lib/tasks/images.rake
index ff587a72162..b7af043ddf8 100644
--- a/lib/tasks/images.rake
+++ b/lib/tasks/images.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "file_helper"
task "images:compress" => :environment do
diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake
index d5de7b792dc..e54ed4260df 100644
--- a/lib/tasks/import.rake
+++ b/lib/tasks/import.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Use http://tatiyants.com/pev/#/plans/new if you want to optimize a query
task "import:ensure_consistency" => :environment do
diff --git a/lib/tasks/integration.rake b/lib/tasks/integration.rake
index 32e2a8d1e98..3b01602bcb4 100644
--- a/lib/tasks/integration.rake
+++ b/lib/tasks/integration.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'open-uri'
desc 'Creates the integration fixtures. Requires a development instance running.'
diff --git a/lib/tasks/javascript.rake b/lib/tasks/javascript.rake
index 8ab18c7345c..5b9663b6376 100644
--- a/lib/tasks/javascript.rake
+++ b/lib/tasks/javascript.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
def public_js
"#{Rails.root}/public/javascripts"
end
diff --git a/lib/tasks/maxminddb.rake b/lib/tasks/maxminddb.rake
index 90961c52c06..5023f1a98fb 100644
--- a/lib/tasks/maxminddb.rake
+++ b/lib/tasks/maxminddb.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'discourse_ip_info'
desc "downloads MaxMind's GeoLite2-City database"
diff --git a/lib/tasks/plugin.rake b/lib/tasks/plugin.rake
index afd36da4302..a093bc86ec5 100644
--- a/lib/tasks/plugin.rake
+++ b/lib/tasks/plugin.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
directory 'plugins'
desc 'install all official plugins (use GIT_WRITE=1 to pull with write access)'
diff --git a/lib/tasks/populate.thor b/lib/tasks/populate.thor
index 3c308d2a707..3aa40e3399d 100644
--- a/lib/tasks/populate.thor
+++ b/lib/tasks/populate.thor
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Generates posts and topics
class Populate < Thor
desc "posts", "Generate posts"
diff --git a/lib/tasks/posts.rake b/lib/tasks/posts.rake
index e4adc8012a2..91da0789a16 100644
--- a/lib/tasks/posts.rake
+++ b/lib/tasks/posts.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'file_store/local_store'
desc 'Update each post with latest markdown'
diff --git a/lib/tasks/qunit.rake b/lib/tasks/qunit.rake
index a34bd92cd9a..4968840018d 100644
--- a/lib/tasks/qunit.rake
+++ b/lib/tasks/qunit.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "Runs the qunit test suite"
task "qunit:test", [:timeout, :qunit_path] => :environment do |_, args|
diff --git a/lib/tasks/redis.rake b/lib/tasks/redis.rake
index 4300f0686cb..08e352cfc3b 100644
--- a/lib/tasks/redis.rake
+++ b/lib/tasks/redis.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
task 'redis:clean_up' => ['environment'] do
return unless Rails.configuration.multisite
diff --git a/lib/tasks/release_note.rake b/lib/tasks/release_note.rake
index 4023727d45d..0920be79a59 100644
--- a/lib/tasks/release_note.rake
+++ b/lib/tasks/release_note.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "generate a release note from the important commits"
task "release_note:generate", :from, :to do |t, args|
from = args[:from] || `git describe --tags --abbrev=0`.strip
diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake
index 7977e387301..87275a1f940 100644
--- a/lib/tasks/rspec.rake
+++ b/lib/tasks/rspec.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if Rails.env.development? || Rails.env.test?
require 'rspec/core/rake_task'
diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rake
index 69c854827a2..0389f9cfc56 100644
--- a/lib/tasks/s3.rake
+++ b/lib/tasks/s3.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "s3_helper"
def brotli_s3_path(path)
diff --git a/lib/tasks/scheduler.rake b/lib/tasks/scheduler.rake
index ea28b3aabec..4b38e4d69bc 100644
--- a/lib/tasks/scheduler.rake
+++ b/lib/tasks/scheduler.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "This task is called by the Heroku scheduler add-on"
task enqueue_digest_emails: :environment do
diff --git a/lib/tasks/search.rake b/lib/tasks/search.rake
index bb609dff673..ce2bad6f3cb 100644
--- a/lib/tasks/search.rake
+++ b/lib/tasks/search.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
task "search:reindex" => :environment do
ENV['RAILS_DB'] ? reindex_search : reindex_search_all_sites
end
diff --git a/lib/tasks/site_settings.rake b/lib/tasks/site_settings.rake
index fd159c1ccf6..85447443a18 100644
--- a/lib/tasks/site_settings.rake
+++ b/lib/tasks/site_settings.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'yaml'
desc "Exports site settings"
diff --git a/lib/tasks/smoke_test.rake b/lib/tasks/smoke_test.rake
index d84de7c576d..c547f3c803a 100644
--- a/lib/tasks/smoke_test.rake
+++ b/lib/tasks/smoke_test.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "run chrome headless smoke tests on current build"
task "smoke:test" do
unless system("command -v google-chrome >/dev/null;")
diff --git a/lib/tasks/svg_icons.rake b/lib/tasks/svg_icons.rake
index e0c203fc12c..cfb4defb504 100644
--- a/lib/tasks/svg_icons.rake
+++ b/lib/tasks/svg_icons.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
def vendor_svgs
"#{Rails.root}/vendor/assets/svg-icons"
end
diff --git a/lib/tasks/tags.rake b/lib/tasks/tags.rake
index 3c10614a4b4..192d08628be 100644
--- a/lib/tasks/tags.rake
+++ b/lib/tasks/tags.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
task "tags:bulk_tag_category", [:tags, :category] => [:environment] do |_, args|
tags = args[:tags].split("|")
category_id = args[:category]
diff --git a/lib/tasks/topics.rake b/lib/tasks/topics.rake
index bbbf56ac797..43b6a21b3db 100644
--- a/lib/tasks/topics.rake
+++ b/lib/tasks/topics.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
def print_status_with_label(label, current, max)
print "\r%s%9d / %d (%5.1f%%)" % [label, current, max, ((current.to_f / max.to_f) * 100).round(1)]
end
diff --git a/lib/tasks/typepad.thor b/lib/tasks/typepad.thor
index 94bda6ca67c..df2a2cb311e 100644
--- a/lib/tasks/typepad.thor
+++ b/lib/tasks/typepad.thor
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'open-uri'
class Typepad < Thor
diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index a4b85c18dd9..1012d13c629 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "db_helper"
require "digest/sha1"
require "base62"
diff --git a/lib/tasks/user_actions.rake b/lib/tasks/user_actions.rake
index 555e894b79c..2d2631d1f3a 100644
--- a/lib/tasks/user_actions.rake
+++ b/lib/tasks/user_actions.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "rebuild the user_actions table"
task "user_actions:rebuild" => :environment do
MessageBus.off
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake
index 78f4fb6c74a..b737405c5a4 100644
--- a/lib/tasks/users.rake
+++ b/lib/tasks/users.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
desc "Change topic/post ownership of all the topics/posts by a specific user (without creating new revision)"
task "users:change_post_ownership", [:old_username, :new_username, :archetype] => [:environment] do |_, args|
old_username = args[:old_username]
diff --git a/lib/text_sentinel.rb b/lib/text_sentinel.rb
index 4c5e92a84e2..b3d9abb4316 100644
--- a/lib/text_sentinel.rb
+++ b/lib/text_sentinel.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Whe use ActiveSupport mb_chars from here to properly support non ascii downcase
# TODO remove when ruby 2.4 lands
require 'active_support/core_ext/string/multibyte'
diff --git a/lib/theme_javascript_compiler.rb b/lib/theme_javascript_compiler.rb
index 7abe3f7da71..4bbdec5fa4f 100644
--- a/lib/theme_javascript_compiler.rb
+++ b/lib/theme_javascript_compiler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeJavascriptCompiler
module PrecompilerExtension
@@ -147,7 +149,7 @@ class ThemeJavascriptCompiler
def initialize(theme_id)
@theme_id = theme_id
- @content = ""
+ @content = +""
end
def prepend_settings(settings_hash)
diff --git a/lib/theme_settings_manager.rb b/lib/theme_settings_manager.rb
index c59b1481e61..ec19e42c9d0 100644
--- a/lib/theme_settings_manager.rb
+++ b/lib/theme_settings_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeSettingsManager
attr_reader :name, :theme, :default
diff --git a/lib/theme_settings_parser.rb b/lib/theme_settings_parser.rb
index ab2ee4396cf..56929ae5370 100644
--- a/lib/theme_settings_parser.rb
+++ b/lib/theme_settings_parser.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeSettingsParser
class InvalidYaml < StandardError; end
diff --git a/lib/theme_store/git_importer.rb b/lib/theme_store/git_importer.rb
index 5b7a0268a9f..f81e95e0402 100644
--- a/lib/theme_store/git_importer.rb
+++ b/lib/theme_store/git_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'theme_store/tgz_exporter'
module ThemeStore; end
diff --git a/lib/theme_store/tgz_exporter.rb b/lib/theme_store/tgz_exporter.rb
index 7359829dc05..824a874ab94 100644
--- a/lib/theme_store/tgz_exporter.rb
+++ b/lib/theme_store/tgz_exporter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ThemeStore; end
class ThemeStore::TgzExporter
diff --git a/lib/theme_store/tgz_importer.rb b/lib/theme_store/tgz_importer.rb
index fa986de21aa..5dfb0716e68 100644
--- a/lib/theme_store/tgz_importer.rb
+++ b/lib/theme_store/tgz_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ThemeStore; end
class ThemeStore::TgzImporter
diff --git a/lib/theme_translation_manager.rb b/lib/theme_translation_manager.rb
index df686d0193d..2fd7a9644cc 100644
--- a/lib/theme_translation_manager.rb
+++ b/lib/theme_translation_manager.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeTranslationManager
include ActiveModel::Serialization
attr_reader :key, :default, :theme
diff --git a/lib/theme_translation_parser.rb b/lib/theme_translation_parser.rb
index 0264790a0e9..b1daaf4a626 100644
--- a/lib/theme_translation_parser.rb
+++ b/lib/theme_translation_parser.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ThemeTranslationParser
INTERNAL_KEYS = [:theme_metadata]
class InvalidYaml < StandardError; end
diff --git a/lib/timeline_lookup.rb b/lib/timeline_lookup.rb
index 3a62ba9ef6e..2e6cf57c82b 100644
--- a/lib/timeline_lookup.rb
+++ b/lib/timeline_lookup.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module TimelineLookup
# Given an array of tuples containing (id, days_ago), return at most `max_values` worth of a
diff --git a/lib/topic_creator.rb b/lib/topic_creator.rb
index 66c3d09520e..c45a870599a 100644
--- a/lib/topic_creator.rb
+++ b/lib/topic_creator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'has_errors'
class TopicCreator
diff --git a/lib/topic_list_responder.rb b/lib/topic_list_responder.rb
index b53380345f6..c590e250ff2 100644
--- a/lib/topic_list_responder.rb
+++ b/lib/topic_list_responder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Helps us respond with a topic list from a controller
module TopicListResponder
diff --git a/lib/topic_publisher.rb b/lib/topic_publisher.rb
index f9934e98765..b78b58bd11f 100644
--- a/lib/topic_publisher.rb
+++ b/lib/topic_publisher.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicPublisher
def initialize(topic, published_by, category_id)
diff --git a/lib/topic_query.rb b/lib/topic_query.rb
index 2a25c212cec..10646e3ae02 100644
--- a/lib/topic_query.rb
+++ b/lib/topic_query.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#
# Helps us find topics.
# Returns a TopicList object containing the topics found.
@@ -393,8 +395,14 @@ class TopicQuery
end
def prioritize_pinned_topics(topics, options)
- pinned_clause = options[:category_id] ? "topics.category_id = #{options[:category_id].to_i} AND" : "pinned_globally AND "
+ pinned_clause = if options[:category_id]
+ +"topics.category_id = #{options[:category_id].to_i} AND"
+ else
+ +"pinned_globally AND "
+ end
+
pinned_clause << " pinned_at IS NOT NULL "
+
if @user
pinned_clause << " AND (topics.pinned_at > tu.cleared_pinned_at OR tu.cleared_pinned_at IS NULL)"
end
diff --git a/lib/topic_retriever.rb b/lib/topic_retriever.rb
index 1addac713f5..bd8bcff9f36 100644
--- a/lib/topic_retriever.rb
+++ b/lib/topic_retriever.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicRetriever
def initialize(embed_url, opts = nil)
diff --git a/lib/topic_subtype.rb b/lib/topic_subtype.rb
index 731ed29c3e0..c20f639271e 100644
--- a/lib/topic_subtype.rb
+++ b/lib/topic_subtype.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicSubtype
include ActiveModel::Serialization
diff --git a/lib/topic_view.rb b/lib/topic_view.rb
index 5079a9f05a7..e9b125050d8 100644
--- a/lib/topic_view.rb
+++ b/lib/topic_view.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'guardian'
require_dependency 'topic_query'
require_dependency 'filter_best_posts'
@@ -107,7 +109,7 @@ class TopicView
end
def canonical_path
- path = relative_url
+ path = relative_url.dup
path <<
if @page > 1
"?page=#{@page}"
diff --git a/lib/topics_bulk_action.rb b/lib/topics_bulk_action.rb
index 0db1bb154bb..207f2f0259f 100644
--- a/lib/topics_bulk_action.rb
+++ b/lib/topics_bulk_action.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicsBulkAction
def initialize(user, topic_ids, operation, options = {})
diff --git a/lib/trust_level.rb b/lib/trust_level.rb
index a3044bcdd3b..f3dcd55084b 100644
--- a/lib/trust_level.rb
+++ b/lib/trust_level.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'enum'
class InvalidTrustLevel < StandardError; end
diff --git a/lib/twitter_api.rb b/lib/twitter_api.rb
index d71d8458886..b662c433c48 100644
--- a/lib/twitter_api.rb
+++ b/lib/twitter_api.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# lightweight Twitter api calls
class TwitterApi
diff --git a/lib/unread.rb b/lib/unread.rb
index 36a7d09e816..b37dc06ed90 100644
--- a/lib/unread.rb
+++ b/lib/unread.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Unread
# This module helps us calculate unread and new post counts
diff --git a/lib/upload_creator.rb b/lib/upload_creator.rb
index 397016bee0e..ffae64ec4dd 100644
--- a/lib/upload_creator.rb
+++ b/lib/upload_creator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "fastimage"
require_dependency "image_sizer"
diff --git a/lib/upload_fixer.rb b/lib/upload_fixer.rb
index 1bf85b0b89e..e1846466601 100644
--- a/lib/upload_fixer.rb
+++ b/lib/upload_fixer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UploadFixer
def self.fix_all_extensions
Upload.where("uploads.extension IS NOT NULL").find_each do |upload|
diff --git a/lib/upload_recovery.rb b/lib/upload_recovery.rb
index 83acb51aced..a4d04336274 100644
--- a/lib/upload_recovery.rb
+++ b/lib/upload_recovery.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UploadRecovery
def initialize(dry_run: false)
@dry_run = dry_run
diff --git a/lib/url_helper.rb b/lib/url_helper.rb
index 0756a0b122a..0c69d287820 100644
--- a/lib/url_helper.rb
+++ b/lib/url_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UrlHelper
# At the moment this handles invalid URLs that browser address bar accepts
@@ -24,7 +26,7 @@ class UrlHelper
end
def self.absolute(url, cdn = Discourse.asset_host)
- cdn = "https:" << cdn if cdn && cdn =~ /^\/\//
+ cdn = "https:#{cdn}" if cdn && cdn =~ /^\/\//
url =~ /^\/[^\/]/ ? (cdn || Discourse.base_url_no_prefix) + url : url
end
diff --git a/lib/validators/allow_user_locale_enabled_validator.rb b/lib/validators/allow_user_locale_enabled_validator.rb
index 09a283212c4..0998950a2bd 100644
--- a/lib/validators/allow_user_locale_enabled_validator.rb
+++ b/lib/validators/allow_user_locale_enabled_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class AllowUserLocaleEnabledValidator
def initialize(opts = {})
diff --git a/lib/validators/allowed_ip_address_validator.rb b/lib/validators/allowed_ip_address_validator.rb
index fec0e61c61b..c0a50e7e830 100644
--- a/lib/validators/allowed_ip_address_validator.rb
+++ b/lib/validators/allowed_ip_address_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "spam_handler"
class AllowedIpAddressValidator < ActiveModel::EachValidator
diff --git a/lib/validators/alternative_reply_by_email_addresses_validator.rb b/lib/validators/alternative_reply_by_email_addresses_validator.rb
index 97b9ddad12f..106828025d5 100644
--- a/lib/validators/alternative_reply_by_email_addresses_validator.rb
+++ b/lib/validators/alternative_reply_by_email_addresses_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'validators/reply_by_email_address_validator'
class AlternativeReplyByEmailAddressesValidator
diff --git a/lib/validators/category_search_priority_weights_validator.rb b/lib/validators/category_search_priority_weights_validator.rb
index 14ea809b5ff..565a0b327c1 100644
--- a/lib/validators/category_search_priority_weights_validator.rb
+++ b/lib/validators/category_search_priority_weights_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CategorySearchPriorityWeightsValidator
def initialize(opts = {})
@name = opts[:name].to_s
diff --git a/lib/validators/censored_words_validator.rb b/lib/validators/censored_words_validator.rb
index b2c70bc931b..d36a0931d8c 100644
--- a/lib/validators/censored_words_validator.rb
+++ b/lib/validators/censored_words_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CensoredWordsValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
if WordWatcher.words_for_action(:censor).present? && (censored_words = censor_words(value, censored_words_regexp)).present?
diff --git a/lib/validators/color_list_validator.rb b/lib/validators/color_list_validator.rb
index dce170b8de6..be6395564df 100644
--- a/lib/validators/color_list_validator.rb
+++ b/lib/validators/color_list_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ColorListValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/email_setting_validator.rb b/lib/validators/email_setting_validator.rb
index e44725396d3..0d4c98552a7 100644
--- a/lib/validators/email_setting_validator.rb
+++ b/lib/validators/email_setting_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmailSettingValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/email_validator.rb b/lib/validators/email_validator.rb
index 624ee071c88..46d47f8f0df 100644
--- a/lib/validators/email_validator.rb
+++ b/lib/validators/email_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EmailValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
diff --git a/lib/validators/enable_invite_only_validator.rb b/lib/validators/enable_invite_only_validator.rb
index d9101c309a8..63fd259bc08 100644
--- a/lib/validators/enable_invite_only_validator.rb
+++ b/lib/validators/enable_invite_only_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnableInviteOnlyValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/enable_local_logins_via_email_validator.rb b/lib/validators/enable_local_logins_via_email_validator.rb
index 0537f3697e7..46021e9b244 100644
--- a/lib/validators/enable_local_logins_via_email_validator.rb
+++ b/lib/validators/enable_local_logins_via_email_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnableLocalLoginsViaEmailValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/enable_private_email_messages_validator.rb b/lib/validators/enable_private_email_messages_validator.rb
index 42e8aa64e8f..932b63f5ada 100644
--- a/lib/validators/enable_private_email_messages_validator.rb
+++ b/lib/validators/enable_private_email_messages_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnablePrivateEmailMessagesValidator
def initialize(opts = {})
diff --git a/lib/validators/enable_sso_validator.rb b/lib/validators/enable_sso_validator.rb
index 5204bb5b863..e119cc29ba6 100644
--- a/lib/validators/enable_sso_validator.rb
+++ b/lib/validators/enable_sso_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class EnableSsoValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/external_system_avatars_validator.rb b/lib/validators/external_system_avatars_validator.rb
index 663da04d4fa..2b0a4a7502a 100644
--- a/lib/validators/external_system_avatars_validator.rb
+++ b/lib/validators/external_system_avatars_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ExternalSystemAvatarsValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/group_setting_validator.rb b/lib/validators/group_setting_validator.rb
index 01ba5756267..31be1eb3178 100644
--- a/lib/validators/group_setting_validator.rb
+++ b/lib/validators/group_setting_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GroupSettingValidator
def initialize(opts = {})
diff --git a/lib/validators/integer_setting_validator.rb b/lib/validators/integer_setting_validator.rb
index 630f3c08e31..0d785f202f5 100644
--- a/lib/validators/integer_setting_validator.rb
+++ b/lib/validators/integer_setting_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class IntegerSettingValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/ip_address_format_validator.rb b/lib/validators/ip_address_format_validator.rb
index 89b231c268d..53ee97210f1 100644
--- a/lib/validators/ip_address_format_validator.rb
+++ b/lib/validators/ip_address_format_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Allows unique IP address (10.0.1.20), and IP addresses with a mask (10.0.0.0/8).
# Useful when storing in a Postgresql inet column.
class IpAddressFormatValidator < ActiveModel::EachValidator
diff --git a/lib/validators/max_emojis_validator.rb b/lib/validators/max_emojis_validator.rb
index 8db71afa572..87d6b10b749 100644
--- a/lib/validators/max_emojis_validator.rb
+++ b/lib/validators/max_emojis_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MaxEmojisValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
diff --git a/lib/validators/max_username_length_validator.rb b/lib/validators/max_username_length_validator.rb
index da3acced68d..c871cc32425 100644
--- a/lib/validators/max_username_length_validator.rb
+++ b/lib/validators/max_username_length_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MaxUsernameLengthValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/min_username_length_validator.rb b/lib/validators/min_username_length_validator.rb
index 09d25ef8fea..1c4dca7e7d8 100644
--- a/lib/validators/min_username_length_validator.rb
+++ b/lib/validators/min_username_length_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MinUsernameLengthValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/password_validator.rb b/lib/validators/password_validator.rb
index d5d24ada8ee..45a4dab2563 100644
--- a/lib/validators/password_validator.rb
+++ b/lib/validators/password_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "common_passwords/common_passwords"
class PasswordValidator < ActiveModel::EachValidator
diff --git a/lib/validators/pop3_polling_enabled_setting_validator.rb b/lib/validators/pop3_polling_enabled_setting_validator.rb
index 0b79dc8d889..d0bf382b11d 100644
--- a/lib/validators/pop3_polling_enabled_setting_validator.rb
+++ b/lib/validators/pop3_polling_enabled_setting_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "net/pop"
class POP3PollingEnabledSettingValidator
diff --git a/lib/validators/post_validator.rb b/lib/validators/post_validator.rb
index df2e8b1ec90..e566e006a72 100644
--- a/lib/validators/post_validator.rb
+++ b/lib/validators/post_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'validators/stripped_length_validator'
module Validators; end
diff --git a/lib/validators/quality_title_validator.rb b/lib/validators/quality_title_validator.rb
index 598e78782f8..d7c8ebbf5bb 100644
--- a/lib/validators/quality_title_validator.rb
+++ b/lib/validators/quality_title_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'text_sentinel'
require 'text_cleaner'
diff --git a/lib/validators/regex_presence_validator.rb b/lib/validators/regex_presence_validator.rb
index fcdeb4ddadc..09345ef66f3 100644
--- a/lib/validators/regex_presence_validator.rb
+++ b/lib/validators/regex_presence_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RegexPresenceValidator
include RegexSettingValidation
diff --git a/lib/validators/regex_setting_validation.rb b/lib/validators/regex_setting_validation.rb
index cd0df29f49c..2dd738d0a8d 100644
--- a/lib/validators/regex_setting_validation.rb
+++ b/lib/validators/regex_setting_validation.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module RegexSettingValidation
def initialize_regex_opts(opts = {})
diff --git a/lib/validators/regex_setting_validator.rb b/lib/validators/regex_setting_validator.rb
index 895342372aa..aec1dbc1a6e 100644
--- a/lib/validators/regex_setting_validator.rb
+++ b/lib/validators/regex_setting_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RegexSettingValidator
LOREM = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eget sem non elit tincidunt rhoncus.'.freeze
diff --git a/lib/validators/reply_by_email_enabled_validator.rb b/lib/validators/reply_by_email_enabled_validator.rb
index 8170a129354..cd3886ed70c 100644
--- a/lib/validators/reply_by_email_enabled_validator.rb
+++ b/lib/validators/reply_by_email_enabled_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ReplyByEmailEnabledValidator
def initialize(opts = {})
diff --git a/lib/validators/sso_overrides_email_validator.rb b/lib/validators/sso_overrides_email_validator.rb
index 202cfc7b00c..c9636a0e99d 100644
--- a/lib/validators/sso_overrides_email_validator.rb
+++ b/lib/validators/sso_overrides_email_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SsoOverridesEmailValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/string_setting_validator.rb b/lib/validators/string_setting_validator.rb
index e2dda644587..d544fd2423e 100644
--- a/lib/validators/string_setting_validator.rb
+++ b/lib/validators/string_setting_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class StringSettingValidator
include RegexSettingValidation
diff --git a/lib/validators/stripped_length_validator.rb b/lib/validators/stripped_length_validator.rb
index f2f60f61fb5..e65b7d2e7fa 100644
--- a/lib/validators/stripped_length_validator.rb
+++ b/lib/validators/stripped_length_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Validators; end
class Validators::StrippedLengthValidator < ActiveModel::EachValidator
def self.validate(record, attribute, value, range)
diff --git a/lib/validators/topic_title_length_validator.rb b/lib/validators/topic_title_length_validator.rb
index 6e4a1d17017..cf74ab25991 100644
--- a/lib/validators/topic_title_length_validator.rb
+++ b/lib/validators/topic_title_length_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TopicTitleLengthValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
diff --git a/lib/validators/unicode_username_validator.rb b/lib/validators/unicode_username_validator.rb
index 9b81f9235ee..a2d26b791eb 100644
--- a/lib/validators/unicode_username_validator.rb
+++ b/lib/validators/unicode_username_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UnicodeUsernameValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/unicode_username_whitelist_validator.rb b/lib/validators/unicode_username_whitelist_validator.rb
index f3e4691f8f7..21aabe6eee2 100644
--- a/lib/validators/unicode_username_whitelist_validator.rb
+++ b/lib/validators/unicode_username_whitelist_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UnicodeUsernameWhitelistValidator
def initialize(opts = {})
@opts = opts
diff --git a/lib/validators/unique_among_validator.rb b/lib/validators/unique_among_validator.rb
index 3aada1bd0c9..82fed5c206c 100644
--- a/lib/validators/unique_among_validator.rb
+++ b/lib/validators/unique_among_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UniqueAmongValidator < ActiveRecord::Validations::UniquenessValidator
def validate_each(record, attribute, value)
old_errors = record.errors[attribute].size
diff --git a/lib/validators/upload_validator.rb b/lib/validators/upload_validator.rb
index bc6c2ca239f..5c785c2e145 100644
--- a/lib/validators/upload_validator.rb
+++ b/lib/validators/upload_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency "file_helper"
module Validators; end
diff --git a/lib/validators/url_validator.rb b/lib/validators/url_validator.rb
index eec84ea3b9f..4e56f81f264 100644
--- a/lib/validators/url_validator.rb
+++ b/lib/validators/url_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
if value.present?
diff --git a/lib/validators/user_full_name_validator.rb b/lib/validators/user_full_name_validator.rb
index ec994c5c37e..df1777a1a90 100644
--- a/lib/validators/user_full_name_validator.rb
+++ b/lib/validators/user_full_name_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UserFullNameValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
diff --git a/lib/validators/username_setting_validator.rb b/lib/validators/username_setting_validator.rb
index 52ae5abd050..22d2b9cb399 100644
--- a/lib/validators/username_setting_validator.rb
+++ b/lib/validators/username_setting_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class UsernameSettingValidator
include RegexSettingValidation
diff --git a/lib/version.rb b/lib/version.rb
index d2221146683..651dc030743 100644
--- a/lib/version.rb
+++ b/lib/version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Discourse
VERSION_REGEXP = /\A\d+\.\d+\.\d+(\.beta\d+)?\z/ unless defined? ::Discourse::VERSION_REGEXP
diff --git a/lib/wizard.rb b/lib/wizard.rb
index d577c2aa29a..06f507ca8e6 100644
--- a/lib/wizard.rb
+++ b/lib/wizard.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'wizard/step'
require_dependency 'wizard/field'
require_dependency 'wizard/step_updater'
diff --git a/lib/wizard/builder.rb b/lib/wizard/builder.rb
index c43af1f3369..65f6519c582 100644
--- a/lib/wizard/builder.rb
+++ b/lib/wizard/builder.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'introduction_updater'
require_dependency 'emoji_set_site_setting'
require_dependency 'seed_data/categories'
diff --git a/lib/wizard/field.rb b/lib/wizard/field.rb
index 45fdacc9992..7c15ba09564 100644
--- a/lib/wizard/field.rb
+++ b/lib/wizard/field.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Wizard
class Choice
diff --git a/lib/wizard/step.rb b/lib/wizard/step.rb
index aea48f9cf79..8ff56c35214 100644
--- a/lib/wizard/step.rb
+++ b/lib/wizard/step.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Wizard
class Step
attr_reader :id, :updater
diff --git a/plugins/discourse-details/plugin.rb b/plugins/discourse-details/plugin.rb
index a9a8883fd59..78f78e7a66a 100644
--- a/plugins/discourse-details/plugin.rb
+++ b/plugins/discourse-details/plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# name: discourse-details
# about: HTML5.1 Details polyfill for Discourse
# version: 0.4
diff --git a/plugins/discourse-details/spec/components/pretty_text_spec.rb b/plugins/discourse-details/spec/components/pretty_text_spec.rb
index 338e10f4c31..bd911739b6f 100644
--- a/plugins/discourse-details/spec/components/pretty_text_spec.rb
+++ b/plugins/discourse-details/spec/components/pretty_text_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
require 'pretty_text'
diff --git a/plugins/discourse-local-dates/lib/discourse_local_dates/engine.rb b/plugins/discourse-local-dates/lib/discourse_local_dates/engine.rb
index 2338d5e298e..d657e6b5943 100644
--- a/plugins/discourse-local-dates/lib/discourse_local_dates/engine.rb
+++ b/plugins/discourse-local-dates/lib/discourse_local_dates/engine.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ::DiscourseLocalDates
class Engine < ::Rails::Engine
engine_name DiscourseLocalDates::PLUGIN_NAME
diff --git a/plugins/discourse-local-dates/plugin.rb b/plugins/discourse-local-dates/plugin.rb
index c30c5e27cad..2adf23dca08 100644
--- a/plugins/discourse-local-dates/plugin.rb
+++ b/plugins/discourse-local-dates/plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# name: discourse-local-dates
# about: Display a date in your local timezone
# version: 0.1
diff --git a/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb b/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb
index c5abbfc1c72..6e1c76a4285 100644
--- a/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb
+++ b/plugins/discourse-local-dates/spec/integration/local_dates_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe "Local Dates" do
diff --git a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb
index de569e43327..476dd54f3da 100644
--- a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb
+++ b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
def generate_html(text, opts = {})
diff --git a/plugins/discourse-local-dates/spec/models/post_spec.rb b/plugins/discourse-local-dates/spec/models/post_spec.rb
index b472e987291..904b2f6c134 100644
--- a/plugins/discourse-local-dates/spec/models/post_spec.rb
+++ b/plugins/discourse-local-dates/spec/models/post_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe Post do
diff --git a/plugins/discourse-narrative-bot/autoload/jobs/bot_input.rb b/plugins/discourse-narrative-bot/autoload/jobs/bot_input.rb
index 06ac33d7fcb..9daa0283aeb 100644
--- a/plugins/discourse-narrative-bot/autoload/jobs/bot_input.rb
+++ b/plugins/discourse-narrative-bot/autoload/jobs/bot_input.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class BotInput < Jobs::Base
diff --git a/plugins/discourse-narrative-bot/autoload/jobs/narrative_init.rb b/plugins/discourse-narrative-bot/autoload/jobs/narrative_init.rb
index 226ec14ae8f..ac88154bbbb 100644
--- a/plugins/discourse-narrative-bot/autoload/jobs/narrative_init.rb
+++ b/plugins/discourse-narrative-bot/autoload/jobs/narrative_init.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'user'
module Jobs
diff --git a/plugins/discourse-narrative-bot/autoload/jobs/narrative_timeout.rb b/plugins/discourse-narrative-bot/autoload/jobs/narrative_timeout.rb
index 0e8b5bc80be..726dc5657a0 100644
--- a/plugins/discourse-narrative-bot/autoload/jobs/narrative_timeout.rb
+++ b/plugins/discourse-narrative-bot/autoload/jobs/narrative_timeout.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class NarrativeTimeout < Jobs::Base
def execute(args)
diff --git a/plugins/discourse-narrative-bot/autoload/jobs/onceoff/grant_badges.rb b/plugins/discourse-narrative-bot/autoload/jobs/onceoff/grant_badges.rb
index bbc995fb3a6..373b3b7a4fb 100644
--- a/plugins/discourse-narrative-bot/autoload/jobs/onceoff/grant_badges.rb
+++ b/plugins/discourse-narrative-bot/autoload/jobs/onceoff/grant_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
module DiscourseNarrativeBot
class GrantBadges < ::Jobs::Onceoff
diff --git a/plugins/discourse-narrative-bot/autoload/jobs/onceoff/remap_old_bot_images.rb b/plugins/discourse-narrative-bot/autoload/jobs/onceoff/remap_old_bot_images.rb
index d23f1c8d054..3fc98cbd717 100644
--- a/plugins/discourse-narrative-bot/autoload/jobs/onceoff/remap_old_bot_images.rb
+++ b/plugins/discourse-narrative-bot/autoload/jobs/onceoff/remap_old_bot_images.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
module DiscourseNarrativeBot
class RemapOldBotImages < ::Jobs::Onceoff
diff --git a/plugins/discourse-narrative-bot/autoload/jobs/send_default_welcome_message.rb b/plugins/discourse-narrative-bot/autoload/jobs/send_default_welcome_message.rb
index fcf3efcd5a2..5bc1f0b6fbf 100644
--- a/plugins/discourse-narrative-bot/autoload/jobs/send_default_welcome_message.rb
+++ b/plugins/discourse-narrative-bot/autoload/jobs/send_default_welcome_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class SendDefaultWelcomeMessage < Jobs::Base
def execute(args)
diff --git a/plugins/discourse-narrative-bot/db/fixtures/001_discobot.rb b/plugins/discourse-narrative-bot/db/fixtures/001_discobot.rb
index 64dc3ebc84f..3972a350fbf 100644
--- a/plugins/discourse-narrative-bot/db/fixtures/001_discobot.rb
+++ b/plugins/discourse-narrative-bot/db/fixtures/001_discobot.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
discobot_username = 'discobot'
def seed_primary_email
diff --git a/plugins/discourse-narrative-bot/db/fixtures/002_badges.rb b/plugins/discourse-narrative-bot/db/fixtures/002_badges.rb
index 263e9dccb71..e2d6fb6ad69 100644
--- a/plugins/discourse-narrative-bot/db/fixtures/002_badges.rb
+++ b/plugins/discourse-narrative-bot/db/fixtures/002_badges.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Badge
.where(name: 'Complete New User Track')
.update_all(name: DiscourseNarrativeBot::NewUserNarrative::BADGE_NAME)
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb
index c0832fdeca7..80e733ef90d 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
module Actions
TIMEOUT_DURATION = 900 # 15 mins
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/advanced_user_narrative.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/advanced_user_narrative.rb
index 6f661e98a95..5dda2de49f3 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/advanced_user_narrative.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/advanced_user_narrative.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
class AdvancedUserNarrative < Base
I18N_KEY = "discourse_narrative_bot.advanced_user_narrative".freeze
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/base.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/base.rb
index 18673713bc7..2cccd93ac8c 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/base.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/base.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
class Base
include Actions
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb
index 047e643b002..75ce1cefb3d 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/certificate_generator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
class CertificateGenerator
def initialize(user, date)
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/dice.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/dice.rb
index de5cb4b377f..18d4fd227e9 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/dice.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/dice.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
class Dice
MAXIMUM_NUM_OF_DICE = 20
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/magic_8_ball.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/magic_8_ball.rb
index 583dcfe3a1a..55bd1afe673 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/magic_8_ball.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/magic_8_ball.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
class Magic8Ball
def self.generate_answer
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb
index 6d2f54c965e..df134ac42d3 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/new_user_narrative.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'distributed_mutex'
module DiscourseNarrativeBot
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/quote_generator.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/quote_generator.rb
index 729a3a62561..7e1c5c6e62e 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/quote_generator.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/quote_generator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'excon'
module DiscourseNarrativeBot
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/track_selector.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/track_selector.rb
index a5a86ec536d..6be15da9ca6 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/track_selector.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/track_selector.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
class TrackSelector
include Actions
diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/welcome_post_type_site_setting.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/welcome_post_type_site_setting.rb
index 7ab39db3168..a29c8af5e26 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/welcome_post_type_site_setting.rb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/welcome_post_type_site_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscourseNarrativeBot
class WelcomePostTypeSiteSetting
def self.valid_value?(val)
diff --git a/plugins/discourse-narrative-bot/plugin.rb b/plugins/discourse-narrative-bot/plugin.rb
index 93d5afa72ce..02d78d05e75 100644
--- a/plugins/discourse-narrative-bot/plugin.rb
+++ b/plugins/discourse-narrative-bot/plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# name: discourse-narrative-bot
# about: Introduces staff to Discourse
# version: 1.0
diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb
index 62cc9534848..85ff8a5b3c0 100644
--- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb
index 5fca22bdc9e..89199058c7d 100644
--- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe DiscourseNarrativeBot::NewUserNarrative do
diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb
index 7d435279a60..2955063102b 100644
--- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe DiscourseNarrativeBot::Store do
diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb
index 353cb93415b..35c3243baad 100644
--- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe DiscourseNarrativeBot::TrackSelector do
diff --git a/plugins/discourse-narrative-bot/spec/jobs/onceoff/grant_badges_spec.rb b/plugins/discourse-narrative-bot/spec/jobs/onceoff/grant_badges_spec.rb
index 8381fd3364d..5a0b3a98c1a 100644
--- a/plugins/discourse-narrative-bot/spec/jobs/onceoff/grant_badges_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/jobs/onceoff/grant_badges_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe Jobs::DiscourseNarrativeBot::GrantBadges do
diff --git a/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_iamges_spec.rb b/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_iamges_spec.rb
index baba2beb384..d6976828906 100644
--- a/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_iamges_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_iamges_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe Jobs::DiscourseNarrativeBot::RemapOldBotImages do
diff --git a/plugins/discourse-narrative-bot/spec/jobs/send_default_welcome_message_spec.rb b/plugins/discourse-narrative-bot/spec/jobs/send_default_welcome_message_spec.rb
index 7f8a1c5c12b..58ae040cb65 100644
--- a/plugins/discourse-narrative-bot/spec/jobs/send_default_welcome_message_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/jobs/send_default_welcome_message_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe Jobs::SendDefaultWelcomeMessage do
diff --git a/plugins/discourse-narrative-bot/spec/lib/certificate_generator_spec.rb b/plugins/discourse-narrative-bot/spec/lib/certificate_generator_spec.rb
index cc9e37e740b..c6cd3a50f2a 100644
--- a/plugins/discourse-narrative-bot/spec/lib/certificate_generator_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/lib/certificate_generator_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
RSpec.describe DiscourseNarrativeBot::CertificateGenerator do
diff --git a/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb b/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb
index f9c4f358197..805838b09cb 100644
--- a/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe "Discobot Certificate" do
diff --git a/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb b/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb
index 48113a40b3e..334d16c2716 100644
--- a/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe "Discobot welcome post" do
diff --git a/plugins/discourse-narrative-bot/spec/user_spec.rb b/plugins/discourse-narrative-bot/spec/user_spec.rb
index 07eaee49190..8ddf472c372 100644
--- a/plugins/discourse-narrative-bot/spec/user_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/user_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe User do
diff --git a/plugins/discourse-nginx-performance-report/app/jobs/scheduled/daily_performance_report.rb b/plugins/discourse-nginx-performance-report/app/jobs/scheduled/daily_performance_report.rb
index 80d44a2aeb2..90e58706413 100644
--- a/plugins/discourse-nginx-performance-report/app/jobs/scheduled/daily_performance_report.rb
+++ b/plugins/discourse-nginx-performance-report/app/jobs/scheduled/daily_performance_report.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class DailyPerformanceReport < Jobs::Scheduled
every 1.day
diff --git a/plugins/discourse-nginx-performance-report/lib/log_analyzer.rb b/plugins/discourse-nginx-performance-report/lib/log_analyzer.rb
index 439b1202470..19a299a8e29 100644
--- a/plugins/discourse-nginx-performance-report/lib/log_analyzer.rb
+++ b/plugins/discourse-nginx-performance-report/lib/log_analyzer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class LogAnalyzer
class LineParser
diff --git a/plugins/discourse-nginx-performance-report/plugin.rb b/plugins/discourse-nginx-performance-report/plugin.rb
index 830ab1f69f6..92531a5004d 100644
--- a/plugins/discourse-nginx-performance-report/plugin.rb
+++ b/plugins/discourse-nginx-performance-report/plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# name: discourse-nginx-performance-report
# about: Analyzing Discourse Performance using NGINX logs
# version: 0.1
diff --git a/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb b/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb
index f974703d9b2..2f8d57d9c6f 100644
--- a/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb
+++ b/plugins/discourse-nginx-performance-report/script/nginx_analyze.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'date'
require_relative '../lib/log_analyzer'
diff --git a/plugins/discourse-nginx-performance-report/spec/line_parser_spec.rb b/plugins/discourse-nginx-performance-report/spec/line_parser_spec.rb
index d8f8313bc34..6fe38ba8d97 100644
--- a/plugins/discourse-nginx-performance-report/spec/line_parser_spec.rb
+++ b/plugins/discourse-nginx-performance-report/spec/line_parser_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
require_relative '../lib/log_analyzer'
diff --git a/plugins/discourse-presence/plugin.rb b/plugins/discourse-presence/plugin.rb
index 02900e3f277..21f121cf170 100644
--- a/plugins/discourse-presence/plugin.rb
+++ b/plugins/discourse-presence/plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# name: discourse-presence
# about: Show which users are writing a reply to a topic
# version: 1.0
diff --git a/plugins/discourse-presence/spec/presence_manager_spec.rb b/plugins/discourse-presence/spec/presence_manager_spec.rb
index 4f8cb48b02f..80e20ed65c3 100644
--- a/plugins/discourse-presence/spec/presence_manager_spec.rb
+++ b/plugins/discourse-presence/spec/presence_manager_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe ::Presence::PresenceManager do
diff --git a/plugins/discourse-presence/spec/requests/presence_controller_spec.rb b/plugins/discourse-presence/spec/requests/presence_controller_spec.rb
index 89e702021e9..46607739c37 100644
--- a/plugins/discourse-presence/spec/requests/presence_controller_spec.rb
+++ b/plugins/discourse-presence/spec/requests/presence_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe ::Presence::PresencesController do
diff --git a/plugins/lazyYT/plugin.rb b/plugins/lazyYT/plugin.rb
index 1ca0820ac44..bccee5331c6 100644
--- a/plugins/lazyYT/plugin.rb
+++ b/plugins/lazyYT/plugin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# name: lazyYT
# about: Uses the lazyYT plugin to lazy load Youtube videos
# version: 1.0.1
diff --git a/plugins/poll/app/models/poll.rb b/plugins/poll/app/models/poll.rb
index 3c21f880cc3..4328b1f3f21 100644
--- a/plugins/poll/app/models/poll.rb
+++ b/plugins/poll/app/models/poll.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Poll < ActiveRecord::Base
# because we want to use the 'type' column and don't want to use STI
self.inheritance_column = nil
diff --git a/plugins/poll/app/models/poll_option.rb b/plugins/poll/app/models/poll_option.rb
index 027c97710ba..66c39621590 100644
--- a/plugins/poll/app/models/poll_option.rb
+++ b/plugins/poll/app/models/poll_option.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PollOption < ActiveRecord::Base
belongs_to :poll
has_many :poll_votes, dependent: :delete_all
diff --git a/plugins/poll/app/models/poll_vote.rb b/plugins/poll/app/models/poll_vote.rb
index 6f5e7c22611..409063c2e5b 100644
--- a/plugins/poll/app/models/poll_vote.rb
+++ b/plugins/poll/app/models/poll_vote.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PollVote < ActiveRecord::Base
belongs_to :poll
belongs_to :poll_option
diff --git a/plugins/poll/app/serializers/poll_option_serializer.rb b/plugins/poll/app/serializers/poll_option_serializer.rb
index b23ac7a86d8..9f151a7b342 100644
--- a/plugins/poll/app/serializers/poll_option_serializer.rb
+++ b/plugins/poll/app/serializers/poll_option_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PollOptionSerializer < ApplicationSerializer
attributes :id, :html, :votes
diff --git a/plugins/poll/app/serializers/poll_serializer.rb b/plugins/poll/app/serializers/poll_serializer.rb
index 2048f6bcaa0..e955be9c40f 100644
--- a/plugins/poll/app/serializers/poll_serializer.rb
+++ b/plugins/poll/app/serializers/poll_serializer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PollSerializer < ApplicationSerializer
attributes :name,
:type,
diff --git a/plugins/poll/db/migrate/20150501152228_rename_total_votes_to_voters.rb b/plugins/poll/db/migrate/20150501152228_rename_total_votes_to_voters.rb
index f548ebdf891..12ea481d4f5 100644
--- a/plugins/poll/db/migrate/20150501152228_rename_total_votes_to_voters.rb
+++ b/plugins/poll/db/migrate/20150501152228_rename_total_votes_to_voters.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class RenameTotalVotesToVoters < ActiveRecord::Migration[4.2]
def up
diff --git a/plugins/poll/db/migrate/20151016163051_merge_polls_votes.rb b/plugins/poll/db/migrate/20151016163051_merge_polls_votes.rb
index dfa47c51d9e..41c18ccb7d6 100644
--- a/plugins/poll/db/migrate/20151016163051_merge_polls_votes.rb
+++ b/plugins/poll/db/migrate/20151016163051_merge_polls_votes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MergePollsVotes < ActiveRecord::Migration[4.2]
def up
diff --git a/plugins/poll/db/migrate/20160321164925_close_polls_in_closed_topics.rb b/plugins/poll/db/migrate/20160321164925_close_polls_in_closed_topics.rb
index 6ef50e82fcd..1835ae40788 100644
--- a/plugins/poll/db/migrate/20160321164925_close_polls_in_closed_topics.rb
+++ b/plugins/poll/db/migrate/20160321164925_close_polls_in_closed_topics.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ClosePollsInClosedTopics < ActiveRecord::Migration[4.2]
def up
diff --git a/plugins/poll/db/migrate/20180820073549_create_polls_tables.rb b/plugins/poll/db/migrate/20180820073549_create_polls_tables.rb
index 99a1229c083..311f5fd92c0 100644
--- a/plugins/poll/db/migrate/20180820073549_create_polls_tables.rb
+++ b/plugins/poll/db/migrate/20180820073549_create_polls_tables.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreatePollsTables < ActiveRecord::Migration[5.2]
def change
create_table :polls do |t|
diff --git a/plugins/poll/db/post_migrate/20180820080623_migrate_polls_data.rb b/plugins/poll/db/post_migrate/20180820080623_migrate_polls_data.rb
index 5a626c86611..07e2336603a 100644
--- a/plugins/poll/db/post_migrate/20180820080623_migrate_polls_data.rb
+++ b/plugins/poll/db/post_migrate/20180820080623_migrate_polls_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class MigratePollsData < ActiveRecord::Migration[5.2]
def escape(text)
PG::Connection.escape_string(text)
diff --git a/plugins/poll/jobs/regular/close_poll.rb b/plugins/poll/jobs/regular/close_poll.rb
index 1c3c77c9afd..5e85a00ee19 100644
--- a/plugins/poll/jobs/regular/close_poll.rb
+++ b/plugins/poll/jobs/regular/close_poll.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module Jobs
class ClosePoll < Jobs::Base
diff --git a/plugins/poll/lib/polls_validator.rb b/plugins/poll/lib/polls_validator.rb
index fca71f89fc4..58ec21977a2 100644
--- a/plugins/poll/lib/polls_validator.rb
+++ b/plugins/poll/lib/polls_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscoursePoll
class PollsValidator
diff --git a/plugins/poll/lib/post_validator.rb b/plugins/poll/lib/post_validator.rb
index 2b6be2b14c0..19f6648e4f7 100644
--- a/plugins/poll/lib/post_validator.rb
+++ b/plugins/poll/lib/post_validator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module DiscoursePoll
class PostValidator
def initialize(post)
diff --git a/plugins/poll/lib/tasks/migrate_old_polls.rake b/plugins/poll/lib/tasks/migrate_old_polls.rake
index d8f2ee40644..c058c06a693 100644
--- a/plugins/poll/lib/tasks/migrate_old_polls.rake
+++ b/plugins/poll/lib/tasks/migrate_old_polls.rake
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
CLOSED_POLL_PREFIXES = {
"ar" => "هذا التصويت مغلق",
"ca" => "Enquesta tancada",
diff --git a/plugins/poll/spec/controllers/polls_controller_spec.rb b/plugins/poll/spec/controllers/polls_controller_spec.rb
index 6e0826232dd..016bde394c4 100644
--- a/plugins/poll/spec/controllers/polls_controller_spec.rb
+++ b/plugins/poll/spec/controllers/polls_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rails_helper"
describe ::DiscoursePoll::PollsController do
diff --git a/plugins/poll/spec/controllers/posts_controller_spec.rb b/plugins/poll/spec/controllers/posts_controller_spec.rb
index 3c7ff8c15dd..868116716d6 100644
--- a/plugins/poll/spec/controllers/posts_controller_spec.rb
+++ b/plugins/poll/spec/controllers/posts_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rails_helper"
describe PostsController do
diff --git a/plugins/poll/spec/db/post_migrate/migrate_polls_data_spec.rb b/plugins/poll/spec/db/post_migrate/migrate_polls_data_spec.rb
index 3d4bbc5a6e7..50bc5d75caf 100644
--- a/plugins/poll/spec/db/post_migrate/migrate_polls_data_spec.rb
+++ b/plugins/poll/spec/db/post_migrate/migrate_polls_data_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
require_relative '../../../db/post_migrate/20180820080623_migrate_polls_data'
diff --git a/plugins/poll/spec/integration/poll_endpoints_spec.rb b/plugins/poll/spec/integration/poll_endpoints_spec.rb
index 5caf17dabaf..1063bd3d402 100644
--- a/plugins/poll/spec/integration/poll_endpoints_spec.rb
+++ b/plugins/poll/spec/integration/poll_endpoints_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rails_helper"
describe "DiscoursePoll endpoints" do
diff --git a/plugins/poll/spec/jobs/regular/close_poll_spec.rb b/plugins/poll/spec/jobs/regular/close_poll_spec.rb
index 8e5c2b282cc..8bd8004c78b 100644
--- a/plugins/poll/spec/jobs/regular/close_poll_spec.rb
+++ b/plugins/poll/spec/jobs/regular/close_poll_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rails_helper"
describe Jobs::ClosePoll do
diff --git a/plugins/poll/spec/lib/new_post_manager_spec.rb b/plugins/poll/spec/lib/new_post_manager_spec.rb
index 48342d574f7..9517e4fafb4 100644
--- a/plugins/poll/spec/lib/new_post_manager_spec.rb
+++ b/plugins/poll/spec/lib/new_post_manager_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rails_helper"
describe NewPostManager do
diff --git a/plugins/poll/spec/lib/polls_updater_spec.rb b/plugins/poll/spec/lib/polls_updater_spec.rb
index 43b32840f84..871fc94a6f4 100644
--- a/plugins/poll/spec/lib/polls_updater_spec.rb
+++ b/plugins/poll/spec/lib/polls_updater_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe DiscoursePoll::PollsUpdater do
diff --git a/plugins/poll/spec/lib/polls_validator_spec.rb b/plugins/poll/spec/lib/polls_validator_spec.rb
index ee2d4b37e70..6dfe59a144c 100644
--- a/plugins/poll/spec/lib/polls_validator_spec.rb
+++ b/plugins/poll/spec/lib/polls_validator_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rails_helper"
describe ::DiscoursePoll::PollsValidator do
diff --git a/plugins/poll/spec/lib/pretty_text_spec.rb b/plugins/poll/spec/lib/pretty_text_spec.rb
index a21d6aac0a1..a7e1f3d36c7 100644
--- a/plugins/poll/spec/lib/pretty_text_spec.rb
+++ b/plugins/poll/spec/lib/pretty_text_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
describe PrettyText do
diff --git a/plugins/poll/spec/requests/users_controller_spec.rb b/plugins/poll/spec/requests/users_controller_spec.rb
index 916085fec3e..fa18d6f6d37 100644
--- a/plugins/poll/spec/requests/users_controller_spec.rb
+++ b/plugins/poll/spec/requests/users_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "rails_helper"
describe Admin::UsersController do
diff --git a/script/bench.rb b/script/bench.rb
index f474b02b5b5..b847db2f3c2 100644
--- a/script/bench.rb
+++ b/script/bench.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "socket"
require "csv"
require "yaml"
diff --git a/script/benchmarks/markdown/bench.rb b/script/benchmarks/markdown/bench.rb
index 74926c95a2a..00bd7573d8d 100644
--- a/script/benchmarks/markdown/bench.rb
+++ b/script/benchmarks/markdown/bench.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'benchmark/ips'
require File.expand_path('../../../../config/environment', __FILE__)
diff --git a/script/benchmarks/middleware/test.rb b/script/benchmarks/middleware/test.rb
index 58595dfcf96..1432b9227e2 100644
--- a/script/benchmarks/middleware/test.rb
+++ b/script/benchmarks/middleware/test.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'memory_profiler'
require 'benchmark/ips'
diff --git a/script/benchmarks/site_setting/bench.rb b/script/benchmarks/site_setting/bench.rb
index 1ac30060130..902911d44fb 100644
--- a/script/benchmarks/site_setting/bench.rb
+++ b/script/benchmarks/site_setting/bench.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'benchmark/ips'
require File.expand_path('../../../../config/environment', __FILE__)
diff --git a/script/benchmarks/site_setting/profile.rb b/script/benchmarks/site_setting/profile.rb
index 7b7237055d9..0ad7bcde079 100644
--- a/script/benchmarks/site_setting/profile.rb
+++ b/script/benchmarks/site_setting/profile.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'ruby-prof'
def profile(&blk)
diff --git a/script/boot_mem.rb b/script/boot_mem.rb
index 61da1fa6c6b..5780ae6058d 100644
--- a/script/boot_mem.rb
+++ b/script/boot_mem.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# simple script to measure memory at boot
if ENV['RAILS_ENV'] != "production"
diff --git a/script/bulk_import/base.rb b/script/bulk_import/base.rb
index 3212702d0df..ea511edcd4e 100644
--- a/script/bulk_import/base.rb
+++ b/script/bulk_import/base.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if ARGV.include?('bbcode-to-md')
# Replace (most) bbcode with markdown before creating posts.
# This will dramatically clean up the final posts in Discourse.
diff --git a/script/bulk_import/discourse_merger.rb b/script/bulk_import/discourse_merger.rb
index cb85bc31e9b..0bd4f37dfd4 100644
--- a/script/bulk_import/discourse_merger.rb
+++ b/script/bulk_import/discourse_merger.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative "base"
class BulkImport::DiscourseMerger < BulkImport::Base
diff --git a/script/bulk_import/phpbb_postgresql.rb b/script/bulk_import/phpbb_postgresql.rb
index 570944b397e..d7d7205a07c 100644
--- a/script/bulk_import/phpbb_postgresql.rb
+++ b/script/bulk_import/phpbb_postgresql.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative "base"
require "pg"
require "htmlentities"
diff --git a/script/bulk_import/vanilla.rb b/script/bulk_import/vanilla.rb
index 3e11130e979..2efed5f31f7 100644
--- a/script/bulk_import/vanilla.rb
+++ b/script/bulk_import/vanilla.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative "base"
require "mysql2"
require "rake"
diff --git a/script/bulk_import/vbulletin.rb b/script/bulk_import/vbulletin.rb
index a16990053bf..fef661fa91b 100644
--- a/script/bulk_import/vbulletin.rb
+++ b/script/bulk_import/vbulletin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative "base"
require "set"
require "mysql2"
diff --git a/script/check_forking.rb b/script/check_forking.rb
index c0eb398502c..ae8196af943 100644
--- a/script/check_forking.rb
+++ b/script/check_forking.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path("../../config/environment", __FILE__)
def pretty
diff --git a/script/compile_hbs.rb b/script/compile_hbs.rb
index 21d2b22713e..cfec4386a2c 100644
--- a/script/compile_hbs.rb
+++ b/script/compile_hbs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
ctx = MiniRacer::Context.new(timeout: 15000)
ctx.eval("var self = this; #{File.read("#{Rails.root}/vendor/assets/javascripts/babel.js")}")
ctx.eval(File.read(Ember::Source.bundled_path_for('ember-template-compiler.js')))
diff --git a/script/demon_test/child b/script/demon_test/child
index 909d58f84b3..c07f1fd26e3 100755
--- a/script/demon_test/child
+++ b/script/demon_test/child
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
$parent_pid = ARGV[0].to_i
diff --git a/script/demon_test/parent.rb b/script/demon_test/parent.rb
index beb2658302f..a6edd1ea548 100644
--- a/script/demon_test/parent.rb
+++ b/script/demon_test/parent.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path("../../../config/environment", __FILE__)
puts "Parent is now loaded"
diff --git a/script/diff_heaps.rb b/script/diff_heaps.rb
index 947f4b02b36..5a0e91efd67 100644
--- a/script/diff_heaps.rb
+++ b/script/diff_heaps.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# to be used to compare ruby heaps generated in 2.1
# can isolate memory leaks
#
diff --git a/script/discourse b/script/discourse
index 3b830db810c..003080c226d 100755
--- a/script/discourse
+++ b/script/discourse
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require "thor"
diff --git a/script/docker_test.rb b/script/docker_test.rb
index 4276d6512fa..b10e300d8d5 100644
--- a/script/docker_test.rb
+++ b/script/docker_test.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This script is run in the discourse_test docker image
# Available environment variables:
# => NO_UPDATE disables updating the source code within the discourse_test docker image
diff --git a/script/downsize_uploads.rb b/script/downsize_uploads.rb
index e04266e3f04..cd67d10fd27 100644
--- a/script/downsize_uploads.rb
+++ b/script/downsize_uploads.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path("../../config/environment", __FILE__)
# no less than 1 megapixel
diff --git a/script/import_scripts/answerbase.rb b/script/import_scripts/answerbase.rb
index 88fa1914775..e011737fae1 100644
--- a/script/import_scripts/answerbase.rb
+++ b/script/import_scripts/answerbase.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'csv'
require 'reverse_markdown'
require_relative 'base'
diff --git a/script/import_scripts/askbot.rb b/script/import_scripts/askbot.rb
index 90638d889d6..ac409a6c52e 100644
--- a/script/import_scripts/askbot.rb
+++ b/script/import_scripts/askbot.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'pg'
diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb
index df82530e869..77abd752a59 100644
--- a/script/import_scripts/base.rb
+++ b/script/import_scripts/base.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if ARGV.include?('bbcode-to-md')
# Replace (most) bbcode with markdown before creating posts.
# This will dramatically clean up the final posts in Discourse.
diff --git a/script/import_scripts/base/csv_helper.rb b/script/import_scripts/base/csv_helper.rb
index 13a9fa37248..3a175b935c3 100644
--- a/script/import_scripts/base/csv_helper.rb
+++ b/script/import_scripts/base/csv_helper.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts
module CsvHelper
class RowResolver
diff --git a/script/import_scripts/base/generic_database.rb b/script/import_scripts/base/generic_database.rb
index c0f046779fc..885d5bb7a4e 100644
--- a/script/import_scripts/base/generic_database.rb
+++ b/script/import_scripts/base/generic_database.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'sqlite3'
module ImportScripts
diff --git a/script/import_scripts/base/lookup_container.rb b/script/import_scripts/base/lookup_container.rb
index fa324db0519..6c4169b916b 100644
--- a/script/import_scripts/base/lookup_container.rb
+++ b/script/import_scripts/base/lookup_container.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts
class LookupContainer
def initialize
diff --git a/script/import_scripts/base/uploader.rb b/script/import_scripts/base/uploader.rb
index a9540112baf..50961f649f9 100644
--- a/script/import_scripts/base/uploader.rb
+++ b/script/import_scripts/base/uploader.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_dependency 'url_helper'
require_dependency 'file_helper'
diff --git a/script/import_scripts/bbpress.rb b/script/import_scripts/bbpress.rb
index 1538de4af8f..1db8c2c0d8c 100644
--- a/script/import_scripts/bbpress.rb
+++ b/script/import_scripts/bbpress.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mysql2'
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/bespoke_1.rb b/script/import_scripts/bespoke_1.rb
index 3d335338761..8ddb8bfb015 100644
--- a/script/import_scripts/bespoke_1.rb
+++ b/script/import_scripts/bespoke_1.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# bespoke importer for a customer, feel free to borrow ideas
require 'csv'
diff --git a/script/import_scripts/discuz_x.rb b/script/import_scripts/discuz_x.rb
index 5530a605e81..750a1ef6bf5 100644
--- a/script/import_scripts/discuz_x.rb
+++ b/script/import_scripts/discuz_x.rb
@@ -1,4 +1,6 @@
# encoding: utf-8
+# frozen_string_literal: true
+
#
# Author: Erick Guan
#
diff --git a/script/import_scripts/disqus.rb b/script/import_scripts/disqus.rb
index 01bdb476291..cb3679967e9 100644
--- a/script/import_scripts/disqus.rb
+++ b/script/import_scripts/disqus.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'nokogiri'
require 'optparse'
require File.expand_path(File.dirname(__FILE__) + "/base")
diff --git a/script/import_scripts/drupal-6.rb b/script/import_scripts/drupal-6.rb
index 9b7b1f26288..182596c63c3 100644
--- a/script/import_scripts/drupal-6.rb
+++ b/script/import_scripts/drupal-6.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/drupal.rb b/script/import_scripts/drupal.rb
index 6b773486d00..c97c2e632d9 100644
--- a/script/import_scripts/drupal.rb
+++ b/script/import_scripts/drupal.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/drupal_json.rb b/script/import_scripts/drupal_json.rb
index d99fb86f871..3b72e7d61ad 100644
--- a/script/import_scripts/drupal_json.rb
+++ b/script/import_scripts/drupal_json.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
# Edit the constants and initialize method for your import data.
diff --git a/script/import_scripts/drupal_qa.rb b/script/import_scripts/drupal_qa.rb
index b7bad2fbf6a..a8febbd41c0 100644
--- a/script/import_scripts/drupal_qa.rb
+++ b/script/import_scripts/drupal_qa.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require File.expand_path(File.dirname(__FILE__) + "/drupal.rb")
diff --git a/script/import_scripts/fluxbb.rb b/script/import_scripts/fluxbb.rb
index 7b886447153..d39cf052560 100644
--- a/script/import_scripts/fluxbb.rb
+++ b/script/import_scripts/fluxbb.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/friendsmegplus.rb b/script/import_scripts/friendsmegplus.rb
index 2704774ab7b..6a53108e82c 100644
--- a/script/import_scripts/friendsmegplus.rb
+++ b/script/import_scripts/friendsmegplus.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'csv'
diff --git a/script/import_scripts/getsatisfaction.rb b/script/import_scripts/getsatisfaction.rb
index 0111b5c8b59..fa8d51c81d0 100644
--- a/script/import_scripts/getsatisfaction.rb
+++ b/script/import_scripts/getsatisfaction.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# getsatisfaction importer
#
# pre-req: You will either get an Excel or a bunch of CSV files. Be sure to rename them all so that
diff --git a/script/import_scripts/google_groups.rb b/script/import_scripts/google_groups.rb
index dcfbdb1ce16..0c79b6e8a8a 100755
--- a/script/import_scripts/google_groups.rb
+++ b/script/import_scripts/google_groups.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require "bundler/inline"
diff --git a/script/import_scripts/ipboard.rb b/script/import_scripts/ipboard.rb
index 2f936215be9..0306ec6adae 100644
--- a/script/import_scripts/ipboard.rb
+++ b/script/import_scripts/ipboard.rb
@@ -1,4 +1,6 @@
# coding: utf-8
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'htmlentities'
diff --git a/script/import_scripts/ipboard3.rb b/script/import_scripts/ipboard3.rb
index 53d808aa693..0791e2b3a00 100644
--- a/script/import_scripts/ipboard3.rb
+++ b/script/import_scripts/ipboard3.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require "reverse_markdown"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/jive.rb b/script/import_scripts/jive.rb
index 1a9ead8480b..4b253fe6e91 100644
--- a/script/import_scripts/jive.rb
+++ b/script/import_scripts/jive.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Jive importer
require 'nokogiri'
require 'csv'
diff --git a/script/import_scripts/jive_api.rb b/script/import_scripts/jive_api.rb
index 8594df95171..62a892adcc3 100644
--- a/script/import_scripts/jive_api.rb
+++ b/script/import_scripts/jive_api.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "nokogiri"
require "htmlentities"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/json_generic.rb b/script/import_scripts/json_generic.rb
index f98bcebcbc5..5d6efd4f975 100755
--- a/script/import_scripts/json_generic.rb
+++ b/script/import_scripts/json_generic.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "csv"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/kunena.rb b/script/import_scripts/kunena.rb
index 1aa333593ee..d0c08320446 100644
--- a/script/import_scripts/kunena.rb
+++ b/script/import_scripts/kunena.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/kunena3.rb b/script/import_scripts/kunena3.rb
index 4a271202748..d7e98448f8e 100644
--- a/script/import_scripts/kunena3.rb
+++ b/script/import_scripts/kunena3.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/lithium.rb b/script/import_scripts/lithium.rb
index ff9654e6576..e6f536f4ac6 100644
--- a/script/import_scripts/lithium.rb
+++ b/script/import_scripts/lithium.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Notes:
#
# Written by Sam
diff --git a/script/import_scripts/mbox.rb b/script/import_scripts/mbox.rb
index 6bbf189328a..59d3a3780fd 100644
--- a/script/import_scripts/mbox.rb
+++ b/script/import_scripts/mbox.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if ARGV.length != 1 || !File.exists?(ARGV[0])
STDERR.puts '', 'Usage of mbox importer:', 'bundle exec ruby mbox.rb '
STDERR.puts '', "Use the settings file from #{File.expand_path('mbox/settings.yml', File.dirname(__FILE__))} as an example."
diff --git a/script/import_scripts/mbox/importer.rb b/script/import_scripts/mbox/importer.rb
index 30807b84867..1be622250de 100644
--- a/script/import_scripts/mbox/importer.rb
+++ b/script/import_scripts/mbox/importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative '../base'
require_relative 'support/database'
require_relative 'support/indexer'
diff --git a/script/import_scripts/mbox/support/database.rb b/script/import_scripts/mbox/support/database.rb
index a7415a0327c..ea1a6600d5b 100644
--- a/script/import_scripts/mbox/support/database.rb
+++ b/script/import_scripts/mbox/support/database.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'sqlite3'
module ImportScripts::Mbox
diff --git a/script/import_scripts/mbox/support/indexer.rb b/script/import_scripts/mbox/support/indexer.rb
index 7b76528e94a..4a24e9f8a4e 100644
--- a/script/import_scripts/mbox/support/indexer.rb
+++ b/script/import_scripts/mbox/support/indexer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'database'
require 'json'
require 'yaml'
diff --git a/script/import_scripts/mbox/support/settings.rb b/script/import_scripts/mbox/support/settings.rb
index 703ec2220ad..be8bd68e4cc 100644
--- a/script/import_scripts/mbox/support/settings.rb
+++ b/script/import_scripts/mbox/support/settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'yaml'
module ImportScripts::Mbox
diff --git a/script/import_scripts/modx.rb b/script/import_scripts/modx.rb
index eeaa21be95a..0cb4f6d8c46 100644
--- a/script/import_scripts/modx.rb
+++ b/script/import_scripts/modx.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mysql2'
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'htmlentities'
diff --git a/script/import_scripts/muut.rb b/script/import_scripts/muut.rb
index 24134ee3f92..a242c193638 100644
--- a/script/import_scripts/muut.rb
+++ b/script/import_scripts/muut.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "csv"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/mybb.rb b/script/import_scripts/mybb.rb
index cc3ed9e6626..79b2377edfd 100644
--- a/script/import_scripts/mybb.rb
+++ b/script/import_scripts/mybb.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/mylittleforum.rb b/script/import_scripts/mylittleforum.rb
index 4b10494eb4f..aa7ebcccc8c 100644
--- a/script/import_scripts/mylittleforum.rb
+++ b/script/import_scripts/mylittleforum.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'htmlentities'
diff --git a/script/import_scripts/nabble.rb b/script/import_scripts/nabble.rb
index 3d0445c85a3..05533da201c 100644
--- a/script/import_scripts/nabble.rb
+++ b/script/import_scripts/nabble.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'pg'
require_relative 'base/uploader'
diff --git a/script/import_scripts/ning.rb b/script/import_scripts/ning.rb
index 7646b37f3f1..e5e7ed8dce0 100644
--- a/script/import_scripts/ning.rb
+++ b/script/import_scripts/ning.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
# Edit the constants and initialize method for your import data.
diff --git a/script/import_scripts/nodebb/nodebb.rb b/script/import_scripts/nodebb/nodebb.rb
index 86ba05632e8..29a0ee71e64 100644
--- a/script/import_scripts/nodebb/nodebb.rb
+++ b/script/import_scripts/nodebb/nodebb.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative '../base.rb'
require_relative './redis'
diff --git a/script/import_scripts/nodebb/redis.rb b/script/import_scripts/nodebb/redis.rb
index e77e33f3578..f8877c5e15f 100644
--- a/script/import_scripts/nodebb/redis.rb
+++ b/script/import_scripts/nodebb/redis.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'redis'
module NodeBB
diff --git a/script/import_scripts/phorum.rb b/script/import_scripts/phorum.rb
index 1345b008061..3dc4e80b04b 100644
--- a/script/import_scripts/phorum.rb
+++ b/script/import_scripts/phorum.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/phpbb3.rb b/script/import_scripts/phpbb3.rb
index 72378c68a6a..3808b511b17 100644
--- a/script/import_scripts/phpbb3.rb
+++ b/script/import_scripts/phpbb3.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Importer for phpBB 3.0 and 3.1
# Documentation: https://meta.discourse.org/t/importing-from-phpbb3/30810
diff --git a/script/import_scripts/phpbb3/database/database.rb b/script/import_scripts/phpbb3/database/database.rb
index 3cc3bd9e439..70cc4e4a6fb 100644
--- a/script/import_scripts/phpbb3/database/database.rb
+++ b/script/import_scripts/phpbb3/database/database.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mysql2'
module ImportScripts::PhpBB3
diff --git a/script/import_scripts/phpbb3/database/database_3_0.rb b/script/import_scripts/phpbb3/database/database_3_0.rb
index ddee927acb7..2b2c557d5f5 100644
--- a/script/import_scripts/phpbb3/database/database_3_0.rb
+++ b/script/import_scripts/phpbb3/database/database_3_0.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'database_base'
require_relative '../support/constants'
diff --git a/script/import_scripts/phpbb3/database/database_3_1.rb b/script/import_scripts/phpbb3/database/database_3_1.rb
index 0bd264856e3..95481429026 100644
--- a/script/import_scripts/phpbb3/database/database_3_1.rb
+++ b/script/import_scripts/phpbb3/database/database_3_1.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'database_3_0'
require_relative '../support/constants'
diff --git a/script/import_scripts/phpbb3/database/database_base.rb b/script/import_scripts/phpbb3/database/database_base.rb
index fa8cb3d4540..a51bcde3a5d 100644
--- a/script/import_scripts/phpbb3/database/database_base.rb
+++ b/script/import_scripts/phpbb3/database/database_base.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class DatabaseBase
# @param database_client [Mysql2::Client]
diff --git a/script/import_scripts/phpbb3/importer.rb b/script/import_scripts/phpbb3/importer.rb
index a7142e049c6..ca3274002cf 100644
--- a/script/import_scripts/phpbb3/importer.rb
+++ b/script/import_scripts/phpbb3/importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative '../base'
require_relative 'support/settings'
require_relative 'database/database'
diff --git a/script/import_scripts/phpbb3/importers/attachment_importer.rb b/script/import_scripts/phpbb3/importers/attachment_importer.rb
index 37f7695c9c7..e9f10ee5579 100644
--- a/script/import_scripts/phpbb3/importers/attachment_importer.rb
+++ b/script/import_scripts/phpbb3/importers/attachment_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class AttachmentImporter
# @param database [ImportScripts::PhpBB3::Database_3_0 | ImportScripts::PhpBB3::Database_3_1]
diff --git a/script/import_scripts/phpbb3/importers/avatar_importer.rb b/script/import_scripts/phpbb3/importers/avatar_importer.rb
index 2178ed800c4..41cac413c45 100644
--- a/script/import_scripts/phpbb3/importers/avatar_importer.rb
+++ b/script/import_scripts/phpbb3/importers/avatar_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class AvatarImporter
# @param uploader [ImportScripts::Uploader]
diff --git a/script/import_scripts/phpbb3/importers/bookmark_importer.rb b/script/import_scripts/phpbb3/importers/bookmark_importer.rb
index febc8ab8697..49c3799a09e 100644
--- a/script/import_scripts/phpbb3/importers/bookmark_importer.rb
+++ b/script/import_scripts/phpbb3/importers/bookmark_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class BookmarkImporter
def map_bookmark(row)
diff --git a/script/import_scripts/phpbb3/importers/category_importer.rb b/script/import_scripts/phpbb3/importers/category_importer.rb
index d7d8addfdaf..1d4cbaa60c4 100644
--- a/script/import_scripts/phpbb3/importers/category_importer.rb
+++ b/script/import_scripts/phpbb3/importers/category_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class CategoryImporter
# @param lookup [ImportScripts::LookupContainer]
diff --git a/script/import_scripts/phpbb3/importers/importer_factory.rb b/script/import_scripts/phpbb3/importers/importer_factory.rb
index 998aed36eb1..dffb4c4f7f7 100644
--- a/script/import_scripts/phpbb3/importers/importer_factory.rb
+++ b/script/import_scripts/phpbb3/importers/importer_factory.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'attachment_importer'
require_relative 'avatar_importer'
require_relative 'bookmark_importer'
diff --git a/script/import_scripts/phpbb3/importers/message_importer.rb b/script/import_scripts/phpbb3/importers/message_importer.rb
index 0a9e356450d..8f8218d7327 100644
--- a/script/import_scripts/phpbb3/importers/message_importer.rb
+++ b/script/import_scripts/phpbb3/importers/message_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class MessageImporter
# @param database [ImportScripts::PhpBB3::Database_3_0 | ImportScripts::PhpBB3::Database_3_1]
diff --git a/script/import_scripts/phpbb3/importers/permalink_importer.rb b/script/import_scripts/phpbb3/importers/permalink_importer.rb
index 5d79ab5cd0c..5afd18e9053 100644
--- a/script/import_scripts/phpbb3/importers/permalink_importer.rb
+++ b/script/import_scripts/phpbb3/importers/permalink_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class PermalinkImporter
CATEGORY_LINK_NORMALIZATION = '/(viewforum.php\?)(?:.*&)?(f=\d+).*/\1\2'
diff --git a/script/import_scripts/phpbb3/importers/poll_importer.rb b/script/import_scripts/phpbb3/importers/poll_importer.rb
index 3349f054eb5..023de32e709 100644
--- a/script/import_scripts/phpbb3/importers/poll_importer.rb
+++ b/script/import_scripts/phpbb3/importers/poll_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class PollImporter
# @param lookup [ImportScripts::LookupContainer]
diff --git a/script/import_scripts/phpbb3/importers/post_importer.rb b/script/import_scripts/phpbb3/importers/post_importer.rb
index b184bcaa31c..c0c0ee15a7f 100644
--- a/script/import_scripts/phpbb3/importers/post_importer.rb
+++ b/script/import_scripts/phpbb3/importers/post_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class PostImporter
# @param lookup [ImportScripts::LookupContainer]
diff --git a/script/import_scripts/phpbb3/importers/user_importer.rb b/script/import_scripts/phpbb3/importers/user_importer.rb
index 1af3f38a5d8..80655006e18 100644
--- a/script/import_scripts/phpbb3/importers/user_importer.rb
+++ b/script/import_scripts/phpbb3/importers/user_importer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative '../support/constants'
module ImportScripts::PhpBB3
diff --git a/script/import_scripts/phpbb3/support/constants.rb b/script/import_scripts/phpbb3/support/constants.rb
index 6e9612e6785..af8d62dc439 100644
--- a/script/import_scripts/phpbb3/support/constants.rb
+++ b/script/import_scripts/phpbb3/support/constants.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class Constants
ACTIVE_USER = 0
diff --git a/script/import_scripts/phpbb3/support/settings.rb b/script/import_scripts/phpbb3/support/settings.rb
index 0fdafdfef23..8b1ebf706f8 100644
--- a/script/import_scripts/phpbb3/support/settings.rb
+++ b/script/import_scripts/phpbb3/support/settings.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'yaml'
module ImportScripts::PhpBB3
diff --git a/script/import_scripts/phpbb3/support/smiley_processor.rb b/script/import_scripts/phpbb3/support/smiley_processor.rb
index 9b4d643d0dc..29abc14f8ad 100644
--- a/script/import_scripts/phpbb3/support/smiley_processor.rb
+++ b/script/import_scripts/phpbb3/support/smiley_processor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class SmileyProcessor
# @param uploader [ImportScripts::Uploader]
diff --git a/script/import_scripts/phpbb3/support/text_processor.rb b/script/import_scripts/phpbb3/support/text_processor.rb
index fa6e623d328..158864b1c9e 100644
--- a/script/import_scripts/phpbb3/support/text_processor.rb
+++ b/script/import_scripts/phpbb3/support/text_processor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ImportScripts::PhpBB3
class TextProcessor
# @param lookup [ImportScripts::LookupContainer]
diff --git a/script/import_scripts/punbb.rb b/script/import_scripts/punbb.rb
index 88c35f3096a..64cce9bbcf4 100644
--- a/script/import_scripts/punbb.rb
+++ b/script/import_scripts/punbb.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/quandora/export.rb b/script/import_scripts/quandora/export.rb
index 7f4efc4f1f5..e1f87b7ec32 100644
--- a/script/import_scripts/quandora/export.rb
+++ b/script/import_scripts/quandora/export.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'yaml'
require_relative 'quandora_api'
diff --git a/script/import_scripts/quandora/import.rb b/script/import_scripts/quandora/import.rb
index c02e15277bd..7df8be302c4 100644
--- a/script/import_scripts/quandora/import.rb
+++ b/script/import_scripts/quandora/import.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative './quandora_question.rb'
require File.expand_path(File.dirname(__FILE__) + "/../base.rb")
diff --git a/script/import_scripts/quandora/quandora_api.rb b/script/import_scripts/quandora/quandora_api.rb
index 08c2f3db98b..747473bb793 100644
--- a/script/import_scripts/quandora/quandora_api.rb
+++ b/script/import_scripts/quandora/quandora_api.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'base64'
require 'json'
diff --git a/script/import_scripts/quandora/quandora_question.rb b/script/import_scripts/quandora/quandora_question.rb
index 9eb59c9e303..abbaaeeda6a 100644
--- a/script/import_scripts/quandora/quandora_question.rb
+++ b/script/import_scripts/quandora/quandora_question.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'json'
require 'cgi'
require 'time'
diff --git a/script/import_scripts/quandora/test/test_data.rb b/script/import_scripts/quandora/test/test_data.rb
index 044b63c58c4..3166d6c44da 100644
--- a/script/import_scripts/quandora/test/test_data.rb
+++ b/script/import_scripts/quandora/test/test_data.rb
@@ -1,3 +1,4 @@
+ # frozen_string_literal: true
BASES = '{
"type" : "kbase",
"data" : [ {
diff --git a/script/import_scripts/quandora/test/test_quandora_api.rb b/script/import_scripts/quandora/test/test_quandora_api.rb
index 5fd04e428f7..b7101053c2a 100644
--- a/script/import_scripts/quandora/test/test_quandora_api.rb
+++ b/script/import_scripts/quandora/test/test_quandora_api.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'minitest/autorun'
require 'yaml'
require_relative '../quandora_api.rb'
diff --git a/script/import_scripts/quandora/test/test_quandora_question.rb b/script/import_scripts/quandora/test/test_quandora_question.rb
index a52b800150c..28b5dd9885c 100644
--- a/script/import_scripts/quandora/test/test_quandora_question.rb
+++ b/script/import_scripts/quandora/test/test_quandora_question.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'minitest/autorun'
require 'cgi'
require 'time'
diff --git a/script/import_scripts/question2answer.rb b/script/import_scripts/question2answer.rb
index 701b0a98ee7..49e233912dd 100644
--- a/script/import_scripts/question2answer.rb
+++ b/script/import_scripts/question2answer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mysql2'
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'htmlentities'
diff --git a/script/import_scripts/sfn.rb b/script/import_scripts/sfn.rb
index 3c32969c004..e9270813d72 100644
--- a/script/import_scripts/sfn.rb
+++ b/script/import_scripts/sfn.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# custom importer for www.sfn.org, feel free to borrow ideas
require "csv"
diff --git a/script/import_scripts/simplepress.rb b/script/import_scripts/simplepress.rb
index 0e4c5e22a09..6932338009d 100644
--- a/script/import_scripts/simplepress.rb
+++ b/script/import_scripts/simplepress.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mysql2'
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/smf1.rb b/script/import_scripts/smf1.rb
index 7230450e0c1..99f068c5ed8 100644
--- a/script/import_scripts/smf1.rb
+++ b/script/import_scripts/smf1.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require "htmlentities"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/smf2.rb b/script/import_scripts/smf2.rb
index 354a69ce48e..e24c9ca6c25 100644
--- a/script/import_scripts/smf2.rb
+++ b/script/import_scripts/smf2.rb
@@ -1,4 +1,6 @@
# coding: utf-8
+# frozen_string_literal: true
+
require 'mysql2'
require File.expand_path(File.dirname(__FILE__) + '/base.rb')
diff --git a/script/import_scripts/socialcast/create_title.rb b/script/import_scripts/socialcast/create_title.rb
index 1d571876dd8..8af625eddb5 100644
--- a/script/import_scripts/socialcast/create_title.rb
+++ b/script/import_scripts/socialcast/create_title.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'uri'
class CreateTitle
diff --git a/script/import_scripts/socialcast/export.rb b/script/import_scripts/socialcast/export.rb
index 01d87a583dc..1c44c7c5c99 100644
--- a/script/import_scripts/socialcast/export.rb
+++ b/script/import_scripts/socialcast/export.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'yaml'
require 'fileutils'
require_relative 'socialcast_api'
diff --git a/script/import_scripts/socialcast/import.rb b/script/import_scripts/socialcast/import.rb
index 38a711a8150..413fd18ff81 100644
--- a/script/import_scripts/socialcast/import.rb
+++ b/script/import_scripts/socialcast/import.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative './socialcast_message.rb'
require_relative './socialcast_user.rb'
require 'set'
diff --git a/script/import_scripts/socialcast/socialcast_api.rb b/script/import_scripts/socialcast/socialcast_api.rb
index 587775ad068..84fc6397703 100644
--- a/script/import_scripts/socialcast/socialcast_api.rb
+++ b/script/import_scripts/socialcast/socialcast_api.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'base64'
require 'json'
diff --git a/script/import_scripts/socialcast/socialcast_message.rb b/script/import_scripts/socialcast/socialcast_message.rb
index e121c5695d0..4c7cf7a445d 100644
--- a/script/import_scripts/socialcast/socialcast_message.rb
+++ b/script/import_scripts/socialcast/socialcast_message.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'json'
require 'cgi'
require 'time'
diff --git a/script/import_scripts/socialcast/socialcast_user.rb b/script/import_scripts/socialcast/socialcast_user.rb
index fb4217318c7..1ffc93081ce 100644
--- a/script/import_scripts/socialcast/socialcast_user.rb
+++ b/script/import_scripts/socialcast/socialcast_user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'json'
require 'cgi'
require 'time'
diff --git a/script/import_scripts/socialcast/test/test_create_title.rb b/script/import_scripts/socialcast/test/test_create_title.rb
index 03559187147..ee934a4f891 100644
--- a/script/import_scripts/socialcast/test/test_create_title.rb
+++ b/script/import_scripts/socialcast/test/test_create_title.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'minitest/autorun'
require_relative '../create_title.rb'
diff --git a/script/import_scripts/socialcast/test/test_data.rb b/script/import_scripts/socialcast/test/test_data.rb
index 73c270ea343..3b0dc6e2adc 100644
--- a/script/import_scripts/socialcast/test/test_data.rb
+++ b/script/import_scripts/socialcast/test/test_data.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
USERS = '{
"users": [
{
diff --git a/script/import_scripts/socialcast/test/test_socialcast_api.rb b/script/import_scripts/socialcast/test/test_socialcast_api.rb
index d27fec4d112..9f5430f1068 100644
--- a/script/import_scripts/socialcast/test/test_socialcast_api.rb
+++ b/script/import_scripts/socialcast/test/test_socialcast_api.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'minitest/autorun'
require 'yaml'
require_relative '../socialcast_api.rb'
diff --git a/script/import_scripts/socialcast/title.rb b/script/import_scripts/socialcast/title.rb
index 846e8bffb31..b9f0e3c8ae9 100644
--- a/script/import_scripts/socialcast/title.rb
+++ b/script/import_scripts/socialcast/title.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative './socialcast_message.rb'
require_relative './socialcast_user.rb'
require 'set'
diff --git a/script/import_scripts/sourceforge.rb b/script/import_scripts/sourceforge.rb
index 12dde957e0a..7d7de0cb8c2 100644
--- a/script/import_scripts/sourceforge.rb
+++ b/script/import_scripts/sourceforge.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'base.rb'
# Import script for SourceForge discussions.
diff --git a/script/import_scripts/stack_overflow.rb b/script/import_scripts/stack_overflow.rb
index d8ab14cc627..2eca547dbca 100644
--- a/script/import_scripts/stack_overflow.rb
+++ b/script/import_scripts/stack_overflow.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# cf. https://github.com/rails-sqlserver/tiny_tds#install
require "tiny_tds"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/support/convert_mysql_xml_to_mysql.rb b/script/import_scripts/support/convert_mysql_xml_to_mysql.rb
index a711ec33281..be0e45ca2fb 100644
--- a/script/import_scripts/support/convert_mysql_xml_to_mysql.rb
+++ b/script/import_scripts/support/convert_mysql_xml_to_mysql.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# convert huge XML dump to mysql friendly import
#
diff --git a/script/import_scripts/telligent.rb b/script/import_scripts/telligent.rb
index 7981e1d5ca7..096a8b92c98 100644
--- a/script/import_scripts/telligent.rb
+++ b/script/import_scripts/telligent.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'base'
require 'tiny_tds'
diff --git a/script/import_scripts/vanilla.rb b/script/import_scripts/vanilla.rb
index 0a9b057eec2..08f8ada44b6 100644
--- a/script/import_scripts/vanilla.rb
+++ b/script/import_scripts/vanilla.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "csv"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/vanilla_mysql.rb b/script/import_scripts/vanilla_mysql.rb
index 10882fb4ffa..10c5bdcc14a 100644
--- a/script/import_scripts/vanilla_mysql.rb
+++ b/script/import_scripts/vanilla_mysql.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'htmlentities'
diff --git a/script/import_scripts/vbulletin.rb b/script/import_scripts/vbulletin.rb
index 47c87d25844..d3fdc7c464d 100644
--- a/script/import_scripts/vbulletin.rb
+++ b/script/import_scripts/vbulletin.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mysql2'
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'htmlentities'
diff --git a/script/import_scripts/vbulletin5.rb b/script/import_scripts/vbulletin5.rb
index 424e9210537..463d3e4e025 100644
--- a/script/import_scripts/vbulletin5.rb
+++ b/script/import_scripts/vbulletin5.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'mysql2'
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'htmlentities'
diff --git a/script/import_scripts/xenforo.rb b/script/import_scripts/xenforo.rb
index ed368c5e4a0..78114d73209 100644
--- a/script/import_scripts/xenforo.rb
+++ b/script/import_scripts/xenforo.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
diff --git a/script/import_scripts/yahoogroup.rb b/script/import_scripts/yahoogroup.rb
index 0b1a5456b1f..93651e5d7f9 100644
--- a/script/import_scripts/yahoogroup.rb
+++ b/script/import_scripts/yahoogroup.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
require 'mongo'
diff --git a/script/import_scripts/zendesk.rb b/script/import_scripts/zendesk.rb
index a0eb30f9f0c..a8e44f5ffd8 100644
--- a/script/import_scripts/zendesk.rb
+++ b/script/import_scripts/zendesk.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Zendesk importer
#
# You will need a bunch of CSV files:
diff --git a/script/import_scripts/zendesk_api.rb b/script/import_scripts/zendesk_api.rb
index 00896a78f79..43749dc2712 100644
--- a/script/import_scripts/zendesk_api.rb
+++ b/script/import_scripts/zendesk_api.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Zendesk importer
#
# This one uses their API.
diff --git a/script/import_scripts/zoho.rb b/script/import_scripts/zoho.rb
index 63f374802d0..e354b79f8dc 100644
--- a/script/import_scripts/zoho.rb
+++ b/script/import_scripts/zoho.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
###
###
diff --git a/script/measure.rb b/script/measure.rb
index aaeadb19dae..9711206ae62 100644
--- a/script/measure.rb
+++ b/script/measure.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# using this script to try figure out why Ruby 2 is slower than 1.9
require 'flamegraph'
diff --git a/script/memory-analysis b/script/memory-analysis
index 616714043c7..894436bf71c 100755
--- a/script/memory-analysis
+++ b/script/memory-analysis
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require 'fileutils'
require 'pathname'
diff --git a/script/memstats.rb b/script/memstats.rb
index d70b8594a43..3eff26b8266 100755
--- a/script/memstats.rb
+++ b/script/memstats.rb
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
# from: https://gist.github.com/kenn/5105061/raw/ac7ebc6be7008c35b72560cc4e05b7cc14eb4919/memstats.rb
#------------------------------------------------------------------------------
diff --git a/script/micro_bench.rb b/script/micro_bench.rb
index 1342a1b5878..d78d057b001 100644
--- a/script/micro_bench.rb
+++ b/script/micro_bench.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'benchmark/ips'
require File.expand_path("../../config/environment", __FILE__)
diff --git a/script/mwrap_sidekiq b/script/mwrap_sidekiq
index ca5c139ac2d..4305313dc77 100755
--- a/script/mwrap_sidekiq
+++ b/script/mwrap_sidekiq
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
if !ENV["LD_PRELOAD"]&.include?('mwrap')
# use malloc from libc that interacts better with mwrap
ENV['RAILS_ENV'] = 'production'
diff --git a/script/plugin-translations.rb b/script/plugin-translations.rb
index f4ed4165c96..ce3c93819a7 100644
--- a/script/plugin-translations.rb
+++ b/script/plugin-translations.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
if ARGV.empty?
puts 'Usage: ', ''
puts ' ruby plugin-translations.rb '
diff --git a/script/profile_db_generator.rb b/script/profile_db_generator.rb
index 8e5d8f139d1..0c9d64a45df 100644
--- a/script/profile_db_generator.rb
+++ b/script/profile_db_generator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# can be used to generate a mock db for profiling purposes
# we want our script to generate a consistent output, to do so
diff --git a/script/pull_translations.rb b/script/pull_translations.rb
index eb5afbd0ec5..a4440123e79 100755
--- a/script/pull_translations.rb
+++ b/script/pull_translations.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require 'bundler/inline'
diff --git a/script/push_translations.rb b/script/push_translations.rb
index 6479ab21de9..bebdbca46ef 100755
--- a/script/push_translations.rb
+++ b/script/push_translations.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require 'bundler/inline'
diff --git a/script/rails b/script/rails
index f8da2cffd4d..d9433b818b3 100755
--- a/script/rails
+++ b/script/rails
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
APP_PATH = File.expand_path('../../config/application', __FILE__)
diff --git a/script/redis_memory.rb b/script/redis_memory.rb
index 856de2ba9e1..a092d6d4ce7 100644
--- a/script/redis_memory.rb
+++ b/script/redis_memory.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path("../../config/environment", __FILE__)
@redis = $redis.without_namespace
diff --git a/script/require_profiler.rb b/script/require_profiler.rb
index 1adc9bc86dd..a0135d08b75 100644
--- a/script/require_profiler.rb
+++ b/script/require_profiler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Some based on : https://gist.github.com/277289
#
# This is a rudimentary script that allows us to
diff --git a/script/test_email_settings.rb b/script/test_email_settings.rb
index 3a8e0f6b5f2..9ef0fc8b93d 100755
--- a/script/test_email_settings.rb
+++ b/script/test_email_settings.rb
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require 'action_mailer'
diff --git a/script/test_hbs_compiler.rb b/script/test_hbs_compiler.rb
index 192e036bf79..badbd227e4d 100644
--- a/script/test_hbs_compiler.rb
+++ b/script/test_hbs_compiler.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
template = <<~HBS
{{attach widget="wat" attrs=(hash test="abc" text=(i18n "hello" count=attrs.wat))}}
{{action-link action="undo" className="undo" text=(i18n (concat "post.actions.undo." attrs.action))}}
diff --git a/script/test_mem.rb b/script/test_mem.rb
index 16b16267b95..dd64ea2de37 100644
--- a/script/test_mem.rb
+++ b/script/test_mem.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
start = Time.now
require 'objspace'
require File.expand_path("../../config/environment", __FILE__)
diff --git a/script/test_pretty_text.rb b/script/test_pretty_text.rb
index 974094c23ff..29839d96293 100644
--- a/script/test_pretty_text.rb
+++ b/script/test_pretty_text.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.expand_path("../../config/environment", __FILE__)
puts PrettyText.cook "test"
diff --git a/script/theme-watcher b/script/theme-watcher
index 8b07cf2ef4f..208691fbf76 100755
--- a/script/theme-watcher
+++ b/script/theme-watcher
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require 'fileutils'
require 'pathname'
diff --git a/script/user_simulator.rb b/script/user_simulator.rb
index 9552fd25359..b6888499f9e 100644
--- a/script/user_simulator.rb
+++ b/script/user_simulator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# used during local testing, simulates a user active on the site.
#
# by default 1 new topic every 30 sec, 1 reply to last topic every 30 secs
diff --git a/script/version_bump.rb b/script/version_bump.rb
index d69c4ec8614..5ee5c60b2f1 100755
--- a/script/version_bump.rb
+++ b/script/version_bump.rb
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
#
# Increases the version. e.g., from 0.8.5 to 0.8.6.
# If you want to bump the minor or major version numbers, do it manually
diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb
index 6933db7e0a9..929c0c4f15e 100644
--- a/spec/components/pretty_text_spec.rb
+++ b/spec/components/pretty_text_spec.rb
@@ -1209,7 +1209,7 @@ HTML
- test
- ![upload](#{upload.short_url})
- ![upload](#{upload.short_url.gsub!(".png", "")})
+ ![upload](#{upload.short_url.gsub(".png", "")})
RAW
cooked = <<~HTML
diff --git a/spec/components/site_icon_manager_spec.rb b/spec/components/site_icon_manager_spec.rb
index 37d84b99202..ca8fe8e325e 100644
--- a/spec/components/site_icon_manager_spec.rb
+++ b/spec/components/site_icon_manager_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'rails_helper'
class GlobalPathInstance