From 30990006a92bd64eb6c49dc3139a17ce8fd1dc89 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Fri, 3 May 2019 08:17:27 +1000 Subject: [PATCH] DEV: enable frozen string literal on all files This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging --- .rubocop.yml | 3 +++ Brewfile | 2 ++ Dangerfile | 2 ++ Gemfile | 2 ++ Rakefile | 2 ++ app/controllers/about_controller.rb | 2 ++ app/controllers/admin/emojis_controller.rb | 2 ++ app/controllers/admin/flagged_topics_controller.rb | 2 ++ app/controllers/admin/flags_controller.rb | 2 ++ app/controllers/admin/groups_controller.rb | 2 ++ app/controllers/admin/impersonate_controller.rb | 2 ++ app/controllers/admin/permalinks_controller.rb | 2 ++ app/controllers/admin/plugins_controller.rb | 2 ++ app/controllers/admin/reports_controller.rb | 2 ++ .../admin/screened_emails_controller.rb | 2 ++ .../admin/screened_ip_addresses_controller.rb | 2 ++ app/controllers/admin/screened_urls_controller.rb | 2 ++ app/controllers/admin/search_logs_controller.rb | 2 ++ app/controllers/admin/site_settings_controller.rb | 2 ++ app/controllers/admin/site_texts_controller.rb | 2 ++ .../admin/staff_action_logs_controller.rb | 4 +++- app/controllers/admin/themes_controller.rb | 2 ++ app/controllers/admin/user_fields_controller.rb | 2 ++ app/controllers/admin/users_controller.rb | 2 ++ app/controllers/admin/versions_controller.rb | 2 ++ app/controllers/admin/watched_words_controller.rb | 2 ++ app/controllers/admin/web_hooks_controller.rb | 2 ++ app/controllers/badges_controller.rb | 2 ++ app/controllers/categories_controller.rb | 2 ++ app/controllers/category_hashtags_controller.rb | 2 ++ app/controllers/clicks_controller.rb | 2 ++ app/controllers/composer_controller.rb | 2 ++ app/controllers/composer_messages_controller.rb | 2 ++ app/controllers/directory_items_controller.rb | 2 ++ app/controllers/draft_controller.rb | 2 ++ app/controllers/drafts_controller.rb | 2 ++ app/controllers/email_controller.rb | 2 ++ app/controllers/embed_controller.rb | 2 ++ app/controllers/exceptions_controller.rb | 2 ++ app/controllers/export_csv_controller.rb | 2 ++ app/controllers/finish_installation_controller.rb | 2 ++ app/controllers/groups_controller.rb | 2 ++ app/controllers/highlight_js_controller.rb | 2 ++ app/controllers/inline_onebox_controller.rb | 2 ++ app/controllers/invites_controller.rb | 2 ++ app/controllers/list_controller.rb | 2 ++ app/controllers/notifications_controller.rb | 2 ++ app/controllers/offline_controller.rb | 2 ++ app/controllers/onebox_controller.rb | 2 ++ app/controllers/permalinks_controller.rb | 2 ++ app/controllers/post_action_users_controller.rb | 2 ++ app/controllers/post_actions_controller.rb | 2 ++ app/controllers/posts_controller.rb | 4 +++- app/controllers/push_notification_controller.rb | 2 ++ app/controllers/queued_posts_controller.rb | 2 ++ app/controllers/qunit_controller.rb | 2 ++ app/controllers/robots_txt_controller.rb | 2 ++ app/controllers/safe_mode_controller.rb | 2 ++ app/controllers/search_controller.rb | 2 ++ app/controllers/session_controller.rb | 2 ++ app/controllers/similar_topics_controller.rb | 2 ++ app/controllers/site_controller.rb | 2 ++ app/controllers/static_controller.rb | 4 +++- app/controllers/steps_controller.rb | 2 ++ app/controllers/stylesheets_controller.rb | 2 ++ app/controllers/tag_groups_controller.rb | 2 ++ app/controllers/tags_controller.rb | 2 ++ app/controllers/themes_controller.rb | 2 ++ app/controllers/topics_controller.rb | 2 ++ app/controllers/uploads_controller.rb | 2 ++ app/controllers/user_actions_controller.rb | 2 ++ app/controllers/user_api_keys_controller.rb | 4 +++- app/controllers/user_avatars_controller.rb | 2 ++ app/controllers/user_badges_controller.rb | 2 ++ .../users/omniauth_callbacks_controller.rb | 4 +++- app/controllers/users_controller.rb | 2 ++ app/controllers/users_email_controller.rb | 2 ++ app/controllers/webhooks_controller.rb | 2 ++ app/controllers/wizard_controller.rb | 2 ++ app/helpers/common_helper.rb | 2 ++ app/helpers/email_helper.rb | 2 ++ app/helpers/embed_helper.rb | 2 ++ app/helpers/list_helper.rb | 2 ++ app/helpers/topics_helper.rb | 2 ++ app/helpers/user_notifications_helper.rb | 6 ++++-- app/jobs/base.rb | 2 ++ app/jobs/concerns/skippable.rb | 2 ++ app/jobs/onceoff.rb | 2 ++ app/jobs/onceoff/clean_up_sidekiq_statistic.rb | 2 ++ app/jobs/onceoff/clear_width_and_height.rb | 2 ++ app/jobs/onceoff/correct_missing_dualstack_urls.rb | 2 ++ app/jobs/onceoff/create_tags_search_index.rb | 2 ++ app/jobs/onceoff/fix_featured_link_for_topics.rb | 2 ++ app/jobs/onceoff/fix_invalid_gravatar_uploads.rb | 2 ++ app/jobs/onceoff/fix_invalid_upload_extensions.rb | 2 ++ .../fix_out_of_sync_user_uploaded_avatar.rb | 2 ++ app/jobs/onceoff/fix_posts_read.rb | 2 ++ .../onceoff/fix_primary_emails_for_staged_users.rb | 2 ++ app/jobs/onceoff/fix_retro_anniversary.rb | 2 ++ app/jobs/onceoff/fix_s3_etags.rb | 2 ++ app/jobs/onceoff/grant_emoji.rb | 2 ++ app/jobs/onceoff/grant_first_reply_by_email.rb | 2 ++ app/jobs/onceoff/grant_onebox.rb | 2 ++ app/jobs/onceoff/init_category_tag_stats.rb | 2 ++ app/jobs/onceoff/migrate_censored_words.rb | 2 ++ app/jobs/onceoff/migrate_custom_emojis.rb | 2 ++ app/jobs/onceoff/migrate_featured_links.rb | 2 ++ app/jobs/onceoff/migrate_tagging_plugin.rb | 2 ++ app/jobs/onceoff/migrate_upload_extensions.rb | 2 ++ app/jobs/onceoff/migrate_url_site_settings.rb | 2 ++ app/jobs/onceoff/post_uploads_recovery.rb | 2 ++ app/jobs/onceoff/remove_old_auto_close_jobs.rb | 2 ++ app/jobs/onceoff/retro_grant_anniversary.rb | 2 ++ app/jobs/onceoff/retro_recent_time_read.rb | 2 ++ app/jobs/regular/admin_confirmation_email.rb | 2 ++ app/jobs/regular/anonymize_user.rb | 2 ++ app/jobs/regular/automatic_group_membership.rb | 2 ++ app/jobs/regular/backup_chunks_merger.rb | 2 ++ app/jobs/regular/bulk_grant_trust_level.rb | 2 ++ app/jobs/regular/bulk_invite.rb | 2 ++ app/jobs/regular/bump_topic.rb | 2 ++ app/jobs/regular/confirm_sns_subscription.rb | 2 ++ app/jobs/regular/crawl_topic_link.rb | 2 ++ app/jobs/regular/create_avatar_thumbnails.rb | 2 ++ app/jobs/regular/create_backup.rb | 2 ++ app/jobs/regular/create_user_reviewable.rb | 2 ++ app/jobs/regular/critical_user_email.rb | 2 ++ app/jobs/regular/delete_topic.rb | 2 ++ app/jobs/regular/download_avatar_from_url.rb | 2 ++ app/jobs/regular/download_backup_email.rb | 2 ++ .../download_profile_background_from_url.rb | 2 ++ app/jobs/regular/emit_web_hook_event.rb | 2 ++ app/jobs/regular/enable_bootstrap_mode.rb | 2 ++ app/jobs/regular/export_csv_file.rb | 2 ++ app/jobs/regular/feature_topic_users.rb | 2 ++ app/jobs/regular/invite_email.rb | 2 ++ .../regular/invite_password_instructions_email.rb | 2 ++ app/jobs/regular/notify_category_change.rb | 2 ++ .../regular/notify_mailing_list_subscribers.rb | 2 ++ app/jobs/regular/notify_moved_posts.rb | 2 ++ app/jobs/regular/notify_reviewable.rb | 2 ++ app/jobs/regular/notify_tag_change.rb | 2 ++ app/jobs/regular/post_alert.rb | 2 ++ app/jobs/regular/process_email.rb | 2 ++ app/jobs/regular/process_post.rb | 2 ++ app/jobs/regular/process_sns_notification.rb | 2 ++ app/jobs/regular/publish_topic_to_category.rb | 2 ++ app/jobs/regular/pull_hotlinked_images.rb | 2 ++ app/jobs/regular/push_notification.rb | 2 ++ app/jobs/regular/rebake_custom_emoji_posts.rb | 2 ++ app/jobs/regular/retrieve_topic.rb | 2 ++ app/jobs/regular/run_heartbeat.rb | 2 ++ app/jobs/regular/send_push_notification.rb | 2 ++ app/jobs/regular/send_system_message.rb | 2 ++ app/jobs/regular/suspicious_login.rb | 2 ++ app/jobs/regular/toggle_topic_closed.rb | 2 ++ app/jobs/regular/topic_action_converter.rb | 2 ++ app/jobs/regular/topic_reminder.rb | 2 ++ app/jobs/regular/truncate_user_flag_stats.rb | 2 ++ app/jobs/regular/unpin_topic.rb | 2 ++ app/jobs/regular/update_gravatar.rb | 2 ++ app/jobs/regular/update_group_mentions.rb | 2 ++ app/jobs/regular/update_s3_inventory.rb | 2 ++ app/jobs/regular/update_top_redirection.rb | 2 ++ app/jobs/regular/update_username.rb | 2 ++ app/jobs/regular/user_email.rb | 2 ++ app/jobs/scheduled/about_stats.rb | 2 ++ app/jobs/scheduled/activation_reminder_emails.rb | 2 ++ app/jobs/scheduled/auto_expire_user_api_keys.rb | 2 ++ app/jobs/scheduled/auto_queue_handler.rb | 2 ++ app/jobs/scheduled/badge_grant.rb | 2 ++ app/jobs/scheduled/category_stats.rb | 2 ++ app/jobs/scheduled/check_out_of_date_themes.rb | 2 ++ app/jobs/scheduled/clean_up_associated_accounts.rb | 2 ++ app/jobs/scheduled/clean_up_crawler_stats.rb | 2 ++ .../clean_up_deprecated_url_site_settings.rb | 2 ++ app/jobs/scheduled/clean_up_email_logs.rb | 2 ++ app/jobs/scheduled/clean_up_exports.rb | 2 ++ app/jobs/scheduled/clean_up_inactive_users.rb | 2 ++ app/jobs/scheduled/clean_up_post_reply_keys.rb | 2 ++ app/jobs/scheduled/clean_up_search_logs.rb | 2 ++ app/jobs/scheduled/clean_up_unmatched_emails.rb | 2 ++ app/jobs/scheduled/clean_up_unmatched_ips.rb | 2 ++ app/jobs/scheduled/clean_up_unsubscribe_keys.rb | 2 ++ app/jobs/scheduled/clean_up_unused_staged_users.rb | 2 ++ app/jobs/scheduled/clean_up_uploads.rb | 2 ++ app/jobs/scheduled/create_missing_avatars.rb | 2 ++ app/jobs/scheduled/dashboard_stats.rb | 2 ++ app/jobs/scheduled/destroy_old_deletion_stubs.rb | 2 ++ app/jobs/scheduled/destroy_old_hidden_posts.rb | 2 ++ app/jobs/scheduled/directory_refresh_daily.rb | 2 ++ app/jobs/scheduled/directory_refresh_older.rb | 2 ++ app/jobs/scheduled/disable_bootstrap_mode.rb | 2 ++ app/jobs/scheduled/enqueue_digest_emails.rb | 2 ++ app/jobs/scheduled/enqueue_onceoffs.rb | 2 ++ app/jobs/scheduled/ensure_db_consistency.rb | 2 ++ .../fix_user_usernames_and_groups_names_clash.rb | 2 ++ app/jobs/scheduled/grant_anniversary_badges.rb | 2 ++ .../grant_new_user_of_the_month_badges.rb | 2 ++ app/jobs/scheduled/heartbeat.rb | 2 ++ app/jobs/scheduled/ignored_users_summary.rb | 2 ++ app/jobs/scheduled/invalidate_inactive_admins.rb | 2 ++ app/jobs/scheduled/migrate_upload_scheme.rb | 2 ++ .../scheduled/pending_queued_posts_reminder.rb | 2 ++ app/jobs/scheduled/pending_reviewables_reminder.rb | 2 ++ app/jobs/scheduled/pending_users_reminder.rb | 2 ++ app/jobs/scheduled/periodical_updates.rb | 2 ++ app/jobs/scheduled/poll_feed.rb | 2 ++ app/jobs/scheduled/poll_mailbox.rb | 2 ++ app/jobs/scheduled/process_badge_backlog.rb | 2 ++ app/jobs/scheduled/purge_deleted_uploads.rb | 2 ++ app/jobs/scheduled/purge_expired_ignored_users.rb | 2 ++ app/jobs/scheduled/purge_old_web_hook_events.rb | 2 ++ app/jobs/scheduled/purge_unactivated.rb | 2 ++ app/jobs/scheduled/reindex_search.rb | 2 ++ app/jobs/scheduled/schedule_backup.rb | 1 + app/jobs/scheduled/tl3_promotions.rb | 2 ++ app/jobs/scheduled/top_refresh_older.rb | 2 ++ app/jobs/scheduled/top_refresh_today.rb | 2 ++ app/jobs/scheduled/unsilence_users.rb | 2 ++ app/jobs/scheduled/version_check.rb | 2 ++ app/jobs/scheduled/weekly.rb | 2 ++ app/mailers/admin_confirmation_mailer.rb | 2 ++ app/mailers/download_backup_mailer.rb | 2 ++ app/mailers/invite_mailer.rb | 2 ++ app/mailers/rejection_mailer.rb | 2 ++ app/mailers/subscription_mailer.rb | 2 ++ app/mailers/test_mailer.rb | 2 ++ app/mailers/user_notifications.rb | 6 ++++-- app/mailers/version_mailer.rb | 2 ++ app/models/about.rb | 2 ++ app/models/admin_dashboard_data.rb | 2 ++ app/models/admin_dashboard_general_data.rb | 2 ++ app/models/admin_dashboard_index_data.rb | 2 ++ app/models/api_key.rb | 2 ++ app/models/auto_track_duration_site_setting.rb | 2 ++ app/models/backup_file.rb | 2 ++ app/models/badge.rb | 2 ++ app/models/badge_grouping.rb | 2 ++ app/models/badge_type.rb | 2 ++ app/models/category_and_topic_lists.rb | 2 ++ app/models/category_custom_field.rb | 2 ++ app/models/category_featured_topic.rb | 2 ++ app/models/category_group.rb | 2 ++ app/models/category_list.rb | 2 ++ app/models/category_page_style.rb | 2 ++ app/models/category_search_data.rb | 2 ++ app/models/category_tag.rb | 2 ++ app/models/category_tag_group.rb | 2 ++ app/models/category_tag_stat.rb | 2 ++ app/models/category_user.rb | 2 ++ app/models/child_theme.rb | 2 ++ app/models/color_scheme_color.rb | 2 ++ app/models/concerns/anon_cache_invalidator.rb | 2 ++ app/models/concerns/cached_counting.rb | 2 ++ app/models/concerns/category_hashtag.rb | 2 ++ app/models/concerns/has_custom_fields.rb | 2 ++ app/models/concerns/has_destroyed_web_hook.rb | 2 ++ app/models/concerns/has_search_data.rb | 2 ++ app/models/concerns/has_url.rb | 2 ++ app/models/concerns/limited_edit.rb | 2 ++ app/models/concerns/positionable.rb | 2 ++ app/models/concerns/roleable.rb | 2 ++ app/models/concerns/searchable.rb | 2 ++ app/models/concerns/second_factor_manager.rb | 2 ++ app/models/concerns/stats_cacheable.rb | 2 ++ app/models/concerns/trashable.rb | 2 ++ app/models/custom_emoji.rb | 2 ++ app/models/developer.rb | 2 ++ app/models/digest_email_site_setting.rb | 2 ++ app/models/discourse_single_sign_on.rb | 2 ++ app/models/discourse_version_check.rb | 2 ++ app/models/draft_sequence.rb | 2 ++ app/models/email_change_request.rb | 2 ++ app/models/email_level_site_setting.rb | 2 ++ app/models/email_log.rb | 2 ++ app/models/email_token.rb | 2 ++ app/models/embeddable_host.rb | 2 ++ app/models/embedding.rb | 2 ++ app/models/emoji.rb | 2 ++ app/models/emoji_set_site_setting.rb | 2 ++ app/models/github_user_info.rb | 2 ++ app/models/given_daily_like.rb | 2 ++ app/models/global_setting.rb | 4 +++- app/models/group_archived_message.rb | 2 ++ app/models/group_custom_field.rb | 2 ++ app/models/group_history.rb | 2 ++ app/models/group_manager.rb | 2 ++ app/models/group_mention.rb | 2 ++ app/models/group_request.rb | 2 ++ app/models/group_user.rb | 2 ++ app/models/ignored_user.rb | 2 ++ app/models/incoming_domain.rb | 2 ++ app/models/incoming_email.rb | 2 ++ app/models/incoming_link.rb | 2 +- app/models/incoming_links_report.rb | 2 ++ app/models/incoming_referer.rb | 2 ++ app/models/instagram_user_info.rb | 2 ++ app/models/invite.rb | 2 ++ app/models/invite_redeemer.rb | 2 ++ app/models/invited_group.rb | 2 ++ .../like_notification_frequency_site_setting.rb | 2 ++ app/models/locale_site_setting.rb | 2 ++ app/models/mailing_list_mode_site_setting.rb | 2 ++ app/models/muted_user.rb | 2 ++ app/models/new_topic_duration_site_setting.rb | 2 ++ app/models/notification.rb | 2 ++ ...otification_level_when_replying_site_setting.rb | 2 ++ app/models/oauth2_user_info.rb | 2 ++ app/models/onceoff_log.rb | 2 ++ app/models/optimized_image.rb | 2 ++ app/models/permalink.rb | 6 ++++-- app/models/plugin_store.rb | 2 ++ app/models/plugin_store_row.rb | 2 ++ app/models/post.rb | 6 ++++-- app/models/post_action.rb | 4 +++- app/models/post_action_type.rb | 2 ++ app/models/post_analyzer.rb | 2 ++ app/models/post_custom_field.rb | 2 ++ app/models/post_detail.rb | 2 ++ app/models/post_mover.rb | 2 ++ app/models/post_reply.rb | 2 ++ app/models/post_reply_key.rb | 2 ++ app/models/post_revision.rb | 2 ++ app/models/post_search_data.rb | 2 ++ app/models/post_stat.rb | 2 ++ app/models/post_upload.rb | 2 ++ app/models/previous_replies_site_setting.rb | 2 ++ app/models/push_subscription.rb | 2 ++ app/models/quoted_post.rb | 2 ++ app/models/remote_theme.rb | 2 ++ app/models/report.rb | 2 ++ app/models/reports/bookmarks.rb | 2 ++ app/models/reports/consolidated_page_views.rb | 2 ++ app/models/reports/daily_engaged_users.rb | 2 ++ app/models/reports/dau_by_mau.rb | 2 ++ app/models/reports/emails.rb | 2 ++ app/models/reports/flags.rb | 2 ++ app/models/reports/flags_status.rb | 2 ++ app/models/reports/likes.rb | 2 ++ .../reports/moderator_warning_private_messages.rb | 2 ++ app/models/reports/moderators_activity.rb | 2 ++ app/models/reports/new_contributors.rb | 2 ++ .../reports/notify_moderators_private_messages.rb | 2 ++ app/models/reports/notify_user_private_messages.rb | 2 ++ app/models/reports/post_edits.rb | 2 ++ app/models/reports/posts.rb | 2 ++ app/models/reports/profile_views.rb | 2 ++ app/models/reports/signups.rb | 2 ++ app/models/reports/staff_logins.rb | 2 ++ app/models/reports/storage_stats.rb | 2 ++ app/models/reports/suspicious_logins.rb | 2 ++ app/models/reports/system_private_messages.rb | 2 ++ app/models/reports/time_to_first_response.rb | 2 ++ app/models/reports/top_ignored_users.rb | 2 ++ app/models/reports/top_referred_topics.rb | 2 ++ app/models/reports/top_referrers.rb | 2 ++ app/models/reports/top_traffic_sources.rb | 2 ++ app/models/reports/top_uploads.rb | 2 ++ app/models/reports/topics.rb | 2 ++ app/models/reports/topics_with_no_response.rb | 2 ++ app/models/reports/trending_search.rb | 2 ++ app/models/reports/user_flagging_ratio.rb | 2 ++ .../reports/user_to_user_private_messages.rb | 2 ++ .../user_to_user_private_messages_with_replies.rb | 2 ++ app/models/reports/users_by_trust_level.rb | 2 ++ app/models/reports/users_by_type.rb | 2 ++ app/models/reports/visits.rb | 2 ++ app/models/reports/visits_mobile.rb | 2 ++ app/models/reports/web_crawlers.rb | 2 ++ app/models/reviewable.rb | 2 ++ app/models/reviewable_flagged_post.rb | 2 ++ app/models/reviewable_history.rb | 2 ++ app/models/reviewable_queued_post.rb | 2 ++ app/models/reviewable_score.rb | 2 ++ app/models/reviewable_user.rb | 2 ++ app/models/s3_region_site_setting.rb | 2 ++ app/models/screened_email.rb | 2 ++ app/models/screened_ip_address.rb | 2 ++ app/models/screened_url.rb | 2 ++ app/models/search_log.rb | 2 ++ app/models/shared_draft.rb | 2 ++ app/models/single_sign_on_record.rb | 2 ++ app/models/site.rb | 2 ++ app/models/site_setting.rb | 2 ++ app/models/skipped_email_log.rb | 2 ++ app/models/slug_setting.rb | 2 ++ app/models/stylesheet_cache.rb | 2 ++ app/models/tag.rb | 2 ++ app/models/tag_group.rb | 2 ++ app/models/tag_group_membership.rb | 2 ++ app/models/tag_group_permission.rb | 2 ++ app/models/tag_search_data.rb | 2 ++ app/models/tag_user.rb | 2 ++ app/models/theme_field.rb | 2 ++ app/models/theme_setting.rb | 2 ++ app/models/theme_translation_override.rb | 2 ++ app/models/top_lists.rb | 2 ++ app/models/top_menu_item.rb | 2 ++ app/models/top_topic.rb | 2 ++ app/models/topic.rb | 4 +++- app/models/topic_allowed_group.rb | 2 ++ app/models/topic_allowed_user.rb | 2 ++ app/models/topic_converter.rb | 2 ++ app/models/topic_custom_field.rb | 2 ++ app/models/topic_embed.rb | 6 ++++-- app/models/topic_featured_users.rb | 2 ++ app/models/topic_invite.rb | 2 ++ app/models/topic_link.rb | 4 +++- app/models/topic_link_click.rb | 2 ++ app/models/topic_list.rb | 2 ++ app/models/topic_notifier.rb | 2 ++ app/models/topic_participants_summary.rb | 2 ++ app/models/topic_poster.rb | 2 ++ app/models/topic_posters_summary.rb | 4 +++- app/models/topic_search_data.rb | 2 ++ app/models/topic_tag.rb | 2 ++ app/models/topic_timer.rb | 2 ++ app/models/topic_user.rb | 2 ++ app/models/topic_view_item.rb | 4 +++- app/models/translation_override.rb | 2 ++ app/models/trust_level3_requirements.rb | 2 ++ app/models/trust_level_and_staff_setting.rb | 2 ++ app/models/trust_level_setting.rb | 2 ++ app/models/unsubscribe_key.rb | 2 ++ app/models/upload.rb | 2 ++ app/models/user.rb | 4 +++- app/models/user_action.rb | 2 ++ app/models/user_api_key.rb | 2 ++ app/models/user_archived_message.rb | 2 ++ app/models/user_associated_account.rb | 2 ++ app/models/user_auth_token_log.rb | 2 ++ app/models/user_avatar.rb | 2 ++ app/models/user_badge.rb | 2 ++ app/models/user_badges.rb | 2 ++ app/models/user_custom_field.rb | 2 ++ app/models/user_email.rb | 2 ++ app/models/user_export.rb | 2 ++ app/models/user_field.rb | 2 ++ app/models/user_field_option.rb | 2 ++ app/models/user_history.rb | 2 ++ app/models/user_open_id.rb | 2 ++ app/models/user_option.rb | 2 ++ app/models/user_profile.rb | 2 ++ app/models/user_profile_view.rb | 4 +++- app/models/user_search.rb | 2 ++ app/models/user_search_data.rb | 2 ++ app/models/user_second_factor.rb | 2 ++ app/models/user_summary.rb | 2 ++ app/models/user_upload.rb | 2 ++ app/models/user_visit.rb | 2 ++ app/models/user_warning.rb | 2 ++ app/models/username_validator.rb | 2 ++ app/models/watched_word.rb | 2 ++ app/models/web_crawler_request.rb | 2 ++ app/models/web_hook.rb | 2 ++ app/models/web_hook_event.rb | 2 ++ app/models/web_hook_event_type.rb | 2 ++ app/serializers/about_serializer.rb | 2 ++ app/serializers/admin_badge_serializer.rb | 2 ++ app/serializers/admin_badges_serializer.rb | 2 ++ app/serializers/admin_detailed_user_serializer.rb | 2 ++ app/serializers/admin_email_template_serializer.rb | 2 ++ app/serializers/admin_plugin_serializer.rb | 2 ++ app/serializers/admin_user_action_serializer.rb | 2 ++ app/serializers/admin_user_list_serializer.rb | 2 ++ app/serializers/admin_user_serializer.rb | 2 ++ app/serializers/admin_web_hook_event_serializer.rb | 2 ++ app/serializers/admin_web_hook_serializer.rb | 2 ++ app/serializers/api_key_serializer.rb | 2 ++ app/serializers/application_serializer.rb | 2 ++ app/serializers/archetype_serializer.rb | 2 ++ app/serializers/auth_provider_serializer.rb | 2 ++ app/serializers/backup_file_serializer.rb | 2 ++ app/serializers/badge_grouping_serializer.rb | 2 ++ app/serializers/badge_index_serializer.rb | 2 ++ app/serializers/badge_serializer.rb | 2 ++ app/serializers/badge_type_serializer.rb | 2 ++ app/serializers/basic_category_serializer.rb | 2 ++ app/serializers/basic_group_history_serializer.rb | 2 ++ app/serializers/basic_group_serializer.rb | 2 ++ app/serializers/basic_group_user_serializer.rb | 2 ++ app/serializers/basic_post_serializer.rb | 2 ++ app/serializers/basic_topic_serializer.rb | 2 ++ app/serializers/basic_user_badge_serializer.rb | 2 ++ app/serializers/basic_user_serializer.rb | 2 ++ .../category_and_topic_lists_serializer.rb | 2 ++ app/serializers/category_detailed_serializer.rb | 2 ++ app/serializers/category_list_serializer.rb | 2 ++ app/serializers/category_serializer.rb | 2 ++ app/serializers/category_upload_serializer.rb | 2 ++ app/serializers/color_scheme_color_serializer.rb | 2 ++ app/serializers/color_scheme_serializer.rb | 2 ++ app/serializers/concerns/email_logs_mixin.rb | 2 ++ app/serializers/concerns/topic_tags_mixin.rb | 2 ++ app/serializers/concerns/user_auth_tokens_mixin.rb | 2 ++ .../concerns/user_primary_group_mixin.rb | 2 ++ app/serializers/current_user_serializer.rb | 2 ++ app/serializers/detailed_user_badge_serializer.rb | 2 ++ app/serializers/directory_item_serializer.rb | 2 ++ app/serializers/directory_serializer.rb | 2 ++ .../discourse_version_check_serializer.rb | 2 ++ app/serializers/draft_serializer.rb | 2 ++ app/serializers/email_log_serializer.rb | 2 ++ app/serializers/embeddable_host_serializer.rb | 2 ++ app/serializers/embedding_serializer.rb | 2 ++ app/serializers/emoji_serializer.rb | 2 ++ app/serializers/flagged_topic_serializer.rb | 2 ++ .../flagged_topic_summary_serializer.rb | 2 ++ app/serializers/flagged_user_serializer.rb | 2 ++ app/serializers/gap_serializer.rb | 2 ++ app/serializers/group_post_serializer.rb | 2 ++ app/serializers/group_post_user_serializer.rb | 2 ++ app/serializers/group_requester_serializer.rb | 2 ++ app/serializers/group_show_serializer.rb | 2 ++ app/serializers/group_user_serializer.rb | 2 ++ app/serializers/grouped_screened_url_serializer.rb | 2 ++ .../grouped_search_result_serializer.rb | 2 ++ app/serializers/hidden_profile_serializer.rb | 2 ++ .../incoming_email_details_serializer.rb | 2 ++ app/serializers/incoming_email_serializer.rb | 2 ++ app/serializers/invite_serializer.rb | 2 ++ app/serializers/invited_user_serializer.rb | 2 ++ app/serializers/listable_topic_serializer.rb | 2 ++ app/serializers/new_post_result_serializer.rb | 2 ++ app/serializers/notification_serializer.rb | 2 ++ app/serializers/penalty_counts_serializer.rb | 2 ++ app/serializers/permalink_serializer.rb | 2 ++ app/serializers/post_action_type_serializer.rb | 2 ++ app/serializers/post_action_user_serializer.rb | 2 ++ app/serializers/post_item_excerpt.rb | 2 ++ app/serializers/post_revision_serializer.rb | 2 ++ app/serializers/post_serializer.rb | 2 ++ app/serializers/post_stream_serializer_mixin.rb | 2 ++ app/serializers/post_wordpress_serializer.rb | 2 ++ app/serializers/primary_group_serializer.rb | 2 ++ app/serializers/queued_post_serializer.rb | 2 ++ app/serializers/reviewable_action_serializer.rb | 2 ++ .../reviewable_bundled_action_serializer.rb | 2 ++ .../reviewable_conversation_post_serializer.rb | 2 ++ .../reviewable_conversation_serializer.rb | 2 ++ .../reviewable_editable_field_serializer.rb | 2 ++ .../reviewable_flagged_post_serializer.rb | 2 ++ app/serializers/reviewable_history_serializer.rb | 2 ++ .../reviewable_perform_result_serializer.rb | 2 ++ .../reviewable_queued_post_serializer.rb | 2 ++ .../reviewable_score_bonus_serializer.rb | 2 ++ app/serializers/reviewable_score_serializer.rb | 2 ++ .../reviewable_score_type_serializer.rb | 2 ++ app/serializers/reviewable_serializer.rb | 2 ++ app/serializers/reviewable_settings_serializer.rb | 2 ++ app/serializers/reviewable_topic_serializer.rb | 2 ++ app/serializers/reviewable_user_serializer.rb | 2 ++ app/serializers/screened_email_serializer.rb | 2 ++ app/serializers/screened_ip_address_serializer.rb | 2 ++ app/serializers/screened_url_serializer.rb | 2 ++ app/serializers/search_logs_serializer.rb | 2 ++ app/serializers/search_post_serializer.rb | 2 ++ app/serializers/search_result_user_serializer.rb | 2 ++ .../search_topic_list_item_serializer.rb | 2 ++ app/serializers/similar_topic_serializer.rb | 2 ++ .../single_sign_on_record_serializer.rb | 2 ++ app/serializers/site_serializer.rb | 2 ++ app/serializers/site_text_serializer.rb | 2 ++ app/serializers/skipped_email_log_serializer.rb | 2 ++ app/serializers/staff_action_logs_serializer.rb | 2 ++ app/serializers/suggested_topic_serializer.rb | 2 ++ app/serializers/suggested_topics_mixin.rb | 2 ++ app/serializers/tag_group_serializer.rb | 2 ++ app/serializers/tag_serializer.rb | 2 ++ app/serializers/theme_serializer.rb | 2 ++ app/serializers/theme_settings_serializer.rb | 2 ++ app/serializers/theme_translation_serializer.rb | 2 ++ app/serializers/top_list_serializer.rb | 2 ++ app/serializers/topic_embed_serializer.rb | 2 ++ app/serializers/topic_flag_type_serializer.rb | 2 ++ app/serializers/topic_link_serializer.rb | 2 ++ app/serializers/topic_list_item_serializer.rb | 2 ++ app/serializers/topic_list_serializer.rb | 2 ++ app/serializers/topic_pending_post_serializer.rb | 2 ++ app/serializers/topic_post_count_serializer.rb | 2 ++ app/serializers/topic_poster_serializer.rb | 2 ++ app/serializers/topic_timer_serializer.rb | 2 ++ app/serializers/topic_tracking_state_serializer.rb | 2 ++ app/serializers/topic_view_details_serializer.rb | 2 ++ app/serializers/topic_view_posts_serializer.rb | 2 ++ app/serializers/topic_view_serializer.rb | 2 ++ app/serializers/topic_view_wordpress_serializer.rb | 2 ++ .../trust_level3_requirements_serializer.rb | 2 ++ app/serializers/trust_level_serializer.rb | 2 ++ app/serializers/upload_serializer.rb | 2 ++ app/serializers/user_action_serializer.rb | 2 ++ app/serializers/user_auth_token_log_serializer.rb | 2 ++ app/serializers/user_auth_token_serializer.rb | 2 ++ app/serializers/user_badge_serializer.rb | 2 ++ app/serializers/user_badges_serializer.rb | 2 ++ app/serializers/user_field_serializer.rb | 2 ++ app/serializers/user_history_serializer.rb | 2 ++ app/serializers/user_name_serializer.rb | 2 ++ app/serializers/user_option_serializer.rb | 2 ++ app/serializers/user_serializer.rb | 2 ++ app/serializers/user_summary_serializer.rb | 2 ++ app/serializers/user_wordpress_serializer.rb | 2 ++ app/serializers/watched_word_list_serializer.rb | 2 ++ app/serializers/watched_word_serializer.rb | 2 ++ app/serializers/web_hook_category_serializer.rb | 2 ++ app/serializers/web_hook_flag_serializer.rb | 2 ++ app/serializers/web_hook_group_serializer.rb | 2 ++ app/serializers/web_hook_post_serializer.rb | 2 ++ app/serializers/web_hook_topic_view_serializer.rb | 2 ++ app/serializers/web_hook_user_serializer.rb | 2 ++ app/serializers/wizard_field_choice_serializer.rb | 2 ++ app/serializers/wizard_field_serializer.rb | 2 ++ app/serializers/wizard_serializer.rb | 2 ++ app/serializers/wizard_step_serializer.rb | 2 ++ app/services/anonymous_shadow_creator.rb | 2 ++ app/services/badge_granter.rb | 2 ++ app/services/color_scheme_revisor.rb | 2 ++ app/services/destroy_task.rb | 2 ++ app/services/group_action_logger.rb | 2 ++ app/services/group_mentions_updater.rb | 2 ++ app/services/group_message.rb | 2 ++ app/services/handle_chunk_upload.rb | 2 ++ app/services/notification_emailer.rb | 2 ++ app/services/post_action_notifier.rb | 2 ++ app/services/post_alerter.rb | 4 +++- app/services/post_owner_changer.rb | 2 ++ app/services/push_notification_pusher.rb | 2 ++ app/services/random_topic_selector.rb | 2 ++ app/services/site_settings_task.rb | 2 ++ app/services/spam_rule/auto_silence.rb | 2 ++ app/services/spam_rule/flag_sockpuppets.rb | 2 ++ app/services/staff_action_logger.rb | 2 ++ app/services/topic_status_updater.rb | 4 +++- app/services/topic_timestamp_changer.rb | 2 ++ app/services/tracked_topics_updater.rb | 2 ++ app/services/trust_level_granter.rb | 2 ++ app/services/user_action_manager.rb | 2 ++ app/services/user_activator.rb | 2 ++ app/services/user_anonymizer.rb | 2 ++ app/services/user_authenticator.rb | 2 ++ app/services/user_destroyer.rb | 2 ++ app/services/user_merger.rb | 2 ++ app/services/user_silencer.rb | 2 ++ app/services/user_updater.rb | 2 ++ app/services/username_changer.rb | 2 ++ app/services/username_checker_service.rb | 2 ++ app/services/wildcard_domain_checker.rb | 2 ++ app/services/wildcard_url_checker.rb | 2 ++ app/services/word_watcher.rb | 2 ++ bin/bundle | 2 ++ bin/rails | 1 + bin/rake | 1 + bin/rspec | 2 ++ bin/unicorn | 1 + config.ru | 2 ++ config/boot.rb | 2 ++ config/cloud/cloud66/files/production.rb | 2 ++ config/environment.rb | 2 ++ config/environments/development.rb | 2 ++ config/environments/production.rb | 2 ++ config/environments/profile.rb | 2 ++ config/environments/test.rb | 2 ++ config/initializers/000-mini_sql.rb | 2 ++ config/initializers/000-post_migration.rb | 2 ++ config/initializers/001-redis.rb | 2 ++ config/initializers/002-freedom_patches.rb | 2 ++ config/initializers/003-sql_builder.rb | 2 ++ config/initializers/004-message_bus.rb | 2 ++ config/initializers/005-site_settings.rb | 2 ++ config/initializers/006-ensure_login_hint.rb | 2 ++ config/initializers/006-mini_profiler.rb | 2 ++ config/initializers/009-omniauth.rb | 2 ++ config/initializers/010-discourse_iife.rb | 2 ++ config/initializers/011-rack-protection.rb | 2 ++ config/initializers/012-web_hook_events.rb | 2 ++ config/initializers/013-excon_defaults.rb | 2 ++ config/initializers/014-track-setting-changes.rb | 2 ++ config/initializers/050-force_https.rb | 2 ++ config/initializers/099-anon-cache.rb | 2 ++ config/initializers/099-defer.rb | 2 ++ config/initializers/099-drain_pool.rb | 2 ++ config/initializers/100-i18n.rb | 2 ++ config/initializers/100-logster.rb | 2 ++ config/initializers/100-oj.rb | 2 ++ config/initializers/100-onebox_options.rb | 2 ++ config/initializers/100-push-notifications.rb | 2 ++ config/initializers/100-quiet_logger.rb | 2 ++ config/initializers/100-secret_token.rb | 2 ++ config/initializers/100-session_store.rb | 2 ++ config/initializers/100-sidekiq.rb | 2 ++ config/initializers/100-silence_logger.rb | 2 ++ config/initializers/100-strong_parameters.rb | 2 ++ config/initializers/100-verify_config.rb | 2 ++ config/initializers/100-watch_for_restart.rb | 2 ++ config/initializers/100-wrap_parameters.rb | 2 ++ config/initializers/101-lograge.rb | 2 ++ .../200-message_bus_request_tracker.rb | 2 ++ config/locales/plurals.rb | 2 ++ config/puma.rb | 2 ++ config/routes.rb | 2 ++ config/spring.rb | 2 ++ config/unicorn.conf.rb | 2 ++ db/api_test_seeds.rb | 2 ++ db/fixtures/001_refresh.rb | 2 ++ db/fixtures/002_groups.rb | 2 ++ db/fixtures/003_post_action_types.rb | 2 ++ db/fixtures/004_screened_ip_addresses.rb | 2 ++ db/fixtures/005_badge_types.rb | 2 ++ db/fixtures/006_badges.rb | 2 ++ db/fixtures/007_web_hook_event_types.rb | 2 ++ db/fixtures/009_users.rb | 2 ++ db/fixtures/010_uploads.rb | 2 ++ db/fixtures/500_categories.rb | 2 ++ db/fixtures/600_themes.rb | 2 ++ db/fixtures/990_settings.rb | 2 ++ db/fixtures/990_topics.rb | 2 ++ .../20000225050318_add_schema_migration_details.rb | 2 ++ db/migrate/20120311163914_create_forum_threads.rb | 2 ++ db/migrate/20120311164326_create_posts.rb | 2 ++ db/migrate/20120311170118_create_users.rb | 2 ++ db/migrate/20120311201341_create_forums.rb | 2 ++ db/migrate/20120311210245_create_sites.rb | 2 ++ db/migrate/20120416201606_add_reply_to_to_posts.rb | 2 ++ .../20120420183447_add_views_to_forum_threads.rb | 2 ++ ...20423140906_add_posts_count_to_forum_threads.rb | 2 ++ db/migrate/20120423142820_fix_post_indices.rb | 2 ++ db/migrate/20120423151548_remove_last_post_id.rb | 2 ++ ...20120425145456_add_display_username_to_users.rb | 2 ++ .../20120427150624_add_user_id_index_to_posts.rb | 2 ++ db/migrate/20120427151452_cooked_migration.rb | 2 ++ .../20120427154330_create_vestal_versions.rb | 2 ++ db/migrate/20120427172031_add_version_to_posts.rb | 2 ++ ...120502183240_add_created_by_to_forum_threads.rb | 2 ++ ...92121_add_last_post_user_id_to_forum_threads.rb | 2 ++ db/migrate/20120503205521_add_site_id_to_users.rb | 2 ++ db/migrate/20120507144132_create_expressions.rb | 2 ++ .../20120507144222_create_expression_types.rb | 2 ++ .../20120514144549_add_reply_count_to_posts.rb | 2 ++ .../20120514173920_add_flag_to_expression_types.rb | 2 ++ ...14204934_add_description_to_expression_types.rb | 2 ++ db/migrate/20120517200130_add_quoteless_to_post.rb | 2 ++ db/migrate/20120518200115_create_read_posts.rb | 2 ++ .../20120519182212_create_last_read_posts.rb | 2 ++ db/migrate/20120523180723_create_views.rb | 2 ++ .../20120523184307_add_replies_to_forum_threads.rb | 2 ++ ...20120523201329_add_featured_to_forum_threads.rb | 2 ++ ...20120525194845_add_avg_time_to_forum_threads.rb | 2 ++ db/migrate/20120529175956_create_uploads.rb | 2 ++ db/migrate/20120529202707_create_stars.rb | 2 ++ .../20120530150726_create_forum_thread_user.rb | 2 ++ db/migrate/20120530160745_migrate_posted.rb | 2 ++ .../20120530200724_add_index_to_forum_threads.rb | 2 ++ .../20120530212912_create_forum_thread_links.rb | 2 ++ .../20120614190726_add_tags_to_forum_threads.rb | 2 ++ .../20120614202024_add_quote_count_to_posts.rb | 2 ++ db/migrate/20120615180517_create_bookmarks.rb | 2 ++ .../20120618152946_add_reply_below_to_posts.rb | 2 ++ db/migrate/20120618212349_create_post_timings.rb | 2 ++ db/migrate/20120618214856_create_message_bus.rb | 2 ++ db/migrate/20120619150807_fix_post_timings.rb | 2 ++ db/migrate/20120619153349_drop_read_posts.rb | 2 ++ .../20120619172714_add_post_number_to_bookmarks.rb | 2 ++ ...51_add_seen_post_count_to_forum_thread_users.rb | 2 ++ ...120621190310_add_deleted_at_to_forum_threads.rb | 2 ++ db/migrate/20120622200242_create_notifications.rb | 2 ++ ...0625145714_add_seen_notification_id_to_users.rb | 2 ++ .../20120625162318_add_deleted_at_to_posts.rb | 2 ++ ...544_add_highest_post_number_to_forum_threads.rb | 2 ++ ...0120625195326_add_image_url_to_forum_threads.rb | 2 ++ .../20120629143908_rename_expression_type_id.rb | 2 ++ .../20120629150253_denormalize_expressions.rb | 2 ++ ...20120629151243_make_expressions_less_generic.rb | 2 ++ db/migrate/20120629182637_create_incoming_links.rb | 2 ++ db/migrate/20120702211427_create_replies.rb | 2 ++ ...3184734_add_reflection_to_forum_thread_links.rb | 2 ++ ...20703201312_add_incoming_link_count_to_posts.rb | 2 ++ ...623_add_incoming_link_count_to_forum_threads.rb | 2 ++ .../20120703210004_add_bookmark_count_to_posts.rb | 2 ++ db/migrate/20120704160659_add_avg_time_to_posts.rb | 2 ++ .../20120704201743_add_view_count_to_posts.rb | 2 ++ db/migrate/20120705181724_add_user_to_versions.rb | 2 ++ .../20120708210305_add_last_posted_at_to_users.rb | 2 ++ db/migrate/20120712150500_create_categories.rb | 2 ++ ...20712151934_add_category_id_to_forum_threads.rb | 2 ++ ...20713201324_create_category_featured_threads.rb | 2 ++ db/migrate/20120716020835_create_site_settings.rb | 2 ++ .../20120716173544_add_stats_to_categories.rb | 2 ++ db/migrate/20120718044955_create_user_open_ids.rb | 2 ++ ...add_email_hashed_password_name_salt_to_users.rb | 2 ++ .../20120720013733_add_username_lower_to_users.rb | 2 ++ .../20120720044246_add_auth_token_to_users.rb | 2 ++ .../20120720162422_add_forum_id_to_categories.rb | 2 ++ ...0120723051512_add_not_nulls_to_user_open_ids.rb | 2 ++ .../20120724234502_add_last_seen_at_to_users.rb | 2 ++ db/migrate/20120724234711_add_website_to_users.rb | 2 ++ .../20120725183347_add_excerpt_to_categories.rb | 2 ++ ...20120726201830_add_invisible_to_forum_thread.rb | 2 ++ .../20120726235129_add_user_id_to_categories.rb | 2 ++ ...0120727005556_remove_excerpt_from_categories.rb | 2 ++ db/migrate/20120727150428_rename_invisible.rb | 2 ++ ...120727213543_add_thread_counts_to_categories.rb | 2 ++ .../20120802151210_add_icon_to_expression_types.rb | 2 ++ .../20120803191426_add_admin_flag_to_users.rb | 2 ++ ...d_new_password_new_salt_email_token_to_users.rb | 2 ++ ...06062617_remove_new_password_stuff_from_user.rb | 2 ++ db/migrate/20120807223020_create_actions.rb | 2 ++ db/migrate/20120809020415_remove_site_id.rb | 2 ++ db/migrate/20120809030647_remove_forum_id.rb | 2 ++ .../20120809053414_correct_indexing_on_posts.rb | 2 ++ db/migrate/20120809154750_remove_index_for_now.rb | 2 ++ db/migrate/20120809174649_create_post_actions.rb | 2 ++ .../20120809175110_create_post_action_types.rb | 2 ++ ...0809201855_migrate_bookmarks_to_post_actions.rb | 2 ++ ...0120810064839_rename_actions_to_user_actions.rb | 2 ++ db/migrate/20120812235417_retire_expressions.rb | 2 ++ ...47_rename_expression_columns_in_forum_thread.rb | 2 ++ ...813042912_rename_expression_columns_in_posts.rb | 2 ++ ...120813201426_create_forum_thread_link_clicks.rb | 2 ++ ...04411_add_unique_index_to_forum_thread_links.rb | 2 ++ .../20120815180106_add_post_type_to_posts.rb | 2 ++ ...3_add_moderator_posts_count_to_forum_threads.rb | 2 ++ ...050526_add_unique_constraint_to_user_actions.rb | 2 ++ .../20120816205537_add_forum_thread_states.rb | 2 ++ ...16205538_add_starred_at_to_forum_thread_user.rb | 2 ++ db/migrate/20120820191804_add_search_indices.rb | 2 ++ ...0120821191616_add_bumped_at_to_forum_threads.rb | 2 ++ .../20120823205956_add_slug_to_categories.rb | 2 ++ ...0120824171908_create_category_featured_users.rb | 2 ++ db/migrate/20120828204209_create_onebox_renders.rb | 2 ++ .../20120828204624_create_post_onebox_renders.rb | 2 ++ ...20120830182736_add_preview_to_onebox_renders.rb | 2 ++ ...171504_remove_description_from_site_settings.rb | 2 ++ db/migrate/20120918152319_rename_views_to_reads.rb | 2 ++ .../20120918205931_add_sub_tag_to_forum_threads.rb | 2 ++ ...20919152846_add_has_best_of_to_forum_threads.rb | 2 ++ db/migrate/20120921055428_add_twitter_user_info.rb | 2 ++ db/migrate/20120921155050_create_archetypes.rb | 2 ++ ...0120921162512_add_meta_data_to_forum_threads.rb | 2 ++ .../20120921163606_create_archetype_options.rb | 2 ++ db/migrate/20120924182000_add_hstore_extension.rb | 2 ++ .../20120924182031_add_vote_count_to_posts.rb | 2 ++ ...171620_remove_english_from_post_action_types.rb | 2 ++ ...0925190802_add_sequence_to_post_action_types.rb | 2 ++ .../20120928170023_add_sort_order_to_posts.rb | 2 ++ .../20121009161116_add_email_stuff_to_users.rb | 2 ++ db/migrate/20121011155904_create_email_logs.rb | 2 ++ db/migrate/20121017162924_convert_archetypes.rb | 2 ++ .../20121018103721_rename_forum_thread_tables.rb | 2 ++ .../20121018133039_create_topic_allowed_users.rb | 2 ++ db/migrate/20121018182709_fix_notification_data.rb | 2 ++ .../20121106015500_drop_avatar_url_from_users.rb | 2 ++ ...08193516_add_post_action_id_to_notifications.rb | 2 ++ db/migrate/20121109164630_create_trust_levels.rb | 2 ++ db/migrate/20121113200844_bio_markdown_support.rb | 2 ++ .../20121113200845_create_facebook_user_infos.rb | 2 ++ .../20121115172544_rename_sticky_to_pinned.rb | 2 ++ ...121116212424_add_more_email_settings_to_user.rb | 2 ++ .../20121119190529_add_email_settings_to_users.rb | 2 ++ .../20121119200843_add_email_direct_to_users.rb | 2 ++ db/migrate/20121121202035_create_invites.rb | 2 ++ db/migrate/20121121205215_create_topic_invites.rb | 2 ++ .../20121122033316_add_muted_at_to_topic_user.rb | 2 ++ .../20121123054127_make_post_number_distinct.rb | 2 ++ db/migrate/20121123063630_create_user_visits.rb | 2 ++ db/migrate/20121129160035_create_email_tokens.rb | 2 ++ ...20121129184948_remove_email_token_from_users.rb | 2 ++ db/migrate/20121130010400_create_drafts.rb | 2 ++ ...121130191818_add_link_post_id_to_topic_links.rb | 2 ++ .../20121202225421_add_visited_at_to_topic_user.rb | 2 ++ .../20121203181719_rename_seen_notificaiton_id.rb | 2 ++ db/migrate/20121204183855_fix_link_post_id.rb | 2 ++ ...04193747_add_another_featured_user_to_topics.rb | 2 ++ db/migrate/20121205162143_add_approved_to_users.rb | 2 ++ ...21207000741_add_notifications_to_topic_users.rb | 2 ++ .../20121211233131_create_site_customizations.rb | 2 ++ ...override_default_style_to_site_customization.rb | 2 ++ .../20121218205642_add_topics_entered_to_users.rb | 2 ++ .../20121224072204_add_last_editor_id_to_posts.rb | 2 ++ db/migrate/20121224095139_create_draft_sequence.rb | 2 ++ .../20121224100650_add_sequence_to_drafts.rb | 2 ++ .../20121228192219_add_deleted_at_to_invites.rb | 2 ++ ...0130107165207_add_digest_after_days_to_users.rb | 2 ++ ...0130108195847_add_previous_visit_at_to_users.rb | 2 ++ ...0115012140_merge_mute_options_on_topic_users.rb | 2 ++ ...021937_correct_default_on_notification_level.rb | 2 ++ ...5043603_oops_unwatch_a_boat_of_watched_stuff.rb | 2 ++ .../20130116151829_remove_sub_tag_from_topics.rb | 2 ++ db/migrate/20130120222728_fix_search.rb | 2 ++ .../20130121231352_add_tracking_to_topic_users.rb | 2 ++ ...20130122051134_add_auto_track_topics_to_user.rb | 2 ++ ...ck_after_seconds_and_banning_and_dob_to_user.rb | 2 ++ ...30123070909_auto_track_all_topics_replied_to.rb | 2 ++ db/migrate/20130125002652_add_hidden_to_posts.rb | 2 ++ .../20130125030305_add_fields_to_post_action.rb | 2 ++ .../20130125031122_correct_index_on_post_action.rb | 2 ++ db/migrate/20130127213646_remove_trust_levels.rb | 2 ++ .../20130128182013_trust_level_default_null.rb | 2 ++ db/migrate/20130129010625_remove_pm_reflections.rb | 2 ++ .../20130129163244_add_time_read_to_users.rb | 2 ++ .../20130129174845_add_days_visited_to_users.rb | 2 ++ .../20130130154611_remove_index_from_views.rb | 2 ++ ...130131055710_add_custom_flag_count_to_topics.rb | 2 ++ ...828_add_column_summaries_to_posts_and_topics.rb | 2 ++ ...30201023409_add_position_to_post_action_type.rb | 2 ++ .../20130203204338_add_last_version_at_to_posts.rb | 2 ++ .../20130204000159_add_ip_address_to_users.rb | 2 ++ .../20130205021905_alter_facebook_user_id.rb | 2 ++ .../20130207200019_add_user_deleted_to_posts.rb | 2 ++ ...35_remove_reply_below_post_number_from_posts.rb | 2 ++ ...20130213021450_remove_topic_response_actions.rb | 2 ++ ...3300_add_new_topic_duration_minutes_to_users.rb | 2 ++ ...20130221215017_add_description_to_categories.rb | 2 ++ db/migrate/20130226015336_add_github_user_info.rb | 2 ++ ...0306180148_add_cleared_pinned_to_topic_users.rb | 2 ++ .../20130311181327_remove_extra_spam_record.rb | 2 ++ ..._links_in_new_tab_an_disable_quoting_to_user.rb | 2 ++ ...314093434_add_foreground_color_to_categories.rb | 2 ++ .../20130315180637_enable_trigram_support.rb | 2 ++ .../20130319122248_add_reply_to_user_id_to_post.rb | 2 ++ ...0012100_add_user_indexes_to_posts_and_topics.rb | 2 ++ db/migrate/20130320024345_add_moderator_to_user.rb | 2 ++ .../20130321154905_remove_oneboxes_from_db.rb | 2 ++ .../20130322183614_add_percent_rank_to_posts.rb | 2 ++ .../20130326210101_add_hotness_to_category.rb | 2 ++ .../20130327185852_update_site_settings_for_hot.rb | 2 ++ db/migrate/20130328162943_create_hot_topics.rb | 2 ++ db/migrate/20130328182433_add_score_to_topics.rb | 2 ++ .../20130402210723_add_values_to_hot_topics.rb | 2 ++ db/migrate/20130404143437_create_site_contents.rb | 2 ++ db/migrate/20130404232558_add_user_extras.rb | 2 ++ db/migrate/20130411205132_create_admin_logs.rb | 2 ++ .../20130412015502_correct_counts_on_posts.rb | 2 ++ .../20130412020156_correct_counts_on_topics.rb | 2 ++ db/migrate/20130416004607_create_groups.rb | 2 ++ db/migrate/20130416004933_group_users.rb | 2 ++ db/migrate/20130416170855_add_subtype_to_topics.rb | 2 ++ ...195746_increase_data_length_on_notifications.rb | 2 ++ ...22050626_add_related_post_id_to_post_actions.rb | 2 ++ db/migrate/20130424015746_add_slug_to_topics.rb | 2 ++ ...20130424055025_add_user_id_to_incoming_links.rb | 2 ++ ...20130426044914_allow_nulls_in_incoming_links.rb | 2 ++ ...ncoming_ip_current_user_id_to_incoming_links.rb | 2 ++ ...130428194335_add_unstarred_at_to_topic_users.rb | 2 ++ .../20130429000101_add_security_to_categories.rb | 2 ++ .../20130430052751_add_topic_allowed_groups.rb | 2 ++ .../20130501105651_fix_topic_allowed_groups.rb | 2 ++ .../20130506020935_add_automatic_to_groups.rb | 2 ++ .../20130506185042_add_auto_close_at_to_topics.rb | 2 ++ .../20130508040235_add_user_count_to_groups.rb | 2 ++ .../20130509040248_update_sequence_for_groups.rb | 2 ++ .../20130509041351_add_unique_name_to_groups.rb | 2 ++ ...0515193551_add_auto_close_days_to_categories.rb | 2 ++ db/migrate/20130521210140_create_cas_user_infos.rb | 2 ++ db/migrate/20130522193615_rename_search_tables.rb | 2 ++ .../20130527152648_add_like_score_to_posts.rb | 2 ++ ...8174147_add_rank_to_category_featured_topics.rb | 2 ++ ...210816_add_staff_took_action_to_post_actions.rb | 2 ++ db/migrate/20130603192412_add_blocked_to_users.rb | 2 ++ ...06190601_add_auto_close_started_at_to_topics.rb | 2 ++ .../20130610201033_add_reply_key_to_email_logs.rb | 2 ++ ...20130612200846_create_post_upload_join_table.rb | 2 ++ db/migrate/20130613211700_drop_posts_uploads.rb | 2 ++ db/migrate/20130613212230_create_post_uploads.rb | 2 ++ ...64344_add_dynamic_favicon_preference_to_user.rb | 2 ++ .../20130615073305_remove_topic_id_from_uploads.rb | 2 ++ db/migrate/20130615075557_add_sha_to_uploads.rb | 2 ++ .../20130616082327_create_optimized_images.rb | 2 ++ .../20130617014127_rename_sha_and_ext_columns.rb | 2 ++ db/migrate/20130617180009_rename_sha_column.rb | 2 ++ .../20130617181804_add_post_id_to_email_logs.rb | 2 ++ .../20130619063902_add_defer_to_post_actions.rb | 2 ++ .../20130621042855_change_supress_to_suppress.rb | 2 ++ .../20130622110348_add_url_index_to_uploads.rb | 2 ++ ...03206_change_ip_to_inet_in_topic_link_clicks.rb | 2 ++ .../20130625022454_change_ip_to_inet_in_views.rb | 2 ++ .../20130625170842_remove_access_password.rb | 2 ++ db/migrate/20130625201113_add_title_to_users.rb | 2 ++ .../20130709184941_add_deleted_by_id_to_posts.rb | 2 ++ .../20130710201248_add_nuked_user_to_posts.rb | 2 ++ ...41133_add_permission_type_to_category_groups.rb | 2 ++ .../20130712163509_add_missing_id_columns.rb | 2 ++ db/migrate/20130723212758_rename_admin_log.rb | 2 ++ db/migrate/20130724201552_create_blocked_emails.rb | 2 ++ .../20130725213613_add_more_to_staff_action_log.rb | 2 ++ .../20130728172550_add_url_to_optimized_images.rb | 2 ++ ...731163035_add_report_index_to_incoming_links.rb | 2 ++ ...02516_add_last_match_index_to_blocked_emails.rb | 2 ++ .../20130809160751_fix_seen_notification_ids.rb | 2 ++ ...4732_add_filter_indexes_to_staff_action_logs.rb | 2 ++ db/migrate/20130809211409_add_avatar_to_users.rb | 2 ++ db/migrate/20130813204212_create_screened_urls.rb | 2 ++ ...817_rename_blocked_emails_to_screened_emails.rb | 2 ++ .../20130816024250_create_oauth2_user_infos.rb | 2 ++ ...92358_add_value_columns_to_staff_action_logs.rb | 2 ++ ...74431_add_subject_index_to_staff_action_logs.rb | 2 ++ ...822213513_add_ip_address_to_screening_tables.rb | 2 ++ ...op_defaults_on_email_digest_columns_of_users.rb | 2 ++ .../20130826011521_create_plugin_store_rows.rb | 2 ++ .../20130828192526_fix_optimized_images_urls.rb | 2 ++ .../20130903154323_allow_null_user_id_on_posts.rb | 2 ++ .../20130904181208_allow_null_user_id_on_topics.rb | 2 ++ .../20130906081326_rename_system_username.rb | 2 ++ db/migrate/20130906171631_add_index_to_uploads.rb | 2 ++ .../20130910040235_index_topics_for_front_page.rb | 2 ++ ...317_rename_staff_action_logs_to_user_history.rb | 2 ++ db/migrate/20130911182437_create_user_stats.rb | 2 ++ db/migrate/20130912185218_acting_user_null.rb | 2 ++ ...0913210454_add_mobile_to_site_customizations.rb | 2 ++ ...0130917174738_add_topic_id_to_user_histories.rb | 2 ++ .../20131001060630_add_email_always_to_users.rb | 2 ++ ...70347_add_user_id_parent_type_index_on_views.rb | 2 ++ .../20131003061137_move_columns_to_user_stats.rb | 2 ++ ...014203951_backfill_post_upload_reverse_index.rb | 2 ++ db/migrate/20131015131652_create_post_details.rb | 2 ++ .../20131017014509_add_post_count_to_categories.rb | 2 ++ .../20131017030605_add_latest_to_categories.rb | 2 ++ .../20131017205954_create_screened_ip_addresses.rb | 2 ++ .../20131018050738_add_position_to_categories.rb | 2 ++ .../20131022045114_add_uncategorized_category.rb | 2 ++ db/migrate/20131022151218_create_api_keys.rb | 2 ++ ...3163509_add_parent_category_id_to_categories.rb | 2 ++ db/migrate/20131105101051_add_origin_to_uploads.rb | 2 ++ .../20131107154900_rename_banned_to_suspended.rb | 2 ++ ...131114185225_add_participant_count_to_topics.rb | 2 ++ .../20131115165105_add_edit_reason_to_posts.rb | 2 ++ .../20131118173159_rename_best_of_to_summary.rb | 2 ++ .../20131120055018_move_emoji_to_new_location.rb | 2 ++ ...131122064921_increase_twitter_user_id_length.rb | 2 ++ ...131206200009_rename_auto_close_days_to_hours.rb | 2 ++ db/migrate/20131209091702_create_post_revisions.rb | 2 ++ .../20131209091742_create_topic_revisions.rb | 2 ++ .../20131210163702_add_word_count_to_posts.rb | 2 ++ db/migrate/20131210181901_migrate_word_counts.rb | 2 ++ db/migrate/20131210234530_rename_version_column.rb | 2 ++ ...1_add_post_count_stats_columns_to_categories.rb | 2 ++ ...6164557_make_position_nullable_in_categories.rb | 2 ++ db/migrate/20131217174004_create_topic_embeds.rb | 2 ++ .../20131219203905_add_cook_method_to_posts.rb | 2 ++ db/migrate/20131223171005_create_top_topics.rb | 2 ++ .../20131227164338_add_scores_to_top_topics.rb | 2 ++ ...20131229221725_add_watch_new_topics_to_users.rb | 2 ++ ...9_add_last_emailed_post_number_to_topic_user.rb | 2 ++ db/migrate/20140101235747_add_category_users.rb | 2 ++ .../20140102104229_add_alias_level_to_groups.rb | 2 ++ ...emove_default_from_external_links_in_new_tab.rb | 2 ++ ...40107220141_remove_enable_wide_category_list.rb | 2 ++ .../20140109205940_rename_favorites_to_starred.rb | 2 ++ db/migrate/20140116170655_drop_hot_topics.rb | 2 ++ db/migrate/20140120155706_add_lounge_category.rb | 2 ++ ...20140121204628_add_invalidated_at_to_invites.rb | 2 ++ db/migrate/20140122043508_add_meta_category.rb | 2 ++ ...20140124202427_add_posts_read_to_user_visits.rb | 2 ++ .../20140129164541_remove_category_hotness.rb | 2 ++ db/migrate/20140206044818_add_locale_to_user.rb | 2 ++ ...defaults_to_category_posts_and_topics_fields.rb | 2 ++ ...0140206215029_add_mailing_list_mode_to_users.rb | 2 ++ ...20140210194146_add_primary_group_id_to_users.rb | 2 ++ db/migrate/20140211230222_move_cas_settings.rb | 2 ++ ...0211234523_add_targets_topic_to_post_actions.rb | 2 ++ .../20140214151255_add_skipped_to_email_logs.rb | 2 ++ db/migrate/20140220160510_rename_site_settings.rb | 2 ++ .../20140220163213_rename_delete_user_max_age.rb | 2 ++ ...0140224232712_add_profile_background_to_user.rb | 2 ++ .../20140224232913_add_single_sign_on_records.rb | 2 ++ ...0227104930_add_custom_email_in_to_categories.rb | 2 ++ db/migrate/20140227201005_add_staff_category.rb | 2 ++ ...d_external_username_to_single_sign_on_record.rb | 2 ++ ...l_and_external_name_to_single_sign_on_record.rb | 2 ++ ...40228205743_add_admin_only_to_user_histories.rb | 2 ++ .../20140303185354_add_new_since_to_user_stats.rb | 2 ++ db/migrate/20140304200606_create_badge_types.rb | 2 ++ db/migrate/20140304201403_create_badges.rb | 2 ++ db/migrate/20140305100909_create_user_badges.rb | 2 ++ ...23522_move_topic_revisions_to_post_revisions.rb | 2 ++ db/migrate/20140318150412_add_excerpt_to_topics.rb | 2 ++ ...20140318203559_add_created_at_index_to_posts.rb | 2 ++ ...2653_facebook_user_infos_username_can_be_nil.rb | 2 ++ .../20140402201432_make_content_sha1_nullable.rb | 2 ++ .../20140404143501_add_title_to_topic_links.rb | 2 ++ ...20140407055830_add_pinned_globally_to_topics.rb | 2 ++ .../20140407202158_site_setting_comma_to_pipe.rb | 2 ++ db/migrate/20140408061512_add_wiki_to_posts.rb | 2 ++ ...152401_add_default_value_to_top_topic_scores.rb | 2 ++ .../20140415054717_allow_longer_usernames.rb | 2 ++ db/migrate/20140416202746_create_color_schemes.rb | 2 ++ .../20140416202801_create_color_scheme_colors.rb | 2 ++ ...235757_remove_color_hexcode_from_badge_types.rb | 2 ++ .../20140421235646_add_user_custom_fields.rb | 2 ++ .../20140422195623_add_visibile_to_groups.rb | 2 ++ db/migrate/20140425125742_add_custom_fields.rb | 2 ++ .../20140425135354_add_topic_custom_fields.rb | 2 ++ .../20140425172618_add_titleable_to_badges.rb | 2 ++ ...9175951_add_registration_ip_address_to_users.rb | 2 ++ ...212_increment_reserved_trust_level_badge_ids.rb | 2 ++ ...45918_add_last_redirected_to_top_at_to_users.rb | 2 ++ .../20140506200235_remove_seed_color_scheme.rb | 2 ++ ...3327_remove_opacity_from_color_scheme_colors.rb | 2 ++ db/migrate/20140508053815_add_invited_groups.rb | 2 ++ ...15220111_init_fixed_category_positions_value.rb | 2 ++ .../20140520062826_add_multiple_award_to_badges.rb | 2 ++ ...859_remove_has_custom_avatar_from_user_stats.rb | 2 ++ .../20140521192142_create_google_user_infos.rb | 2 ++ ...0521220115_google_openid_default_has_changed.rb | 2 ++ db/migrate/20140522003151_add_user_avatars.rb | 2 ++ ...3_remove_uploaded_avatar_template_from_users.rb | 2 ++ ...185749_change_category_uniquness_contstraint.rb | 2 ++ ...140526201939_add_disable_jump_reply_to_users.rb | 2 ++ db/migrate/20140527163207_create_user_profiles.rb | 2 ++ ...5_add_system_savatar_version_to_user_avatars.rb | 2 ++ db/migrate/20140528015354_add_baked_at_to_posts.rb | 2 ++ ...9045508_remove_use_uploaded_avatar_from_user.rb | 2 ++ ...2535_remove_system_avatars_from_user_avatars.rb | 2 ++ .../20140530043913_add_baked_version_to_post.rb | 2 ++ ...0604145431_disable_external_auths_by_default.rb | 2 ++ .../20140607035234_add_website_to_user_profiles.rb | 2 ++ .../20140610012414_add_post_id_to_user_badges.rb | 2 ++ db/migrate/20140610012833_add_icon_to_badges.rb | 2 ++ .../20140610034314_move_bio_to_user_profiles.rb | 2 ++ ...718_move_profile_background_to_user_profiles.rb | 2 ++ ...0617053829_add_notification_id_to_user_badge.rb | 2 ++ .../20140617080955_rename_registered_users.rb | 2 ++ ...40617193351_add_post_id_index_on_topic_links.rb | 2 ++ db/migrate/20140618001820_dont_auto_muto_topics.rb | 2 ++ ...511_add_dismissed_banner_key_to_user_profile.rb | 2 ++ .../20140620184031_add_hidden_at_to_posts.rb | 2 ++ .../20140623195618_fix_categories_constraint.rb | 2 ++ .../20140624044600_add_raw_data_to_search.rb | 2 ++ .../20140627193814_add_images_to_categories.rb | 2 ++ db/migrate/20140703022838_add_fields_to_badges.rb | 2 ++ db/migrate/20140705081453_index_user_badges.rb | 2 ++ .../20140707071913_add_self_edits_to_posts.rb | 2 ++ ...140710005023_add_badge_posts_and_topics_view.rb | 2 ++ .../20140710224658_add_is_quote_to_topic_links.rb | 2 ++ .../20140711063215_add_read_faq_to_user_stats.rb | 2 ++ .../20140711143146_remove_not_null_from_email.rb | 2 ++ ...140711193923_remove_email_in_address_setting.rb | 2 ++ ...40711233329_badges_only_on_public_categories.rb | 2 ++ db/migrate/20140714060646_add_enabled_to_badges.rb | 2 ++ .../20140715013018_correct_post_number_index.rb | 2 ++ .../20140715051412_add_auto_revoke_to_badges.rb | 2 ++ db/migrate/20140715055242_add_quoted_posts.rb | 2 ++ ...5160720_update_users_case_insensitive_emails.rb | 2 ++ .../20140715190552_remove_uncategorized_parents.rb | 2 ++ db/migrate/20140716063802_add_badge_groupings.rb | 2 ++ ...24528_description_optional_in_badge_grouping.rb | 2 ++ .../20140718041445_set_default_badge_grouping.rb | 2 ++ db/migrate/20140721063820_add_trigger_to_badges.rb | 2 ++ ...dd_agreed_at_and_agreed_by_id_to_post_action.rb | 2 ++ ...21162307_rename_defer_columns_on_post_action.rb | 2 ++ .../20140723011456_add_show_posts_to_badges.rb | 2 ++ ...20140725050636_remove_invalid_incoming_links.rb | 2 ++ ...140725172830_remove_message_from_post_action.rb | 2 ++ ...40727030954_add_edit_history_public_to_users.rb | 2 ++ .../20140728120708_fix_index_on_post_action.rb | 2 ++ ...44308_add_first_post_created_at_to_user_stat.rb | 2 ++ ...52804_add_post_and_topic_counts_to_user_stat.rb | 2 ++ ..._remove_unique_constraint_from_invites_index.rb | 2 ++ ...agreed_at_and_disagreed_by_id_to_post_action.rb | 2 ++ .../20140731011328_add_reply_quoted_to_posts.rb | 2 ++ db/migrate/20140801052028_fix_incoming_links.rb | 2 ++ ...0140801170444_create_post_timings_user_index.rb | 2 ++ .../20140804010803_incoming_link_normalization.rb | 2 ++ ...40804030041_remove_url_from_incoming_referer.rb | 2 ++ ...0804060439_drop_topic_id_from_incoming_links.rb | 2 ++ db/migrate/20140804072504_views_to_topic_views.rb | 2 ++ ...04075613_normalize_topic_view_data_and_index.rb | 2 ++ ...61612_add_bio_cooked_version_to_user_profile.rb | 2 ++ db/migrate/20140806003116_fixup_badge_ids.rb | 2 ++ ...140807033123_add_index_on_last_seen_to_users.rb | 2 ++ .../20140808051823_create_topic_search_index.rb | 2 ++ .../20140809224243_add_user_badge_unique_index.rb | 2 ++ ...094300_rename_defered_columns_on_post_action.rb | 2 ++ db/migrate/20140813175357_add_default_to_active.rb | 2 ++ .../20140815183851_fix_index_on_post_actions.rb | 2 ++ .../20140815191556_fix_post_actions_index_again.rb | 2 ++ .../20140815215618_add_name_lower_to_categories.rb | 2 ++ ...external_avatar_url_to_single_sign_on_record.rb | 2 ++ db/migrate/20140818023700_index_email_tokens.rb | 2 ++ ...20140826234625_rename_settings_pop3s_to_pop3.rb | 2 ++ db/migrate/20140827044811_remove_nullable_dates.rb | 2 ++ db/migrate/20140828172407_create_permalinks.rb | 2 ++ ...0828200231_make_url_col_bigger_in_permalinks.rb | 2 ++ ...roups_orphaned_by_removing_category_or_group.rb | 2 ++ .../20140904055702_correct_post_action_index.rb | 2 ++ .../20140904160015_add_via_email_to_posts.rb | 2 ++ .../20140904215629_rename_trust_level_settings.rb | 2 ++ .../20140905055251_rename_trust_level_badges.rb | 2 ++ db/migrate/20140905171733_create_warnings.rb | 2 ++ ...0140908165716_migrate_warning_topic_subtypes.rb | 2 ++ db/migrate/20140908191429_trim_profile_length.rb | 2 ++ .../20140910130155_create_topic_user_index.rb | 2 ++ ...1065449_private_messages_have_no_category_id.rb | 2 ++ ...20140913192733_add_trust_level_locked_column.rb | 2 ++ .../20140923042349_add_retain_hours_to_uploads.rb | 2 ++ db/migrate/20140924192418_rename_content_type.rb | 2 ++ db/migrate/20140925173220_create_user_fields.rb | 2 ++ .../20140929181930_add_editable_to_user_fields.rb | 2 ++ db/migrate/20140929204155_migrate_tos_setting.rb | 2 ++ ...20141001101041_add_post_id_to_user_histories.rb | 2 ++ ...0141002181613_add_description_to_user_fields.rb | 2 ++ ...4814_add_badge_granted_title_to_user_profile.rb | 2 ++ ...20141008152953_add_exernal_url_to_permalinks.rb | 2 ++ ...008181228_add_required_signup_to_user_fields.rb | 2 ++ ..._on_last_post_and_auto_close_hours_to_topics.rb | 2 ++ ..._auto_close_based_on_last_post_to_categories.rb | 2 ++ .../20141014032859_add_hidden_to_post_revision.rb | 2 ++ db/migrate/20141014191645_fix_tos_name.rb | 2 ++ .../20141015060145_add_raw_email_to_posts.rb | 2 ++ ...07_add_expansion_background_to_user_profiles.rb | 2 ++ .../20141020153415_add_public_version_to_posts.rb | 2 ++ .../20141020154935_rename_expansion_to_card.rb | 2 ++ db/migrate/20141020164816_add_image_to_badges.rb | 2 ++ ...141020174120_add_card_image_to_user_profiles.rb | 2 ++ .../20141030222425_rename_seen_post_count.rb | 2 ++ ...41110150304_add_footer_to_site_customization.rb | 2 ++ .../20141118011735_correct_username_search.rb | 2 ++ .../20141120035016_add_allowed_ips_to_api_keys.rb | 2 ++ .../20141120043401_add_hidden_to_api_keys.rb | 2 ++ db/migrate/20141211114517_fix_emoji_path.rb | 2 ++ ...20141216112341_resolve_duplicate_group_names.rb | 2 ++ ...ride_default_styles_from_site_customizations.rb | 2 ++ db/migrate/20141222224220_fix_emoji_path_take2.rb | 2 ++ .../20141222230707_amend_site_customization.rb | 2 ++ .../20141223145058_create_csv_export_logs.rb | 2 ++ ...51019_rename_csv_export_logs_to_user_exports.rb | 2 ++ db/migrate/20150102113309_clean_up_user_history.rb | 2 ++ db/migrate/20150106215342_remove_stars.rb | 2 ++ ...02354_add_liked_and_bookmarked_to_topic_user.rb | 2 ++ .../20150108202057_create_bookmark_actions.rb | 2 ++ ...150108211557_index_topic_custom_field_values.rb | 2 ++ db/migrate/20150108221703_group_managers.rb | 2 ++ ...50112172258_add_new_site_customization_types.rb | 2 ++ ...2259_migrate_site_text_to_site_customization.rb | 2 ++ ...20150114093325_add_top_to_site_customization.rb | 2 ++ .../20150115172310_rename_user_export_column.rb | 2 ++ ...0119192813_add_posts_index_including_deleted.rb | 2 ++ ...0123145128_add_automatic_membership_to_group.rb | 2 ++ ...129204520_add_show_on_profile_to_user_fields.rb | 2 ++ .../20150203041207_add_application_requests.rb | 2 ++ .../20150205032808_reset_application_requests.rb | 2 ++ ...0205172051_add_custom_type_to_user_histories.rb | 2 ++ .../20150206004143_flush_application_requests.rb | 2 ++ ...0150213174159_create_digest_unsubscribe_keys.rb | 2 ++ db/migrate/20150224004420_add_pinned_indexes.rb | 2 ++ ...0150227043622_add_long_description_to_badges.rb | 2 ++ .../20150301224250_create_suggested_for_index.rb | 2 ++ ...0437_add_all_time_and_op_likes_to_top_topics.rb | 2 ++ .../20150318143915_create_directory_items.rb | 2 ++ ...3_add_allow_private_messages_to_user_profile.rb | 2 ++ ...ove_allow_private_messages_from_user_profile.rb | 2 ++ db/migrate/20150323234856_add_muted_users.rb | 2 ++ .../20150324184222_add_more_to_directory_items.rb | 2 ++ db/migrate/20150325183400_fix_group_user_count.rb | 2 ++ db/migrate/20150325190959_create_queued_posts.rb | 2 ++ .../20150410002033_add_primary_group_to_groups.rb | 2 ++ db/migrate/20150410002551_add_title_to_groups.rb | 2 ++ ...421085850_increase_url_length_on_topic_embed.rb | 2 ++ ...421190714_add_queued_post_id_to_user_actions.rb | 2 ++ ...160235_add_link_post_id_index_on_topic_links.rb | 2 ++ db/migrate/20150505044154_add_stylesheet_cache.rb | 2 ++ .../20150513094042_add_index_on_post_actions.rb | 2 ++ ...0150514023016_add_unread_notifications_index.rb | 2 ++ .../20150514043155_add_user_actions_all_index.rb | 2 ++ db/migrate/20150525151759_set_default_s3_region.rb | 2 ++ .../20150609163211_migrate_embeddable_host.rb | 2 ++ ...150617080349_add_index_on_post_notifications.rb | 2 ++ ...018_add_index_target_post_id_on_user_actions.rb | 2 ++ .../20150617234511_add_staff_index_to_users.rb | 2 ++ ...50702201926_add_topic_template_to_categories.rb | 2 ++ .../20150706215111_add_mobile_to_user_visits.rb | 2 ++ ...50707163251_add_reports_index_to_user_visits.rb | 2 ++ .../20150709021818_add_like_count_to_post_menu.rb | 2 ++ .../20150713203955_enlarge_users_email_field.rb | 2 ++ ...150724165259_add_index_to_post_custom_fields.rb | 2 ++ .../20150724182342_add_action_code_to_post.rb | 2 ++ .../20150727193414_create_user_field_options.rb | 2 ++ .../20150727210019_add_pinned_until_to_topics.rb | 2 ++ .../20150727210748_add_quarterly_to_top_topics.rb | 2 ++ .../20150727230537_add_example_column_comments.rb | 2 ++ ...150728004647_correct_custom_fields_migration.rb | 2 ++ .../20150728210202_migrate_old_moderator_posts.rb | 2 ++ .../20150729150523_migrate_auto_close_posts.rb | 8 +++++--- .../20150730154830_add_position_to_user_fields.rb | 2 ++ .../20150731225331_migrate_old_moved_posts.rb | 2 ++ db/migrate/20150802233112_add_post_stats.rb | 2 ++ ...0727_add_embedded_css_to_site_customizations.rb | 2 ++ .../20150818190757_create_embeddable_hosts.rb | 2 ++ db/migrate/20150822141540_fix_migrated_hosts.rb | 2 ++ ...55137_add_suppress_from_homepage_to_category.rb | 2 ++ ...150901192313_add_grant_trust_level_to_groups.rb | 2 ++ .../20150914021445_create_user_profile_views.rb | 2 ++ .../20150914034541_add_views_to_user_profile.rb | 2 ++ ...0917071017_add_category_id_to_user_histories.rb | 2 ++ ...06_add_user_id_group_id_index_to_group_users.rb | 2 ++ .../20150924022040_add_fancy_title_to_topic.rb | 2 ++ .../20150925000915_exclude_whispers_from_badges.rb | 2 ++ ...151103233815_add_lower_title_index_on_topics.rb | 2 ++ db/migrate/20151105181635_add_staged_to_user.rb | 2 ++ ...41044_fix_incorrect_topic_creator_after_move.rb | 2 ++ .../20151107042241_add_owner_to_group_users.rb | 2 ++ db/migrate/20151109124147_drop_group_managers.rb | 2 ++ .../20151113205046_create_translation_overrides.rb | 2 ++ ...5756_add_automatically_unpin_topics_to_users.rb | 2 ++ .../20151124172631_add_is_support_to_categories.rb | 2 ++ db/migrate/20151124192339_rename_ninja_edit.rb | 2 ++ db/migrate/20151125194322_remove_site_text.rb | 2 ++ ...73356_rename_is_support_to_contains_messages.rb | 2 ++ ...d_baked_head_and_body_to_site_customizations.rb | 2 ++ ...ader_and_footer_baked_to_site_customizations.rb | 2 ++ db/migrate/20151201035631_add_group_mentions.rb | 2 ++ .../20151201161726_add_incoming_email_to_groups.rb | 2 ++ ...165852_add_notification_level_to_group_users.rb | 2 ++ ...218232200_add_unique_index_to_category_users.rb | 2 ++ .../20151219045559_add_has_messages_to_groups.rb | 2 ++ ...er_archived_messages_group_archived_messages.rb | 2 ++ .../20160108051129_fix_incorrect_user_history.rb | 2 ++ ...3003_archive_system_messages_with_no_replies.rb | 2 ++ ...025852_remove_users_from_topic_allowed_users.rb | 2 ++ ...12101818_remove_contains_message_on_category.rb | 2 ++ ...733_add_contains_messages_back_to_categories.rb | 2 ++ .../20160113160742_create_incoming_emails.rb | 2 ++ .../20160118174335_rebake_html_customizations.rb | 2 ++ .../20160118233631_backfill_incoming_emails.rb | 2 ++ ..._change_default_notification_level_on_groups.rb | 2 ++ ...02_migrate_uncategorized_description_setting.rb | 2 ++ db/migrate/20160201181320_fix_email_logs.rb | 2 ++ .../20160206210202_remove_invalid_websites.rb | 2 ++ ...5075528_add_unread_pm_index_to_notifications.rb | 2 ++ .../20160224033122_create_instagram_user_infos.rb | 2 ++ db/migrate/20160225050317_add_user_options.rb | 2 ++ ...20160225050318_allow_defaults_on_users_table.rb | 2 ++ ...050319_move_tracking_options_to_user_options.rb | 2 ++ ...0_add_email_previous_replies_to_user_options.rb | 2 ++ ...095306_add_email_in_reply_to_to_user_options.rb | 2 ++ ...0302063432_rebuild_directory_item_with_index.rb | 2 ++ ..._like_notification_frequency_to_user_options.rb | 2 ++ ...me_digest_after_days_to_digest_after_minutes.rb | 2 ++ .../20160303183607_clear_common_passwords_cache.rb | 2 ++ ...4317_add_rejection_message_to_incoming_email.rb | 2 ++ .../20160307190919_create_email_change_requests.rb | 2 ++ ...0160308193142_rename_confirm_translation_key.rb | 2 ++ ...160309073132_add_mailing_list_mode_frequency.rb | 2 ++ .../20160317174357_create_given_daily_likes.rb | 2 ++ ...5_add_include_tl0_in_digests_to_user_options.rb | 2 ++ db/migrate/20160326001747_add_user_first_visit.rb | 2 ++ db/migrate/20160329101122_remove_wiki_color.rb | 2 ++ db/migrate/20160405172827_create_user_firsts.rb | 2 ++ db/migrate/20160407160756_remove_user_firsts.rb | 2 ++ db/migrate/20160407180149_create_onceoff_logs.rb | 2 ++ ...8131959_add_show_on_user_card_to_user_fields.rb | 2 ++ ...727_add_compiled_js_to_translation_overrides.rb | 2 ++ .../20160418065403_add_bounce_key_to_email_log.rb | 2 ++ ...330_add_is_auto_generated_to_incoming_emails.rb | 2 ++ .../20160425141954_fix_incoming_emails_indices.rb | 2 ++ ...0160427202222_add_support_for_bounced_emails.rb | 2 ++ db/migrate/20160503205953_create_tags.rb | 2 ++ .../20160514100852_remove_invalid_topic_user.rb | 2 ++ ...0520022627_shorten_topic_custom_fields_index.rb | 2 ++ ...27015355_correct_mailing_list_mode_frequency.rb | 2 ++ db/migrate/20160527191614_create_category_tags.rb | 2 ++ .../20160530003739_create_scheduler_stats.rb | 2 ++ .../20160530203810_add_message_id_to_email_logs.rb | 2 ++ db/migrate/20160602164008_create_tag_groups.rb | 2 ++ .../20160606204319_create_category_tag_groups.rb | 2 ++ db/migrate/20160607213656_add_tag_group_options.rb | 2 ++ ...60609203508_remove_tag_count_from_tag_groups.rb | 2 ++ ...20160615024524_rename_digest_unsbscribe_keys.rb | 2 ++ ...615165447_rename_num_flags_to_block_new_user.rb | 2 ++ ...04436_use_https_name_change_in_site_settings.rb | 2 ++ ..._add_compiler_version_to_site_customizations.rb | 2 ++ .../20160716112354_remove_edit_history_public.rb | 2 ++ ...160719002225_add_deleted_post_index_to_posts.rb | 2 ++ ...722071221_add_auth_token_created_at_to_users.rb | 2 ++ .../20160725015749_rename_auth_token_created_at.rb | 2 ++ .../20160727233044_create_developers_table.rb | 2 ++ db/migrate/20160815002002_add_user_api_keys.rb | 2 ++ .../20160815210156_add_flair_url_to_groups.rb | 2 ++ .../20160816052836_user_api_client_id_is_unique.rb | 2 ++ ...160816063534_add_revoked_at_to_user_api_keys.rb | 2 ++ ...71911_add_path_whitelist_to_embeddable_hosts.rb | 2 ++ .../20160826195018_add_flair_color_to_groups.rb | 2 ++ .../20160905082217_create_web_hook_event_types.rb | 2 ++ db/migrate/20160905082248_create_web_hooks.rb | 2 ++ .../20160905084502_create_web_hook_events.rb | 2 ++ ...te_join_table_web_hooks_web_hook_event_types.rb | 2 ++ ...905091958_create_join_table_web_hooks_groups.rb | 2 ++ ...92148_create_join_table_web_hooks_categories.rb | 2 ++ ...160906200439_add_via_wizard_to_color_schemes.rb | 2 ++ ...160919003141_add_avatar_url_to_facebook_info.rb | 2 ++ ...60919054014_add_fields_to_facebook_user_info.rb | 2 ++ .../20160920165833_add_moderator_to_invites.rb | 2 ++ ...0123330_add_notification_level_when_replying.rb | 2 ++ ..._single_sign_on_increase_external_avatar_url.rb | 2 ++ .../20161013012136_add_scopes_to_user_api_keys.rb | 2 ++ .../20161014171034_add_directory_items_indexes.rb | 2 ++ ...083648_fix_category_logo_and_background_urls.rb | 2 ++ .../20161029181306_add_image_url_to_posts.rb | 2 ++ ...20161031183811_add_sort_fields_to_categories.rb | 2 ++ .../20161102024700_add_post_uploads_indexes.rb | 2 ++ ...024818_add_uploaded_avatar_id_index_to_users.rb | 2 ++ .../20161102024838_add_user_avatars_indexes.rb | 2 ++ .../20161102024900_add_user_profiles_indexes.rb | 2 ++ .../20161102024920_add_categories_indexes.rb | 2 ++ ...61124020918_add_scores_indexes_to_top_topics.rb | 2 ++ ...20161202011139_add_whisper_support_to_topics.rb | 2 ++ .../20161202034856_add_uploads_to_categories.rb | 2 ++ .../20161205001727_add_topic_columns_back.rb | 2 ++ db/migrate/20161205065743_add_bio_to_groups.rb | 2 ++ db/migrate/20161207030057_add_public_to_groups.rb | 2 ++ .../20161208064834_create_group_histories.rb | 2 ++ ...3649_add_allow_membership_requests_to_groups.rb | 2 ++ .../20161213073938_add_full_name_to_groups.rb | 2 ++ .../20161215201907_migrate_featured_link_fields.rb | 2 ++ ...1216101352_add_all_topics_wiki_to_categories.rb | 2 ++ db/migrate/20170124181409_add_user_auth_tokens.rb | 2 ++ db/migrate/20170201085745_create_custom_emojis.rb | 2 ++ .../20170213180857_add_user_auth_token_log.rb | 2 ++ ...0170215151505_add_seen_at_to_user_auth_token.rb | 2 ++ ...4204_add_show_subcategory_list_to_categories.rb | 2 ++ ...0222173036_make_user_auth_token_index_unique.rb | 2 ++ ...0227211458_add_featured_topics_to_categories.rb | 2 ++ ...0170301215150_add_default_view_to_categories.rb | 2 ++ ...20170303070706_add_index_to_topic_view_items.rb | 2 ++ ...170307181800_add_path_to_user_auth_token_log.rb | 2 ++ ...552_add_subcategory_list_style_to_categories.rb | 2 ++ db/migrate/20170313192741_add_themes.rb | 2 ++ .../20170322065911_create_topic_status_updates.rb | 2 ++ ...20170322155537_add_theme_to_stylesheet_cache.rb | 2 ++ ...2191305_add_default_top_period_to_categories.rb | 2 ++ ...ve_auto_close_columns_to_topic_status_update.rb | 2 ++ .../20170324144456_amend_css_columns_in_theme.rb | 2 ++ db/migrate/20170328163918_break_up_themes_table.rb | 2 ++ ...8203122_add_compiler_version_to_theme_fields.rb | 2 ++ ...0330041605_add_index_to_topic_status_updates.rb | 2 ++ ...2717_add_category_id_to_topic_status_updates.rb | 2 ++ db/migrate/20170407154510_rename_theme_id.rb | 2 ++ .../20170410170923_add_theme_remote_fields.rb | 2 ++ db/migrate/20170413043152_rename_warnings.rb | 2 ++ .../20170417164715_add_theme_id_to_color_scheme.rb | 2 ++ .../20170419193714_add_error_to_theme_fields.rb | 2 ++ ...3628_add_default_notification_level_to_group.rb | 2 ++ ...0170425083011_add_deleted_at_to_topic_embeds.rb | 2 ++ .../20170425172415_add_error_to_scheduler_stats.rb | 2 ++ ...20170501191912_add_upload_id_to_theme_fields.rb | 2 ++ ...ng_list_daily_updates_users_to_daily_summary.rb | 2 ++ ...83819_add_css_class_name_to_embeddable_hosts.rb | 2 ++ ...355_remove_convert_pasted_image_site_setting.rb | 2 ++ ...e_convert_pasted_images_quality_site_setting.rb | 2 ++ ..._rename_topic_status_updates_to_topic_timers.rb | 2 ++ ...20170512153318_add_theme_key_to_user_options.rb | 2 ++ ...0512185227_create_topic_status_updates_again.rb | 2 ++ ...0515152725_add_theme_key_seq_to_user_options.rb | 2 ++ ...170515203721_add_public_type_to_topic_timers.rb | 2 ++ ...02132735_fix_group_allow_membership_requests.rb | 2 ++ ...014820_remove_auto_close_columns_from_topics.rb | 2 ++ .../20170609115401_add_extension_to_topic_links.rb | 2 ++ db/migrate/20170628152322_create_watched_words.rb | 2 ++ .../20170630083540_add_custom_message_to_invite.rb | 2 ++ .../20170703115216_add_extension_to_uploads.rb | 2 ++ ...0170703144855_add_visibility_level_to_groups.rb | 2 ++ .../20170704142141_add_visible_back_to_groups.rb | 2 ++ db/migrate/20170713164357_create_search_logs.rb | 2 ++ db/migrate/20170717084947_create_user_emails.rb | 2 ++ ...ct_default_email_mailing_list_mode_frequency.rb | 2 ++ .../20170728012754_split_public_in_groups.rb | 2 ++ ...04_add_membership_request_template_to_groups.rb | 2 ++ .../20170803123704_add_version_to_search_data.rb | 2 ++ db/migrate/20170818191909_split_alias_levels.rb | 2 ++ .../20170823173427_create_tag_search_data.rb | 2 ++ .../20170824172615_add_slug_index_on_topic.rb | 2 ++ .../20170831180419_remove_whisper_topic_links.rb | 2 ++ ...180951_rename_forgot_password_strict_setting.rb | 2 ++ ...8_add_allow_private_messages_to_user_options.rb | 2 ++ db/migrate/20171026014317_add_user_option_home.rb | 2 ++ .../20171110174413_rename_blocked_silence.rb | 2 ++ .../20171113175414_add_silenced_till_to_users.rb | 2 ++ .../20171113214725_add_time_read_to_user_visits.rb | 2 ++ ...5170858_add_mailinglist_mirror_to_categories.rb | 2 ++ ...0171123200157_add_trust_level_locks_to_users.rb | 2 ++ ..._rename_clicked_topic_id_to_search_result_id.rb | 2 ++ ...1_replace_invite_mailer_translation_override.rb | 2 ++ ...0171214040346_add_email_to_twitter_user_info.rb | 2 ++ ...71220181249_change_user_emails_primary_index.rb | 2 ++ ...28122834_replace_blocked_silence_translation.rb | 2 ++ .../20180109222722_create_user_second_factors.rb | 2 ++ .../20180111092141_add_indexes_to_email_logs.rb | 2 ++ db/migrate/20180118215249_create_theme_settings.rb | 2 ++ .../20180125185717_add_locked_by_to_posts.rb | 2 ++ .../20180127005644_remove_old_ga_site_settings.rb | 2 ++ .../20180131052859_rename_private_personal.rb | 2 ++ ...ipped_created_at_user_id_index_on_email_logs.rb | 2 ++ .../20180207163946_create_category_tag_stats.rb | 2 ++ ...15641_add_suppress_from_latest_to_categories.rb | 2 ++ ...223041147_fix_google_oauth2_prompt_data_type.rb | 2 ++ ...3222415_remove_censored_pattern_site_setting.rb | 2 ++ ...20180308071922_drop_raise_read_only_function.rb | 2 ++ ...180309014014_add_private_key_to_remote_theme.rb | 2 ++ ...card_background_url_to_single_sign_on_record.rb | 2 ++ db/migrate/20180316165104_create_shared_drafts.rb | 2 ++ .../20180320190339_create_web_crawler_requests.rb | 2 ++ .../20180323154826_create_tag_group_permissions.rb | 2 ++ .../20180323161659_add_id_to_shared_drafts.rb | 2 ++ ...7062911_add_post_custom_fields_akismet_index.rb | 2 ++ ...28180317_add_category_index_to_shared_drafts.rb | 2 ++ ...5522_add_minimum_required_tags_to_categories.rb | 2 ++ ...20180419095326_add_upload_id_to_user_exports.rb | 2 ++ .../20180420141134_remove_staff_tags_setting.rb | 2 ++ .../20180425152503_drop_user_card_badge_columns.rb | 2 ++ .../20180425185749_create_push_subscription.rb | 2 ++ ...180508142711_remove_invite_passthrough_hours.rb | 2 ++ .../20180514133440_add_pm_topic_count_to_tags.rb | 2 ++ ..._delete_confirm_old_email_template_overrides.rb | 2 ++ ...0180521175611_change_indexes_topic_view_item.rb | 2 ++ .../20180521184439_allow_null_ip_search_log.rb | 2 ++ ...0180521190040_allow_null_ip_topic_link_click.rb | 2 ++ ...180521191418_allow_null_ip_user_profile_view.rb | 2 ++ .../20180607095414_migrate_disable_emails.rb | 2 ++ ...807_add_index_topic_id_percent_rank_on_posts.rb | 2 ++ .../20180706054922_drop_key_column_from_themes.rb | 2 ++ ...75119_add_index_topic_id_sort_order_on_posts.rb | 2 ++ ...72959_disallow_multi_levels_theme_components.rb | 2 ++ ...012_add_index_user_id_on_user_second_factors.rb | 2 ++ ...igate_to_first_post_after_read_to_categories.rb | 2 ++ ...0180716072125_alter_bounce_key_on_email_logs.rb | 2 ++ ...716140323_add_uniq_ip_or_user_id_topic_views.rb | 2 ++ db/migrate/20180716200103_add_theme_key_default.rb | 2 ++ ...5038_drop_not_null_ip_address_on_topic_views.rb | 2 ++ ...20180717084758_alter_reply_key_on_email_logs.rb | 2 ++ .../20180718062728_create_post_reply_keys.rb | 2 ++ .../20180719103905_alter_indexes_on_email_logs.rb | 2 ++ .../20180720054856_create_skipped_email_logs.rb | 2 ++ .../20180724070554_drop_topic_id_on_email_logs.rb | 2 ++ ...y_key_skipped_skipped_reason_from_email_logs.rb | 2 ++ ...729092926_remove_track_external_right_clicks.rb | 2 ++ ...180803085321_add_index_email_logs_on_bounced.rb | 2 ++ ...0180812150839_add_user_api_keys_last_used_at.rb | 2 ++ .../20180813074843_add_component_to_themes.rb | 2 ++ ...80827053514_add_filesize_to_optimized_images.rb | 2 ++ .../20180828065005_change_bounce_score_to_float.rb | 2 ++ .../20180831182853_add_branch_to_remote_theme.rb | 2 ++ ...7075713_add_last_error_text_to_remote_themes.rb | 2 ++ .../20180913200027_remove_enforce_square_emoji.rb | 2 ++ ...180916195601_migrate_s3_backup_site_settings.rb | 2 ++ ...20023559_add_external_details_to_user_fields.rb | 2 ++ db/migrate/20180920042415_create_user_uploads.rb | 2 ++ .../20180927135248_create_javascript_caches.rb | 2 ++ db/migrate/20180928105835_add_index_to_tags.rb | 2 ++ ...57_add_sso_provider_secrets_to_site_settings.rb | 2 ++ .../20181005144357_add_via_email_to_invites.rb | 2 ++ ...dd_hide_profile_and_presence_to_user_options.rb | 2 ++ .../20181031165343_add_flag_stats_to_user.rb | 2 ++ ...181108115009_create_user_associated_accounts.rb | 2 ++ ...181120140552_migrate_corporate_site_settings.rb | 2 ++ .../20181128140547_migrate_facebook_user_info.rb | 2 ++ ...not_null_minimum_required_tags_on_categories.rb | 2 ++ ...204123042_add_uploaded_meta_id_to_categories.rb | 2 ++ ...81204193426_create_join_table_web_hooks_tags.rb | 2 ++ .../20181207141900_migrate_twitter_user_info.rb | 2 ++ ...remove_not_null_user_associated_account_user.rb | 2 ++ db/migrate/20181218071253_add_etag_to_uploads.rb | 2 ++ ...1221121805_create_theme_translation_override.rb | 2 ++ ...190103051737_add_version_to_optimized_images.rb | 2 ++ ...0103060819_force_rebake_on_posts_with_images.rb | 2 ++ db/migrate/20190103160533_create_reviewables.rb | 2 ++ .../20190103185626_create_reviewable_users.rb | 2 ++ ...6041015_add_topic_id_index_to_user_histories.rb | 2 ++ ...0108110630_add_text_size_key_to_user_options.rb | 2 ++ ...enable_content_security_policy_for_new_sites.rb | 2 ++ ...ve_google_plus_from_share_links_site_setting.rb | 2 ++ .../20190110212005_create_reviewable_histories.rb | 2 ++ ...190111170824_migrate_reviewable_queued_posts.rb | 2 ++ db/migrate/20190117191606_create_group_requests.rb | 2 ++ .../20190121202656_remove_user_action_pending.rb | 2 ++ .../20190122132732_add_fields_to_remote_themes.rb | 2 ++ ...25103246_copy_login_required_welcome_message.rb | 2 ++ ...90125153345_add_text_size_seq_to_user_option.rb | 2 ++ ...d_index_on_user_id_to_single_sign_on_records.rb | 2 ++ .../20190130163000_create_reviewable_scores.rb | 2 ++ ...90130163001_migrate_reviewable_flagged_posts.rb | 2 ++ ...5204033_add_score_bonus_to_post_action_types.rb | 2 ++ .../20190225133654_add_ignored_users_table.rb | 2 ++ .../20190227150413_migrate_instagram_user_info.rb | 2 ++ ...227210035_add_missing_topic_id_site_settings.rb | 2 ++ ...04170931_migrate_uncategorized_category_name.rb | 2 ++ .../20190306154335_migrate_google_user_info.rb | 2 ++ ...0190306184409_add_reviewable_score_to_topics.rb | 2 ++ .../20190312181641_migrate_email_user_options.rb | 2 ++ ...313134642_migrate_default_user_email_options.rb | 2 ++ .../20190313171338_add_indexes_to_reviewables.rb | 2 ++ ...0190313205652_rename_moderator_site_settings.rb | 2 ++ ...0314082018_add_search_priority_to_categories.rb | 2 ++ ..._summarized_at_column_to_ignored_users_table.rb | 2 ++ ...rate_blank_override_for_upload_site_settings.rb | 2 ++ ...grate_null_override_for_upload_site_settings.rb | 2 ++ ...0315170411_add_index_to_reviewable_histories.rb | 2 ++ db/migrate/20190315174428_migrate_flag_history.rb | 2 ++ ..._action_type_id_disagreed_at_on_post_actions.rb | 2 ++ .../20190320104640_remove_s3_force_path_style.rb | 2 ++ ..._index_method_enabled_on_user_second_factors.rb | 2 ++ ...152347_force_rebake_on_posts_with_lightboxes.rb | 2 ++ .../20190325162154_make_site_settings_unique.rb | 2 ++ ...26123708_add_index_created_at_on_search_logs.rb | 2 ++ ...dd_expiring_at_column_to_ignored_users_table.rb | 2 ++ .../20190327205525_require_reviewable_scores.rb | 2 ++ ...0402024053_add_first_unread_at_to_user_stats.rb | 2 ++ .../20190402142223_disable_invite_only_sso.rb | 2 ++ ...03180142_add_allow_global_tags_to_categories.rb | 2 ++ db/migrate/20190403202001_fix_reviewable_users.rb | 2 ++ ...index_action_type_created_at_on_user_actions.rb | 2 ++ ...08072550_add_index_id_baked_version_on_posts.rb | 2 ++ .../20190408082101_add_search_data_indexes.rb | 2 ++ ...0409054736_add_index_for_rebake_old_on_posts.rb | 2 ++ ...410055459_add_index_reply_id_on_post_replies.rb | 2 ++ ...2915_remove_ignore_user_enabled_site_setting.rb | 2 ++ ..._missing_uploads_index_to_post_custom_fields.rb | 2 ++ ...1121312_add_title_count_mode_to_user_options.rb | 2 ++ ...190411144545_add_reason_to_reviewable_scores.rb | 2 ++ ...12161430_add_created_by_index_to_reviewables.rb | 2 ++ db/migrate/20190414162753_rename_post_notices.rb | 2 ++ ...35049_migrate_native_app_banner_site_setting.rb | 2 ++ .../20190417203622_add_review_group_to_category.rb | 2 ++ ...418113814_add_unique_index_to_group_requests.rb | 2 ++ ...90423112954_increase_theme_field_name_length.rb | 2 ++ .../20190424065841_add_post_image_indexes.rb | 2 ++ ...426074404_add_missing_user_destroyer_indexes.rb | 2 ++ ...26123026_add_incoming_email_by_user_id_index.rb | 2 ++ ...0426123658_add_index_on_user_auth_token_user.rb | 2 ++ .../20180917024729_remove_superfluous_columns.rb | 2 ++ .../20180917034056_remove_superfluous_tables.rb | 2 ++ ...3001_drop_group_locked_trust_level_from_user.rb | 2 ++ .../20181112013117_migrate_url_site_settings.rb | 2 ++ ...065652_remove_uploaded_meta_id_from_category.rb | 2 ++ ...203023_drop_queued_post_id_from_user_actions.rb | 2 ++ .../20190123171817_drop_queued_posts.rb | 2 ++ .../20190205104116_drop_unused_auth_tables.rb | 2 ++ ...20190208144706_drop_unused_auth_tables_again.rb | 2 ++ ...190312194528_drop_email_user_options_columns.rb | 2 ++ .../postgresql_fallback_adapter.rb | 2 ++ lib/admin_confirmation.rb | 2 ++ lib/admin_constraint.rb | 2 ++ lib/age_words.rb | 2 ++ lib/archetype.rb | 2 ++ lib/auth.rb | 2 ++ lib/auth/auth_provider.rb | 2 ++ lib/auth/authenticator.rb | 2 ++ lib/auth/current_user_provider.rb | 2 ++ lib/auth/facebook_authenticator.rb | 2 ++ lib/auth/github_authenticator.rb | 2 ++ lib/auth/google_oauth2_authenticator.rb | 2 ++ lib/auth/instagram_authenticator.rb | 2 ++ lib/auth/managed_authenticator.rb | 2 ++ lib/auth/oauth2_authenticator.rb | 2 ++ lib/auth/open_id_authenticator.rb | 2 ++ lib/auth/result.rb | 2 ++ lib/auth/twitter_authenticator.rb | 2 ++ lib/autospec/base_runner.rb | 2 ++ lib/autospec/formatter.rb | 2 ++ lib/autospec/manager.rb | 4 +++- lib/autospec/qunit_runner.rb | 2 ++ lib/autospec/reload_css.rb | 2 ++ lib/autospec/rspec_runner.rb | 2 ++ lib/autospec/simple_runner.rb | 4 +++- lib/avatar_lookup.rb | 2 ++ lib/backup_restore/backup_restore.rb | 2 ++ lib/backup_restore/backup_store.rb | 2 ++ lib/backup_restore/backuper.rb | 2 ++ lib/backup_restore/local_backup_store.rb | 2 ++ lib/backup_restore/restorer.rb | 2 ++ lib/backup_restore/s3_backup_store.rb | 2 ++ lib/badge_posts_view_manager.rb | 2 ++ lib/badge_queries.rb | 2 ++ lib/base62.rb | 2 ++ lib/browser_detection.rb | 2 ++ lib/cache.rb | 4 +++- lib/canonical_url.rb | 2 ++ lib/category_badge.rb | 6 +++--- lib/comment_migration.rb | 2 +- lib/common_passwords/common_passwords.rb | 2 ++ lib/composer_messages_finder.rb | 2 ++ lib/configurable_urls.rb | 2 ++ lib/content_buffer.rb | 2 ++ lib/cooked_post_processor.rb | 4 +++- lib/crawler_detection.rb | 2 ++ lib/current_user.rb | 2 ++ lib/custom_renderer.rb | 2 ++ lib/custom_setting_providers.rb | 2 ++ lib/db_helper.rb | 2 ++ lib/demon/base.rb | 2 ++ lib/demon/rails_autospec.rb | 2 ++ lib/demon/sidekiq.rb | 2 ++ lib/directory_helper.rb | 2 ++ lib/discourse.rb | 12 +++++++----- lib/discourse_cookie_store.rb | 2 ++ lib/discourse_diff.rb | 2 ++ lib/discourse_event.rb | 2 ++ lib/discourse_hub.rb | 2 ++ lib/discourse_iife.rb | 2 ++ lib/discourse_logstash_logger.rb | 2 ++ lib/discourse_plugin.rb | 2 ++ lib/discourse_plugin_registry.rb | 2 ++ lib/discourse_redis.rb | 2 ++ lib/discourse_tagging.rb | 2 ++ lib/discourse_updates.rb | 2 ++ lib/disk_space.rb | 2 ++ lib/distributed_memoizer.rb | 6 ++++-- lib/distributed_mutex.rb | 2 ++ lib/edit_rate_limiter.rb | 2 ++ lib/email.rb | 2 ++ lib/email/message_builder.rb | 6 ++++-- lib/email/processor.rb | 2 ++ lib/email/receiver.rb | 6 +++++- lib/email/renderer.rb | 2 ++ lib/email/sender.rb | 2 ++ lib/email/styles.rb | 2 ++ lib/email_backup_token.rb | 2 ++ lib/email_cook.rb | 6 ++++-- lib/email_updater.rb | 4 +++- lib/encodings.rb | 2 ++ lib/enum.rb | 2 ++ lib/enum_site_setting.rb | 2 ++ lib/es6_module_transpiler/rails.rb | 2 ++ lib/es6_module_transpiler/rails/version.rb | 2 ++ lib/es6_module_transpiler/sprockets.rb | 2 ++ lib/es6_module_transpiler/tilt.rb | 2 ++ .../tilt/es6_module_transpiler_template.rb | 6 ++++-- lib/excerpt_parser.rb | 14 ++++++++------ lib/feed_element_installer.rb | 2 ++ lib/feed_item_accessor.rb | 2 ++ lib/file_helper.rb | 2 ++ lib/file_store/base_store.rb | 2 ++ lib/file_store/local_store.rb | 2 ++ lib/file_store/s3_store.rb | 4 ++++ lib/filter_best_posts.rb | 2 ++ lib/final_destination.rb | 2 ++ lib/flag_query.rb | 2 ++ lib/flag_settings.rb | 2 ++ .../active_record_attribute_methods.rb | 2 ++ lib/freedom_patches/active_record_base.rb | 2 ++ lib/freedom_patches/ams_include_without_root.rb | 2 ++ lib/freedom_patches/better_handlebars_errors.rb | 2 ++ lib/freedom_patches/fast_pluck.rb | 2 ++ lib/freedom_patches/inflector_backport.rb | 2 ++ lib/freedom_patches/match.rb | 2 ++ lib/freedom_patches/open_uri_redirections.rb | 2 ++ lib/freedom_patches/performance_fixes.rb | 2 ++ lib/freedom_patches/postgresql_adapter.rb | 2 ++ lib/freedom_patches/rack_patches.rb | 2 ++ lib/freedom_patches/rails4.rb | 2 ++ lib/freedom_patches/rails6.rb | 2 ++ lib/freedom_patches/raw_handlebars.rb | 2 ++ lib/freedom_patches/reaper.rb | 2 ++ lib/freedom_patches/redis.rb | 2 ++ lib/freedom_patches/regexp.rb | 2 ++ lib/freedom_patches/safe_buffer.rb | 8 +++++--- lib/freedom_patches/safe_migrations.rb | 2 ++ lib/freedom_patches/schema_migration_details.rb | 2 ++ lib/freedom_patches/sprockets_patches.rb | 2 ++ lib/freedom_patches/translate_accelerator.rb | 2 ++ lib/gaps.rb | 2 ++ lib/generators/plugin/plugin_generator.rb | 2 ++ lib/global_path.rb | 2 ++ lib/guardian.rb | 2 ++ lib/guardian/category_guardian.rb | 2 ++ lib/guardian/ensure_magic.rb | 2 ++ lib/guardian/group_guardian.rb | 2 ++ lib/guardian/post_guardian.rb | 2 ++ lib/guardian/post_revision_guardian.rb | 2 ++ lib/guardian/tag_guardian.rb | 2 ++ lib/guardian/topic_guardian.rb | 2 ++ lib/guardian/user_guardian.rb | 2 ++ lib/has_errors.rb | 2 ++ lib/homepage_constraint.rb | 2 ++ lib/html_prettify.rb | 4 +++- lib/html_to_markdown.rb | 14 +++++++++----- lib/i18n/backend/discourse_i18n.rb | 2 ++ lib/i18n/backend/fallback_locale_list.rb | 2 ++ lib/i18n/duplicate_key_finder.rb | 2 ++ lib/i18n/i18n_interpolation_keys_finder.rb | 2 ++ lib/i18n/locale_file_checker.rb | 2 ++ lib/i18n/locale_file_walker.rb | 2 ++ lib/image_sizer.rb | 2 ++ lib/import/normalize.rb | 2 ++ lib/import_export/base_exporter.rb | 2 ++ lib/import_export/category_exporter.rb | 2 ++ lib/import_export/category_structure_exporter.rb | 2 ++ lib/import_export/import_export.rb | 2 ++ lib/import_export/importer.rb | 2 ++ lib/import_export/topic_exporter.rb | 2 ++ lib/inline_oneboxer.rb | 2 ++ lib/introduction_updater.rb | 2 ++ lib/ip_addr.rb | 2 ++ lib/js_locale_helper.rb | 8 +++++--- lib/json_error.rb | 2 ++ lib/letter_avatar.rb | 2 ++ lib/markdown_linker.rb | 4 +++- lib/mem_info.rb | 2 ++ lib/message_bus_diags.rb | 2 ++ lib/method_profiler.rb | 2 ++ lib/middleware/discourse_public_exceptions.rb | 2 ++ lib/middleware/missing_avatars.rb | 2 ++ lib/migration/base_dropper.rb | 2 ++ lib/migration/column_dropper.rb | 2 ++ lib/migration/safe_migrate.rb | 2 ++ lib/migration/table_dropper.rb | 2 ++ lib/mini_sql_multisite_connection.rb | 6 ++++-- lib/mobile_detection.rb | 2 ++ lib/new_post_manager.rb | 2 ++ lib/new_post_result.rb | 2 ++ lib/notification_levels.rb | 2 ++ lib/onebox/discourse_onebox_sanitize_config.rb | 2 ++ lib/onebox/engine/flash_video_onebox.rb | 2 ++ lib/onebox/engine/whitelisted_generic_onebox.rb | 2 ++ lib/oneboxer.rb | 2 ++ lib/onpdiff.rb | 2 ++ lib/pbkdf2.rb | 2 ++ lib/permalink_constraint.rb | 2 ++ lib/pinned_check.rb | 2 ++ lib/plain_text_to_markdown.rb | 6 ++++-- lib/plugin/filter.rb | 2 ++ lib/plugin/filter_manager.rb | 2 ++ lib/plugin/instance.rb | 2 ++ lib/plugin/metadata.rb | 2 ++ lib/plugin_gem.rb | 2 ++ lib/post_action_creator.rb | 2 ++ lib/post_action_destroyer.rb | 2 ++ lib/post_action_result.rb | 2 ++ lib/post_creator.rb | 2 ++ lib/post_destroyer.rb | 2 ++ lib/post_jobs_enqueuer.rb | 2 ++ lib/post_locker.rb | 2 ++ lib/post_merger.rb | 2 ++ lib/post_revisor.rb | 2 ++ lib/pretty_text.rb | 10 ++++++---- lib/pretty_text/helpers.rb | 2 ++ lib/primary_group_lookup.rb | 2 ++ lib/promotion.rb | 2 ++ lib/quote_comparer.rb | 2 ++ lib/rate_limiter.rb | 2 ++ lib/rate_limiter/limit_exceeded.rb | 2 ++ lib/rate_limiter/on_create_record.rb | 2 ++ lib/remap.rb | 2 ++ lib/retrieve_title.rb | 2 ++ lib/reviewable/actions.rb | 2 ++ lib/reviewable/collection.rb | 2 ++ lib/reviewable/conversation.rb | 2 ++ lib/reviewable/editable_fields.rb | 2 ++ lib/reviewable/perform_result.rb | 2 ++ lib/route_format.rb | 2 ++ lib/rtl.rb | 2 ++ lib/s3_helper.rb | 4 ++++ lib/score_calculator.rb | 2 ++ lib/screening_model.rb | 2 ++ lib/search.rb | 2 ++ lib/search/grouped_search_results.rb | 2 ++ lib/secure_session.rb | 2 ++ lib/seed_data/categories.rb | 2 ++ lib/seed_data/topics.rb | 2 ++ lib/sidekiq/pausable.rb | 2 ++ lib/single_sign_on.rb | 2 ++ lib/single_sign_on_provider.rb | 2 ++ lib/site_icon_manager.rb | 2 ++ lib/site_settings/db_provider.rb | 2 ++ lib/site_settings/deprecated_settings.rb | 2 ++ lib/site_settings/local_process_provider.rb | 2 ++ lib/site_settings/type_supervisor.rb | 2 ++ lib/site_settings/validations.rb | 2 ++ lib/site_settings/yaml_loader.rb | 2 ++ lib/slug.rb | 1 + lib/socket_server.rb | 4 +++- lib/source_url.rb | 2 ++ lib/spam_handler.rb | 2 ++ lib/sql_builder.rb | 2 ++ lib/staff_constraint.rb | 2 ++ lib/staff_message_format.rb | 4 +++- lib/stylesheet/common.rb | 2 ++ lib/stylesheet/compiler.rb | 2 ++ lib/stylesheet/functions.rb | 2 ++ lib/stylesheet/importer.rb | 9 +++++---- lib/stylesheet/manager.rb | 2 ++ lib/stylesheet/watcher.rb | 2 ++ lib/suggested_topics_builder.rb | 2 ++ lib/system_message.rb | 2 ++ lib/tasks/add_topic_to_quotes.rake | 2 ++ lib/tasks/admin.rake | 1 + lib/tasks/api.rake | 2 ++ lib/tasks/assets.rake | 2 ++ lib/tasks/auto_annotate_models.rake | 2 ++ lib/tasks/autospec.rake | 2 ++ lib/tasks/avatars.rake | 2 ++ lib/tasks/backfill.thor | 2 ++ lib/tasks/build.rake | 2 ++ lib/tasks/build_test_topic.rake | 2 ++ lib/tasks/categories.rake | 2 ++ lib/tasks/cdn.rake | 2 ++ lib/tasks/db.rake | 2 ++ lib/tasks/destroy.rake | 2 ++ lib/tasks/docker.rake | 2 ++ lib/tasks/emails.rake | 2 ++ lib/tasks/emoji.rake | 2 ++ lib/tasks/export.rake | 2 ++ lib/tasks/i18n.rake | 2 ++ lib/tasks/images.rake | 2 ++ lib/tasks/import.rake | 2 ++ lib/tasks/integration.rake | 2 ++ lib/tasks/javascript.rake | 2 ++ lib/tasks/maxminddb.rake | 2 ++ lib/tasks/plugin.rake | 2 ++ lib/tasks/populate.thor | 2 ++ lib/tasks/posts.rake | 2 ++ lib/tasks/qunit.rake | 2 ++ lib/tasks/redis.rake | 2 ++ lib/tasks/release_note.rake | 2 ++ lib/tasks/rspec.rake | 2 ++ lib/tasks/s3.rake | 2 ++ lib/tasks/scheduler.rake | 2 ++ lib/tasks/search.rake | 2 ++ lib/tasks/site_settings.rake | 2 ++ lib/tasks/smoke_test.rake | 2 ++ lib/tasks/svg_icons.rake | 2 ++ lib/tasks/tags.rake | 2 ++ lib/tasks/topics.rake | 2 ++ lib/tasks/typepad.thor | 2 ++ lib/tasks/uploads.rake | 2 ++ lib/tasks/user_actions.rake | 2 ++ lib/tasks/users.rake | 2 ++ lib/text_sentinel.rb | 2 ++ lib/theme_javascript_compiler.rb | 4 +++- lib/theme_settings_manager.rb | 2 ++ lib/theme_settings_parser.rb | 2 ++ lib/theme_store/git_importer.rb | 2 ++ lib/theme_store/tgz_exporter.rb | 2 ++ lib/theme_store/tgz_importer.rb | 2 ++ lib/theme_translation_manager.rb | 2 ++ lib/theme_translation_parser.rb | 2 ++ lib/timeline_lookup.rb | 2 ++ lib/topic_creator.rb | 2 ++ lib/topic_list_responder.rb | 2 ++ lib/topic_publisher.rb | 2 ++ lib/topic_query.rb | 10 +++++++++- lib/topic_retriever.rb | 2 ++ lib/topic_subtype.rb | 2 ++ lib/topic_view.rb | 4 +++- lib/topics_bulk_action.rb | 2 ++ lib/trust_level.rb | 2 ++ lib/twitter_api.rb | 2 ++ lib/unread.rb | 2 ++ lib/upload_creator.rb | 2 ++ lib/upload_fixer.rb | 2 ++ lib/upload_recovery.rb | 2 ++ lib/url_helper.rb | 4 +++- .../allow_user_locale_enabled_validator.rb | 2 ++ lib/validators/allowed_ip_address_validator.rb | 2 ++ ...ternative_reply_by_email_addresses_validator.rb | 2 ++ .../category_search_priority_weights_validator.rb | 2 ++ lib/validators/censored_words_validator.rb | 2 ++ lib/validators/color_list_validator.rb | 2 ++ lib/validators/email_setting_validator.rb | 2 ++ lib/validators/email_validator.rb | 2 ++ lib/validators/enable_invite_only_validator.rb | 2 ++ .../enable_local_logins_via_email_validator.rb | 2 ++ .../enable_private_email_messages_validator.rb | 2 ++ lib/validators/enable_sso_validator.rb | 2 ++ .../external_system_avatars_validator.rb | 2 ++ lib/validators/group_setting_validator.rb | 2 ++ lib/validators/integer_setting_validator.rb | 2 ++ lib/validators/ip_address_format_validator.rb | 2 ++ lib/validators/max_emojis_validator.rb | 2 ++ lib/validators/max_username_length_validator.rb | 2 ++ lib/validators/min_username_length_validator.rb | 2 ++ lib/validators/password_validator.rb | 2 ++ .../pop3_polling_enabled_setting_validator.rb | 2 ++ lib/validators/post_validator.rb | 2 ++ lib/validators/quality_title_validator.rb | 2 ++ lib/validators/regex_presence_validator.rb | 2 ++ lib/validators/regex_setting_validation.rb | 2 ++ lib/validators/regex_setting_validator.rb | 2 ++ lib/validators/reply_by_email_enabled_validator.rb | 2 ++ lib/validators/sso_overrides_email_validator.rb | 2 ++ lib/validators/string_setting_validator.rb | 2 ++ lib/validators/stripped_length_validator.rb | 2 ++ lib/validators/topic_title_length_validator.rb | 2 ++ lib/validators/unicode_username_validator.rb | 2 ++ .../unicode_username_whitelist_validator.rb | 2 ++ lib/validators/unique_among_validator.rb | 2 ++ lib/validators/upload_validator.rb | 2 ++ lib/validators/url_validator.rb | 2 ++ lib/validators/user_full_name_validator.rb | 2 ++ lib/validators/username_setting_validator.rb | 2 ++ lib/version.rb | 2 ++ lib/wizard.rb | 2 ++ lib/wizard/builder.rb | 2 ++ lib/wizard/field.rb | 2 ++ lib/wizard/step.rb | 2 ++ plugins/discourse-details/plugin.rb | 2 ++ .../spec/components/pretty_text_spec.rb | 2 ++ .../lib/discourse_local_dates/engine.rb | 2 ++ plugins/discourse-local-dates/plugin.rb | 2 ++ .../spec/integration/local_dates_spec.rb | 2 ++ .../spec/lib/pretty_text_spec.rb | 2 ++ .../discourse-local-dates/spec/models/post_spec.rb | 2 ++ .../autoload/jobs/bot_input.rb | 2 ++ .../autoload/jobs/narrative_init.rb | 2 ++ .../autoload/jobs/narrative_timeout.rb | 2 ++ .../autoload/jobs/onceoff/grant_badges.rb | 2 ++ .../autoload/jobs/onceoff/remap_old_bot_images.rb | 2 ++ .../autoload/jobs/send_default_welcome_message.rb | 2 ++ .../db/fixtures/001_discobot.rb | 2 ++ .../db/fixtures/002_badges.rb | 2 ++ .../lib/discourse_narrative_bot/actions.rb | 2 ++ .../advanced_user_narrative.rb | 2 ++ .../lib/discourse_narrative_bot/base.rb | 2 ++ .../certificate_generator.rb | 2 ++ .../lib/discourse_narrative_bot/dice.rb | 2 ++ .../lib/discourse_narrative_bot/magic_8_ball.rb | 2 ++ .../discourse_narrative_bot/new_user_narrative.rb | 2 ++ .../lib/discourse_narrative_bot/quote_generator.rb | 2 ++ .../lib/discourse_narrative_bot/track_selector.rb | 2 ++ .../welcome_post_type_site_setting.rb | 2 ++ plugins/discourse-narrative-bot/plugin.rb | 2 ++ .../advanced_user_narrative_spec.rb | 2 ++ .../new_user_narrative_spec.rb | 2 ++ .../spec/discourse_narrative_bot/store_spec.rb | 2 ++ .../discourse_narrative_bot/track_selector_spec.rb | 2 ++ .../spec/jobs/onceoff/grant_badges_spec.rb | 2 ++ .../spec/jobs/onceoff/remap_old_bot_iamges_spec.rb | 2 ++ .../spec/jobs/send_default_welcome_message_spec.rb | 2 ++ .../spec/lib/certificate_generator_spec.rb | 2 ++ .../spec/requests/discobot_certificate_spec.rb | 2 ++ .../spec/requests/discobot_welcome_post_spec.rb | 2 ++ plugins/discourse-narrative-bot/spec/user_spec.rb | 2 ++ .../app/jobs/scheduled/daily_performance_report.rb | 2 ++ .../lib/log_analyzer.rb | 2 ++ .../discourse-nginx-performance-report/plugin.rb | 2 ++ .../script/nginx_analyze.rb | 2 ++ .../spec/line_parser_spec.rb | 2 ++ plugins/discourse-presence/plugin.rb | 2 ++ .../spec/presence_manager_spec.rb | 2 ++ .../spec/requests/presence_controller_spec.rb | 2 ++ plugins/lazyYT/plugin.rb | 2 ++ plugins/poll/app/models/poll.rb | 2 ++ plugins/poll/app/models/poll_option.rb | 2 ++ plugins/poll/app/models/poll_vote.rb | 2 ++ .../poll/app/serializers/poll_option_serializer.rb | 2 ++ plugins/poll/app/serializers/poll_serializer.rb | 2 ++ .../20150501152228_rename_total_votes_to_voters.rb | 2 ++ .../db/migrate/20151016163051_merge_polls_votes.rb | 2 ++ .../20160321164925_close_polls_in_closed_topics.rb | 2 ++ .../migrate/20180820073549_create_polls_tables.rb | 2 ++ .../20180820080623_migrate_polls_data.rb | 2 ++ plugins/poll/jobs/regular/close_poll.rb | 2 ++ plugins/poll/lib/polls_validator.rb | 2 ++ plugins/poll/lib/post_validator.rb | 2 ++ plugins/poll/lib/tasks/migrate_old_polls.rake | 2 ++ .../poll/spec/controllers/polls_controller_spec.rb | 2 ++ .../poll/spec/controllers/posts_controller_spec.rb | 2 ++ .../db/post_migrate/migrate_polls_data_spec.rb | 2 ++ .../poll/spec/integration/poll_endpoints_spec.rb | 2 ++ plugins/poll/spec/jobs/regular/close_poll_spec.rb | 2 ++ plugins/poll/spec/lib/new_post_manager_spec.rb | 2 ++ plugins/poll/spec/lib/polls_updater_spec.rb | 2 ++ plugins/poll/spec/lib/polls_validator_spec.rb | 2 ++ plugins/poll/spec/lib/pretty_text_spec.rb | 2 ++ .../poll/spec/requests/users_controller_spec.rb | 2 ++ script/bench.rb | 2 ++ script/benchmarks/markdown/bench.rb | 2 ++ script/benchmarks/middleware/test.rb | 2 ++ script/benchmarks/site_setting/bench.rb | 2 ++ script/benchmarks/site_setting/profile.rb | 2 ++ script/boot_mem.rb | 2 ++ script/bulk_import/base.rb | 2 ++ script/bulk_import/discourse_merger.rb | 2 ++ script/bulk_import/phpbb_postgresql.rb | 2 ++ script/bulk_import/vanilla.rb | 2 ++ script/bulk_import/vbulletin.rb | 2 ++ script/check_forking.rb | 2 ++ script/compile_hbs.rb | 2 ++ script/demon_test/child | 1 + script/demon_test/parent.rb | 2 ++ script/diff_heaps.rb | 2 ++ script/discourse | 1 + script/docker_test.rb | 2 ++ script/downsize_uploads.rb | 2 ++ script/import_scripts/answerbase.rb | 2 ++ script/import_scripts/askbot.rb | 2 ++ script/import_scripts/base.rb | 2 ++ script/import_scripts/base/csv_helper.rb | 2 ++ script/import_scripts/base/generic_database.rb | 2 ++ script/import_scripts/base/lookup_container.rb | 2 ++ script/import_scripts/base/uploader.rb | 2 ++ script/import_scripts/bbpress.rb | 2 ++ script/import_scripts/bespoke_1.rb | 2 ++ script/import_scripts/discuz_x.rb | 2 ++ script/import_scripts/disqus.rb | 2 ++ script/import_scripts/drupal-6.rb | 2 ++ script/import_scripts/drupal.rb | 2 ++ script/import_scripts/drupal_json.rb | 2 ++ script/import_scripts/drupal_qa.rb | 2 ++ script/import_scripts/fluxbb.rb | 2 ++ script/import_scripts/friendsmegplus.rb | 2 ++ script/import_scripts/getsatisfaction.rb | 2 ++ script/import_scripts/google_groups.rb | 1 + script/import_scripts/ipboard.rb | 2 ++ script/import_scripts/ipboard3.rb | 2 ++ script/import_scripts/jive.rb | 2 ++ script/import_scripts/jive_api.rb | 2 ++ script/import_scripts/json_generic.rb | 2 ++ script/import_scripts/kunena.rb | 2 ++ script/import_scripts/kunena3.rb | 2 ++ script/import_scripts/lithium.rb | 2 ++ script/import_scripts/mbox.rb | 2 ++ script/import_scripts/mbox/importer.rb | 2 ++ script/import_scripts/mbox/support/database.rb | 2 ++ script/import_scripts/mbox/support/indexer.rb | 2 ++ script/import_scripts/mbox/support/settings.rb | 2 ++ script/import_scripts/modx.rb | 2 ++ script/import_scripts/muut.rb | 2 ++ script/import_scripts/mybb.rb | 2 ++ script/import_scripts/mylittleforum.rb | 2 ++ script/import_scripts/nabble.rb | 2 ++ script/import_scripts/ning.rb | 2 ++ script/import_scripts/nodebb/nodebb.rb | 2 ++ script/import_scripts/nodebb/redis.rb | 2 ++ script/import_scripts/phorum.rb | 2 ++ script/import_scripts/phpbb3.rb | 2 ++ script/import_scripts/phpbb3/database/database.rb | 2 ++ .../import_scripts/phpbb3/database/database_3_0.rb | 2 ++ .../import_scripts/phpbb3/database/database_3_1.rb | 2 ++ .../phpbb3/database/database_base.rb | 2 ++ script/import_scripts/phpbb3/importer.rb | 2 ++ .../phpbb3/importers/attachment_importer.rb | 2 ++ .../phpbb3/importers/avatar_importer.rb | 2 ++ .../phpbb3/importers/bookmark_importer.rb | 2 ++ .../phpbb3/importers/category_importer.rb | 2 ++ .../phpbb3/importers/importer_factory.rb | 2 ++ .../phpbb3/importers/message_importer.rb | 2 ++ .../phpbb3/importers/permalink_importer.rb | 2 ++ .../phpbb3/importers/poll_importer.rb | 2 ++ .../phpbb3/importers/post_importer.rb | 2 ++ .../phpbb3/importers/user_importer.rb | 2 ++ script/import_scripts/phpbb3/support/constants.rb | 2 ++ script/import_scripts/phpbb3/support/settings.rb | 2 ++ .../phpbb3/support/smiley_processor.rb | 2 ++ .../phpbb3/support/text_processor.rb | 2 ++ script/import_scripts/punbb.rb | 2 ++ script/import_scripts/quandora/export.rb | 2 ++ script/import_scripts/quandora/import.rb | 2 ++ script/import_scripts/quandora/quandora_api.rb | 2 ++ .../import_scripts/quandora/quandora_question.rb | 2 ++ script/import_scripts/quandora/test/test_data.rb | 1 + .../quandora/test/test_quandora_api.rb | 2 ++ .../quandora/test/test_quandora_question.rb | 2 ++ script/import_scripts/question2answer.rb | 2 ++ script/import_scripts/sfn.rb | 2 ++ script/import_scripts/simplepress.rb | 2 ++ script/import_scripts/smf1.rb | 2 ++ script/import_scripts/smf2.rb | 2 ++ script/import_scripts/socialcast/create_title.rb | 2 ++ script/import_scripts/socialcast/export.rb | 2 ++ script/import_scripts/socialcast/import.rb | 2 ++ script/import_scripts/socialcast/socialcast_api.rb | 2 ++ .../socialcast/socialcast_message.rb | 2 ++ .../import_scripts/socialcast/socialcast_user.rb | 2 ++ .../socialcast/test/test_create_title.rb | 2 ++ script/import_scripts/socialcast/test/test_data.rb | 2 ++ .../socialcast/test/test_socialcast_api.rb | 2 ++ script/import_scripts/socialcast/title.rb | 2 ++ script/import_scripts/sourceforge.rb | 2 ++ script/import_scripts/stack_overflow.rb | 2 ++ .../support/convert_mysql_xml_to_mysql.rb | 2 ++ script/import_scripts/telligent.rb | 2 ++ script/import_scripts/vanilla.rb | 2 ++ script/import_scripts/vanilla_mysql.rb | 2 ++ script/import_scripts/vbulletin.rb | 2 ++ script/import_scripts/vbulletin5.rb | 2 ++ script/import_scripts/xenforo.rb | 2 ++ script/import_scripts/yahoogroup.rb | 2 ++ script/import_scripts/zendesk.rb | 2 ++ script/import_scripts/zendesk_api.rb | 2 ++ script/import_scripts/zoho.rb | 1 + script/measure.rb | 2 ++ script/memory-analysis | 1 + script/memstats.rb | 2 ++ script/micro_bench.rb | 2 ++ script/mwrap_sidekiq | 2 ++ script/plugin-translations.rb | 2 ++ script/profile_db_generator.rb | 2 ++ script/pull_translations.rb | 1 + script/push_translations.rb | 1 + script/rails | 2 ++ script/redis_memory.rb | 2 ++ script/require_profiler.rb | 2 ++ script/test_email_settings.rb | 1 + script/test_hbs_compiler.rb | 2 ++ script/test_mem.rb | 2 ++ script/test_pretty_text.rb | 2 ++ script/theme-watcher | 1 + script/user_simulator.rb | 2 ++ script/version_bump.rb | 2 ++ spec/components/pretty_text_spec.rb | 2 +- spec/components/site_icon_manager_spec.rb | 2 ++ 2201 files changed, 4482 insertions(+), 90 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9d2e219e3c..5c99bdcc02 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 89595137b6..424d53b965 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 b8f8423035..72c02d7c78 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 deb79382fc..b15625eb0a 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 7a7f9ee44b..dc7fdf2ecf 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 3408239865..03336bdc00 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 649ebec804..f8baa5dc39 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 82e7b68b27..10680b9ece 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 75e9701577..9ede2f7c8f 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 c8a328000d..8281655910 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 31727d0f26..8045f20d1e 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 b00978f525..4b04249059 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 9067fa9e8c..8df6c9dd14 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 8143d099f7..fe99dd706a 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 014a3844aa..b09eeccf2f 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 59f7742522..ac3b1b8b98 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 cc2e2d9d27..e730fbfe3f 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 280121e9c8..1836df6b54 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 3a894e1e2b..546d7974f1 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 fe235bff20..65e60629f7 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 46ad493da8..f51d60d317 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 042f5bcf2c..5b4a4cb2b5 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 1139560a6b..26fa6a5113 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 4b77c5d075..f4235e8653 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 d92e8b1927..94ec89be68 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 3be2ea24c9..534732d1d5 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 b77b56c5f4..f5aa0c979c 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 f4f43ffcea..f5c82ea3c1 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 b4f8036463..3ff059c299 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 4bbb85a406..b08d7f23ae 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 c34c143a5b..5b932484e7 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 f5cb462ba4..0f54f282b7 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 26e879b109..97d91a4d3e 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 50456602da..8a0ce35fd2 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 cd5a7ef09e..95f62c862a 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 43def37185..6f70e769b9 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 7f24d0fb95..0e82707e36 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 1199710e22..759e334d4f 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 4c951e84b6..225c383d6c 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 d55053630a..1f0e59ef06 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 5683724cca..580047adc4 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 0fb1694ac5..7a632eb8f6 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 31ba189e3b..583ba86fe8 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 977537cd00..4fa1db159c 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 1fcde9ec11..c17c4329a2 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 41db5922a6..17fcccdbe6 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 50d715933b..2ec11b39c8 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 9ca5ac84cc..03990e8a5f 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 f093342c77..02fdabe65a 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 65efdc7908..260979614e 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 e1bdf163df..642c40dd4e 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 f36249dbe7..e652fb4ce2 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 45e4abab31..5f469c7450 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 8f7d340b06..0b0a75b39d 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 d3ef8d2b9e..02207905cd 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 6f4b5f5b8f..f042d0a634 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 e9e1c1f4f8..6d66579fa1 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 77e31a100f..76a93ebf59 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 1502270235..6e12b367da 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 52594e2772..4bc982d9c0 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 e6249cb4d4..b2a5809505 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 c2f4f3a19c..8c1ed8d2de 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 0276e6f72a..7d6d37d2a3 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 d2b9285c67..5569841838 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 364c3e58dc..aa25b78ec9 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 d0ee16587c..f0677769c4 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 4c9bfc2a7f..bd381bd1ae 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 306badc48a..573f787bb2 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 220a75b5cf..d2aec7a29a 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 1e8ca6be39..d970991ff0 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 a66528dcee..2745ce4da2 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 ab80568668..a30addfd32 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 8a61bfa825..cac63e64e5 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 276f990650..fe306f65ff 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 7c4b9694a1..f96b046d0a 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 1b60096e39..6693ab6eb9 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 3caadf17b4..53d4cc2871 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 6a1bd810c0..02bff441fb 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 1bfa774f14..77c44055cc 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 6e37098d2d..5ce539b47d 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 620f1fe94c..9687138eca 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 3115f59e1f..9db2fa5b9b 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 9839401f9e..d99129b75e 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 b50b923bb8..48306aee5b 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 575635f13a..a5cea9c8b1 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 a5df165a0a..b34e3f1c2b 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 a8c1482460..30d176e231 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 284557ee55..def68e4e64 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 69614a8827..c99a87656d 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 226a863023..070c16056a 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 5634db3bec..a8de7b4c69 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 4101aed0dc..f683834e65 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 205584d7a3..4d3c48c913 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 397ad1b6c4..80fc0f1d27 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 11a00fe35e..8c62bdbfc1 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 522ba9c0da..1029edc916 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 0f8d97918a..206b5bc41f 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 c9516e3655..a60b1d6315 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 b141c890ff..bec4d8d62f 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 b2ae816fb9..13cc3b0670 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 39d9ececf8..1b3b5d6a75 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 ef8bcc6469..7a9eb93361 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 259dfe9702..ad01a2832b 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 e9f256d9b5..a296880f33 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 4f7a2201e7..25d49a1b7b 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 72997c1613..8986aeb896 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 6d08826dfc..e8da50f94d 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 9d94b8e88f..a9d2f71040 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 38bcd3a1ea..e5d3366031 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 104793f9bd..63df91a50f 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 9c5862e220..4d92e402bc 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 756cb26d04..90af80415d 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 9cbdddd810..a4c9c98b2a 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 b7bf3e7501..0cf43669a3 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 dbebf60962..d525ea62c3 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 3a6d6068e8..90c855fd3f 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 2b53ffb49c..9335b6e34a 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 0fe070b801..35695d10a8 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 9302dc6bc1..886e604361 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 08b868cddb..31f00df707 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 f4e2193754..e8176316b1 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 0d489c221e..d37fdcfd79 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 54abf0a110..edf3cceee8 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 01bb21270b..aa9e4711c1 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 f9327567c6..62c67575c1 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 27fcaa76c6..f68902ec2b 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 2ad08e35b5..7592c7244b 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 bfb23f568c..9b07166862 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 be5f683986..d87baf0e27 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 43b2d9cd8f..73c31347c7 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 43414db9d1..554c7425c1 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 3b06760980..5160fd7dff 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 34cc5e7165..6deaef171b 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 76aa5dbc9c..6474618d76 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 702fb4f6c3..8ab797d7c5 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 09c2dd0dba..0db080ce80 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 4ab0df26f7..009a6b3792 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 f3af9bce43..c37cf44215 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 6f9d01bed3..50230a380b 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 9916bab8e7..e12af831fe 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 110fef1c7a..8bed238b54 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 ad3d36d027..4e16d4eb6a 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 4b09bb3152..4c28b95947 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 81acb4f8af..d29b410dbb 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 d6b3afa4d2..c2eea3e3ad 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 fb8447d825..be51110dd0 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 713f5d87bf..7e26fdd8c6 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 fd8a724568..e76c4b6c30 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 965acb963b..3a16d626d6 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 e580601eea..dbf8fdfbca 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 9d5d4e248c..5c41ebf866 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 226ac1934d..364343d043 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 355e2465cb..9eb072da76 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 3eb9f002d7..80fbc4e7e8 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 ac4b6a8df7..a2f15d32bc 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 bb3412fc2d..96e631d066 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 eb7a43ab1b..d047bc8361 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 d2d1460a48..5b63e11fd4 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 9de009a752..30dae8695a 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 ff894ca6bc..8dc0fe439b 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 e993c0b3a7..795018c57f 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 67ea356d3b..a26151b073 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 3791ad3f4c..dae3b06a56 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 592dc6b840..706fc2e697 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 150dec1355..6fdf60fa17 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 36eae21607..3c36f329c6 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 1ae2a0866a..998acf1db5 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 b9f6c2e193..5151bec780 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 23d5275644..7217608ef4 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 78d8a8af95..bf498ad645 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 a9d9b915a7..ccddc6d582 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 030e8eb21e..44843a67e3 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 8bd992f6e8..31f8b1547a 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 2d589cbcb3..0d009d2fee 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 5fbf5d548a..40dc386f8d 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 47b62d6285..b7c4fc212d 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 b4e0fafa26..083f9b8b36 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 667d165bfa..8352aa105a 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 bc2a306a94..f42fdc4967 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 e308b079e9..a520061ebd 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 bd3bc2e04a..0f04764197 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 4fff997ef8..6ce5299255 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 a9b4e4d5d3..f535f5b450 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 606a13390b..70f6b99473 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 ad4f1b20d4..292327a8b6 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 2367ae5e8a..a6ff2e3a6b 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 d973e9a0be..42e5365d41 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 905795d921..26cc43afff 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 49bf17075c..8624b7ea48 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 8cb291d9ed..ee7819240c 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 ea28067454..90311bbad2 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 93147d6c88..523be14b2f 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 139e572171..e41cf8577b 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 98a7887894..e8db948ca6 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 9afd19d119..d529fad062 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 4f0b6d6ce0..de9f4e8cb6 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 3ed7469db0..4158e2e7a2 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 91094a192e..a091c3032b 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 a14db0bbad..fe55007195 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 101a082ef7..c1b8a8cb24 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 b050d9b5f4..c84122e0a2 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 78b73f7b7a..fbe8929d04 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 5516c71045..6d4683ccd5 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 01e2156b50..f0d3608889 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 30a3ec7039..a0b4c6597c 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 85bedc6781..bf11df2900 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 d607b96cd9..12c1414ef4 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 7567660a42..54f47578b3 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 d232f87c3d..9bf10f93c0 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 231c318829..370165d4b2 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 312bce1285..56497f1ab5 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 06e872e21c..abf360b66a 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 4bb8c5b7ba..53704bcaac 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 9879872055..c693822e3b 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 802379dff0..90f6a340f6 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 b2e9129811..a33cf3c34c 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 f494638da1..2bd9613c59 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 4a2c747126..e24ec87587 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 a941a9302e..4259a95241 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 c609894fd5..94c343f4c2 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 51b08d379d..c52bb97d4b 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 d76b9f32f9..52905e2bf3 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 4f7679d4bf..a546db497b 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 1eb47e7222..fe291f0614 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 df371b79a3..79157dc23e 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 2821f9abf6..f91b98c4d8 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 d8ea40d2fb..0b13cb6a51 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 1b16c4dc11..a9eba9e9e5 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 53392ccd75..9bd1e16901 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 dad4dbd448..4c12dffc17 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 126eeadcef..783c6829b4 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 a5926a2c9f..0d26081628 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 a54a17cd61..915ddd1a38 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 4d2bfddba3..92da9f0087 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 b3a8a68bf0..f6a48199ed 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 b40ff6e0eb..3659d81ce6 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 86482f687d..a8a09731a1 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 33b5426edf..561b562583 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 4fdcef66e3..b95c78f1c4 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 b1d6e91edd..80ae709f58 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 60b8293cff..ac4b9d6f0a 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 289846a6b9..988d00e910 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 aef63075fa..9ffb283b18 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 ca7a8ec850..a0cbb3f31e 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 5bb50132ad..2d8bfb3d74 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 c2bfc7bdae..d159838090 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 bb2286ac0c..60be25ddca 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 507d13e384..1e21409c31 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 c262539b96..06e64ad65f 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 f16e37e41c..5f2b1410a1 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 5a87b68fe0..974f09e8bf 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 c281f87f06..7ce4d0dc78 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 51e0c4ae8d..2822859b65 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 ac37eb6945..f87cada6c0 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 867c8fb250..3c3b09cd40 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 8f2d807fbd..8e61329b93 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 d10f180d90..fb7ad83126 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 233a80802c..0b05f437a1 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 d93a73b900..e997083019 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 7fcf82f785..4e38d755f0 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 8e91315bd1..cbe1554387 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 0860d60f92..d353e30637 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 51c50dc49c..8659809226 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 09fc8f2a4e..ed01ecff8e 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 67e160d794..1d88fa9b2f 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 150c2a7b20..22968ab31a 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 0aa7bed3c2..1caf0de765 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 aa9f4b0e7a..8a9d3c9236 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 aba24eb5d5..db0958303a 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 e2dee40092..d0cc1be913 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 00d4bad049..e0cdd31567 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 084c8dc6da..8a3b914bae 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 9629e8402c..eeb5520fcc 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 9778e84be3..b9f9e7bfeb 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 3e368736a2..a3eccdf11c 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 8ea894cc75..26bc096ca1 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 7d592b7362..673c88432a 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 84ce201cea..545eeba5f2 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 bba8538097..3b67a41858 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 db3261aeda..632dc45b0e 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 fcc3759b0c..8437e0a307 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 8e776f33ab..ca088c0cb1 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 ccc2974237..e5483ce360 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 a630b13578..da9e1f0d10 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 729ad8b82a..1715a57585 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 302f0493d1..6cc3295335 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 338cf75575..83583824a6 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 009f07446d..b8c94b4f4f 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 3cef10dd73..9d4d4ddb0e 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 57aafb4193..706fcceab9 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 7d4a1c2610..456cbfbc42 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 a0810b03a2..e298fd316d 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 07fac926d7..ced37023d7 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 e985deb2b1..aa73e0e5dd 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 8a852dd1cd..d595eea04d 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 a6de05f32a..d791a65903 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 343ac5cf65..f4f0f8dfca 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 d2ac28ffcd..404876aa2a 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 837402633e..fdd0f9ba8e 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 ce80b21bff..97cd194208 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 79fcff8b41..063dbf4e20 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 33f009af57..80cdf1c882 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 ae3c02d3cc..5f3d7f1abe 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 ea0161de82..3d7d4881bc 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 1ba464105d..4be90200cd 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 ccc091a8b6..e2a944f877 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 60ffd7f26c..03160cddaa 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 296c7c066f..97e444a984 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 5b27d0cf71..ed9f217caa 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 12ce7377c5..cdedc8819c 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 768c7325d0..1f5b287f4d 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 6b3799a554..c6c28026ee 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 3626141d53..ed8dd6dc00 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 d9bb1c05db..c9f56fe923 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 383cf4886b..df85b4c764 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 32b3c50cca..bf79a2a16e 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 92c1702b14..121db590aa 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 a194ea1f64..a9540320f1 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 4f133f01e4..44b3cc4baf 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 c43219749c..56fbed2ac5 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 c33449cc22..72792524aa 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 f4cba4f044..37654e6753 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 b82eceaac6..996f18a66a 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 b91f50765a..d4961eb865 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 7a873a505d..8adc69b116 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 9de208b538..e2b684666f 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 ea7ece7327..f13780e101 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 eac55ae523..85f273cc70 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 0367e5638b..1c012d8452 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 7a7111f3dd..ad07877ac8 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 c15f71c884..86d78030d2 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 ffbaa4f4a6..f4f023bc3b 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 2a98071c3f..f4728e1f58 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 52403b4d22..44fee1fc0c 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 0b26e91ceb..65bab0543c 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 6fc7512424..8c4a98f13a 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 6ccb593cde..99bbed46b4 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 0241089b16..682fa4f4dc 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 885b37b7f1..dc48d82405 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 37f7ea3176..bc21b6685c 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 cfb5dcec77..ba74b8042d 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 08b50337ae..a00b7894f0 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 4619e33dce..4016ba8982 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 55e1cf9ae9..bf5b10e98d 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 900fbd3e1a..3c374b3b0e 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 4d24f782ce..be303d9f9e 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 51ecdcd8b9..0317599687 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 029740d71e..564ff198d0 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 0531557325..79dcc04147 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 f41b3aa98d..16b4411c7c 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 d178d84e32..9e7995954f 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 d805ba138f..232d1f4b92 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 98d2dbfa70..8a9ebe83d2 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 d5c9ebf298..7f361ef338 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 befb4420cb..2049e28857 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 a818215ff8..6b8abf84e2 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 4175cd1dab..623703fb1c 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 90fcb92ce5..f32130dc05 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 cae4284f8a..b8978678f3 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 6994ae0f12..7fd181afa0 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 123da140b0..1cc0f17e3e 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 85b9173e07..e320c42794 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 bd67590e19..403304e9ef 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 9fdc841071..753d4f0746 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 65891e67a8..b1b91ad175 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 5252be5055..7c8a0dc778 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 a14f59804d..065b6cb57d 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 9e38b032b2..472c0117bc 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 c31adbe301..30fb48c988 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 c3d9da9b45..0b244b596b 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 e8c8f0d97c..bbbd3a626c 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 ae23fe2a71..5c00228f8e 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 9159d86de0..1c0eebc5f7 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 11084d58bd..2255452a29 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 1d3af75f4a..0063e2458a 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 7cc4b0d265..31b8776ef8 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 9f195d4a90..5d892d3192 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 a0dec7f12f..316d898fba 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 29729e622e..e4d89e5118 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 47e6e949db..a5bbaec497 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 b0774b93f7..c628524238 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 9fdac77dcb..0369c3b0e2 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 417a5f3590..bba3feaac7 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 a37944eb8e..622a6d6658 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 88201bbdca..19c4d2e1e5 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 04682a6ea1..90c5e152f0 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 86dc666d91..2feec4bd2a 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 b25fc51fa2..ee0b021909 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 4e77af16d4..375832614d 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 124a487f9e..3771b80a79 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 3bc5610e27..55fa5df46a 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 90ba02e1be..881921d36c 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 01d8678fbc..fcfbf338d9 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 b0697fa30d..dc0164ebb1 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 f906fb83e6..447a346721 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 cfb6844577..b34fd5fbef 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 516483aae4..93ba1f2bca 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 220473a71e..70159f9d37 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 302a26452b..fad4c9b1ad 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 0036222628..33933779c8 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 8b38756ec5..1314bf99a7 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 670bc20805..d5ee5e5d63 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 4bb981d226..cc497d1a84 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 ef80dbc5e3..d0ce8dacf0 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 e539bb90f6..ba5767084e 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 5258eac263..bf551fe63e 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 7b442423b2..3cd3c7fda3 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 d6896c6502..52f63070c7 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 a45c7e1c36..cdd0cc4a2d 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 6caaff82d4..452fb709f3 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 5aae90f778..69cedff134 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 46d43c3755..2bcc6beb1c 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 d461eb31e6..51ecfa15cc 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 32eef2d58c..0975099581 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 5fa5b2cefc..a8bc292c80 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 115570c209..7a37bef900 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 22edeebad0..60943b393c 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 28dbba8d0c..c6213a164e 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 8a7125340d..5b83e66f5f 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 9fbb9aa98a..60edba453c 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 5cd047be2e..3d205f1d62 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 7b85690508..0690a582ac 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 49d46ce039..2795de8266 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 ad48613fe9..a7d887c747 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 7f5ee933cb..308d2d5205 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 545a29bb8f..6a32afcc58 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 6e155dde28..7db7e2639e 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 bd84eaadbb..d660fa53d3 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 0895d2c0b7..dbd6c52862 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 6c2c604042..7a51c2c860 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 b20c9ad280..55618aee4f 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 8d17e9cb70..3b585805a7 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 ddb3c6af89..b5baafda83 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 bbac402405..e915a7c6e2 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 bd68c4c037..4b0f858830 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 3b383d6b3c..0fb77e5f63 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 fca7a28967..8b3729f1fb 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 1438386385..4884b84377 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 65dcc6236a..1fcbd0ed56 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 a441255342..8a2d53ec7c 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 2c37510d75..7beaf1e537 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 188a04ef15..934b0ef48c 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 9cdfc36030..7cf837e3b8 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 3bf7ec71b2..13ab947ca0 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 6864b57179..ef8d37b0b7 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 98855b585e..8881f2aa3b 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 ce61e991fa..87a6caea82 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 7ad41b95ea..7388751976 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 8b7f68597d..4d7af5149d 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 ee839ac868..3243b093d7 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 6fe21eae7b..ca08bc6747 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 612406ac0e..b11bff2994 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 3e6ea7c423..1f2e9b9799 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 73a3f66116..959dfb011d 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 2c0048e036..fb61f95b10 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 17bbb29e07..c9cf902bb7 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 2ab764f161..9e7ac9cc60 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 fe0dce46d0..297c11776f 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 ebcac25650..af78559b6a 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 4f57896d90..15f354ef5a 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 eedf6fd464..b2ea3edeee 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 e0ad2abcfc..abe0d13773 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 0a670091ed..d0e36bd9e5 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 b115071496..3b8fc0e323 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 4bc1db5f5a..497f472ffe 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 d9156edcaa..e670cd767f 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 97d587ba81..fed45ea732 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 14ff724883..579bdd7872 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 bd67cac7f3..cf3134188b 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 2fe1bb757d..bb807269b8 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 29c42994d9..95abe6277f 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 2b89a1a005..469b1195f3 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 82310b7bd9..404e3d9425 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 f4cada5708..1ccab21a15 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 79abba78c0..0f8b1b0f92 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 85c013a4b9..81e58b3d9e 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 3f7929b328..d75ef6e1c9 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 278315a284..a8a87fc58a 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 417eab26c2..abf681437c 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 f413dfb8ca..afd1c60f70 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 084a391660..e2dcce3604 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 3b40272470..0d61d5d790 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 bcc75f776e..564236878a 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 5e2cf2c23c..782925e99c 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 5add50db59..510f23b5e6 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 c7eaa38482..ca979f82d8 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 173b417d46..568ac1255a 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 60187e4cd3..1d9d355299 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 d7b3296a81..275108bae9 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 e3e7e5d4c4..aa3e46a65f 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 72ab9885cf..c2a09db8ea 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 3e99c06cf2..fdc0e796ad 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 bbdee26f6c..7c5237f97f 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 1e3470e2b7..f0fe239309 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 28f96a3da5..58841188b0 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 4cb432d86c..a5d88a0c19 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 43f7d90e25..78b921a1a9 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 20bad77d00..ad2501a64d 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 91c52562df..ec84bac004 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 a81430b22c..80187cabb6 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 415d9b7bf6..320e525a0e 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 e6f38e8698..42b2c32daf 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 52399d3588..1d19f0d18b 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 8b4897ba51..2744d19a31 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 1d51c9fc8b..c06b715142 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 9ab4189535..dcb546d8db 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 c17520490e..2e45b03415 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 bf6bcf4df0..a4390b7e3e 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 f29c365a46..0679e1ac4b 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 d7c703e0fe..51fc0b8328 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 eabaee1109..6b950ffa0f 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 f21802cfbd..29584bb8a6 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 5a69f23fbc..308535bfb6 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 4fda1153e3..967232339e 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 2772e08c4f..f1440c1e9d 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 43f7fbc062..4b79988877 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 c57bb8c30a..9e2a4a1ff7 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 b6dac30214..15d2436cc7 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 fc48024cf0..f2a04db807 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 68959ebb1f..420951bb8b 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 006ea9c330..54830995a1 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 4180eda4ee..26b5c1794f 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 3c1cb69d3c..f793871f49 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 c7938f5d63..0d4208c5bf 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 39da1ecfe2..3031348da7 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 960b65f91e..34780b86a6 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 94f5722ee0..d5b49772a1 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 467e07c586..89189100c4 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 ecb9d6ecff..f6aec43499 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 7a63768f00..c1413c4045 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 7f0cc6322b..e7f9f00415 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 4278f52dad..415999e8e9 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 ea40b60505..2221359aaf 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 efe69a9285..794b1bffb4 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 a7bee3708e..a415d22583 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 c9f7130e4e..b46d389f8a 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 4b5f25550b..a0e51ab133 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 6942ccd0f5..6fd1f889ac 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 ecce2fae47..45875ac2bd 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 026289ed6c..cccd746b36 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 d31d0fccda..6f3248f086 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 d169b69c59..df66dbdfea 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 d4e8c8111c..9a0e28c72e 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 afd937ecaa..16733219ce 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 d48964a40f..e0a7695eb1 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 a6e97f7d26..fa29213ff3 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 9917bd15fd..45ea585c80 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 f5180d8f76..d5e54257dc 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 1bb877e96d..9320e75121 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 1836e8da06..8969f472a3 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 64b83ce23b..96e5573149 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 5925da73a1..70e0d7fa03 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 5e3345478e..8785d0c59d 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 44d28af23d..bb38bd9093 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 54e9922d58..f833e0b5fd 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 6768ae10be..7c071349fa 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 9191a2e434..81f70e0694 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 7664e855d1..0759dac792 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 bf4d4bae8e..9104e53ad1 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 29640c13d0..faf1322ff6 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 9e6e067e90..68d6ec7374 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 d55f667814..bf33523a35 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 58d3046be3..1b08914efd 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 f0e3c1e4c3..0b7af1e2c4 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 9527f6f8c7..50e1af393d 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 ea887cb4a8..a9830f5df9 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 a2dcdef6b1..f2ad535fbb 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 e17a4a773f..9fca424b0f 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 cdfec08ef6..3fa051bfa9 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 5169ea1a65..696eb3c037 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 645285de28..fce406ef25 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 1bd892f755..316a403f04 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 b1ad8967b5..93a3718b8a 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 464bc58d2a..195f92217d 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 ac06bf1f3b..d31ab6e89a 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 4caa98a698..6532f4918d 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 4ef9afc65b..d3d3fb686c 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 1f77b45d75..658df93614 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 6ee27854ca..2766f9c30b 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 568f9b6eab..c07fc479e5 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 70cac7fa57..8baae1e4d4 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 9d182b9121..41c4b7ba80 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 75867d785d..1c736edc0e 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 f023863bfb..b200ca82e3 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 fd4697a382..c80ba6dece 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 4fbd733051..8afcac3e9f 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 48ffd7d4bc..abcfdb8af8 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 0abd713e64..d7274d5a4b 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 371619ccc0..6f5a726830 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 b2ce92a458..c41495ff3e 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 5aeee2261f..95fd83cf5e 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 2aec75ceed..a218ae8366 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 220d9aa477..0a676f8c7c 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 b033ac66a5..2fac32872a 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 3c73951748..5ff905714d 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 178438b177..189e5f6a9d 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 22aef424fe..0da8f956f4 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 f73d3e424b..be3f26c97d 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 3d7fc0d1f8..500cc6794f 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 57a8dede49..646ae4a986 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 9eb8cbc96c..a093c836e9 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 c2c104ea38..d05ef817c7 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 015ff94a29..c43f91076f 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 16fba3ea50..d51f43e68f 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 ffa46da512..a99bfc07a2 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 57b979e0ce..b7fd7ba79c 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 895a7b82c6..ae2bf85754 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 66264abcaf..d1947c2d84 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 2a9aa564e1..d2b173485a 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 1aa71ccfd1..5c47ead356 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 183e4cb66b..4fd63a8abe 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 4c9d641d32..3886254023 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 72e5b07baa..cc937556f7 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 87456601ee..d830ad7325 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 bb792a2f7e..d067e5eb81 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 a5fef713d1..ae7569f359 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 44a1766e88..b2f302f954 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 36776ead7c..e76f3d6f36 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 aa5c8c86bd..f7c8a64123 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 bcd5e56908..01620a72b5 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 92dd565098..96f6139683 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 4e5a55f99a..0bc9a9005c 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 93aee6122f..2bd365b643 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 ab2421d4b9..40e044105d 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 3e3fd46fbb..22077eaedb 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 a71b68bcdb..f9d67620fb 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 5ce235f2f2..45ed22688c 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 447324011a..82d65196d6 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 a484c91be1..b7a1087b46 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 224ec20c0d..8cbb4cfc57 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 3486e3a0e2..accebe1e34 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 d7fd26cdc5..c67636904c 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 1f33fca222..7090abbaf0 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 09c6f2e895..8c7489d8c2 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 8dffa3323d..bc24369718 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 0ffb32e7e7..018303af0b 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 23e9ef50ff..db284b5dc8 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 7adc19fef8..fa80f04085 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 d65fba83c2..49672b04ff 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 a5bef8ba05..fbc560dec0 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 b53c5de8b9..c2361f6a5d 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 900ffbb8b0..9ef3394d80 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 b192aa24aa..25bf412625 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 9e452cdf7d..014d65aa5d 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 bffeb66afd..38983b34f5 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 70ce9caabb..287360ef68 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 8da0748d04..e724e2bca2 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 3f91811f07..0b95f12d2a 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 0503493b05..e9c9f44d0c 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 20614d23a7..762f56cd54 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 66e9889e8b..58115ecf30 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 5481cad3fe..cdc2c4c16b 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 febc865cbd..61c75ed85a 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 0c86b5c6fa..c36691f7dd 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 a425691870..cff2163997 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 3c73b82bb1..82fc7c365d 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 fdf031f52f..df26be14a6 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 42d9caa9fc..c43d53772f 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 bee2a43287..ce160dc5e1 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 94a96f1084..eb62346400 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 fd344fab4c..7e12294824 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 e29421d57e..d09ddcd1b3 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 e140ec56fb..da7b6f2ef3 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 35f8713b8b..15bbb7de06 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 acff3e26d9..ca0c06d8a8 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 e92fb9320c..61bd490bd0 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 d5d4f76d80..255652ba20 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 fd87e9c645..a7be88c294 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 3ad639ffde..7d2ab966ce 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 033db48f61..b783774c34 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 d5c425980d..62bd1985ac 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 7620cb3d8f..b1f47d963a 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 0e58b14b8c..6acc285642 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 275272fad1..7e50904fa8 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 a0fce3853c..72bda38b07 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 3f1c2f9c64..5df4c8df03 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 32ab36b4cb..cfade5b7cc 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 49259ed2e6..9720c1e7d8 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 0185fbd742..a3bdb5d3b2 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 9c47f36712..32bca43206 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 9d020433c1..96f1456b64 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 e26f45976d..cff95339b8 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 a326b2060d..d714de498d 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 50af0b12db..c651b890fa 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 5f34bca191..4e51c78a90 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 55ba15ddf6..c6bd15fad9 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 50f580c388..2e0461664e 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 e4106607c2..ad8e1798b9 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 a9507c5796..3455a1220f 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 ab4077023f..1827f6e552 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 b25cb6dd4b..068cdb7e43 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 9952c8b36e..38fdbef5aa 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 ddc8cf3b6b..1dbf131e87 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 2d91431db6..4d2d986cd1 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 40ed81bb34..292bf54bd3 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 999df20181..85b2d84061 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 ef0624ab83..de1ab4fb27 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 dd58419e15..1026912c49 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 c3e6acf170..54a46b58c6 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 85f38250ec..e237b06d20 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 d3868db2d0..0b42f7fba1 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 4e5ef1d97d..68b1b41a33 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 6ba41e42f8..e6e2d616b4 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 ece7fc1935..17c3256e97 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 5969a2e2a8..5188adc6cb 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 319bb30797..f3ed480842 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 0de7006001..21350f5566 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 0831e83711..c22ede24e7 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 2cdec2b416..6aff12fe63 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 12c189da11..211a972f17 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 cbe6a32344..4f3d2d15df 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 add1413181..b0484fd444 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 2b3097f8b2..b36012ea7a 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 3146ba4397..060969b72e 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 340f4506ed..23cc993a27 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 98e0ef84dd..7086f6b1cd 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 73c8f88727..13c8b53c8e 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 927b7d1e04..55e6abf22b 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 a0f4f2c597..44ac1e2697 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 f67d93f29d..3dd129cd94 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 9a1ae7a448..1841ced71a 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 ef88af4c10..82ea51d6e7 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 70e8f2c4e6..4246a6ee7e 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 0656d31537..d89c7030b5 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 5075787608..8e97ceff7f 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 832f66a307..632daeabbc 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 0e99e03e16..2d1042663c 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 fd3f1b292b..57f5760922 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 43df8bdf6a..e88c4ee0ca 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 8da0ee50fe..df785acda5 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 9b8ca2d8e8..1f10250ea7 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 730c275c1f..364592430f 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 6ff53461a4..1dad265178 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 0eca6e0908..62f76731b3 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 aafa179b82..174e4f99d9 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 2057bc809a..131299bc1b 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 5daf04026f..8c2aba4cc9 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 a536a0da51..70630349fb 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 4be691b234..8209c8281f 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 b5f15bf458..a1644f84b6 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 8e4cc98271..be1121fd63 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 116f67eaba..a7d1e3d7e2 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 d1cc7b99ff..c17305159a 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 7c90498a5b..3b9e47b84f 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 aa201b3dd3..78da199478 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 fd5870417c..04805c10ab 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 ef47cb07e4..11832f4504 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 08f3bc7f37..0d4533e910 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 9d6c355dd0..02d7cc39b9 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 75e7588837..99655810df 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 272e96d564..2597499387 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 599c8810e4..044dcb7af7 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 35045d1951..79466c1d4e 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 f43cbf9f2d..de8b5e9962 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 042f32b92a..0ec6bf0211 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 373e800789..d43f8af8fa 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 b8b1f66e4b..49433756eb 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 33fcc00683..812d839fd4 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 4cfbf9d4ae..b8ea4a2858 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 a81441d5ad..929fb0fea5 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 4e6fd051eb..c2ff90805a 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 89b7472751..d68fbc733d 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 7a21dda8ad..6976191f42 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 20199118cb..074c80ec36 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 0d4b9c063b..372a1f3ece 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 116b111974..b6f8a320b7 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 c14c7f40c9..75b975dd7c 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 55efd8b5bb..f653cb2840 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 3a9cf51ed5..278e88f14f 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 5f9cdfa4ca..5b6fba48a8 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 ccb7f6f4e7..630cc4afae 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 9c0ae63840..eb0e386ec1 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 a442abe574..030d5bb2bd 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 ffa324c0a9..70a1ffa2e9 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 fccfd383cd..a252a11501 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 aa41ca9905..6cefef0eed 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 ca1641a5d4..9701bc9e76 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 18684044ed..6aaab73ba3 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 ddb1a98a02..2805238825 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 2aa76da9c5..d51b483651 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 286b9b9745..895a8b21f5 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 0e68b887d6..eb0795c11f 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 e0df759ebd..5a1a0ab000 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 329afb22bc..3f5ef230fd 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 d90799dc4f..d9feac5477 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 897992ce64..3008224433 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 f554de545a..2c2ef633d8 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 d904089921..b8e6070523 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 626c27897c..19e0c0e797 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 a4169738e7..355e4c42b3 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 0a6a89e741..d396aa9bef 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 d489e99b07..ee0c7182d9 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 8b253d1549..8868e76785 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 44666072a7..f079493746 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 c957404fa8..356624fddd 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 96b5ba64d2..c4531cf4b5 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 3171ec2a81..8dc0983c75 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 404350ed86..faad592120 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 376781c4fd..a9d38f6358 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 8699dab5d5..0e9ff048a0 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 4829a1f5f2..68986b1cad 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 cd922b175f..35f0242bf8 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 ab833036fb..7c30020ac0 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 f60b405ee3..0e0908a817 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 7277b4eb45..5f5fc673aa 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 c1a3069a25..c58b290110 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 c84336dc22..9819e5d31e 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 24a8019824..93c242f897 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 f489fc52e5..e13cfade6c 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 ce29c25a5a..2600244583 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 dabc172850..44a2c1189e 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 f9d2d8af87..e437e40b54 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 1759817ea3..af693f1fc1 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 5b6705e866..2518020556 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 6be0a2b8b3..051e2e9fef 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 3f565558c1..a5494ccd2c 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 4483800e4f..43958a8622 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 8b22ec5a27..90ac91d415 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 65e67011b7..0869ba2b39 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 7ddf6d405b..ffbfd6d278 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 4f3b00c168..60d904e461 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 49717c4fd9..071b0a902c 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 43bbe102d1..0b71524f63 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 5a80831a14..16de60e552 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 c2643594d4..8421b8b544 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 11f8c30748..3ba244f818 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 96217a0ad8..bc3bfdef3b 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 76cdab26a7..d259c83842 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 c97fcf195f..5a57b77214 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 297be79b76..1f41b4852e 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 fae17c5052..4eadbfbd23 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 e41805580e..27d677014e 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 f353e117c1..3c434a1a23 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 8f65f1c646..f014dd5652 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 bcd4f98b6c..2b2d4e9911 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 ae0b8bbb29..c37187cef4 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 48b8c34ad6..8f27148c11 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 6e9ae48981..d8f7954bed 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 e4377a7744..872bf935ca 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 f772013d90..0d6661a259 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 f8145e7e7f..0b9847f18d 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 1b0e739570..a6be1ecedb 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 b3d2840a22..0ec4573899 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 b82c69f252..78a1b073e7 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 3965dc4a3a..4071dee878 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 839a10bee6..25afa3cd29 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 f6a5af197c..9d04908bb8 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 b6513f9fbc..891c413315 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 e8a3e4160d..cdcba0994f 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 8975ae622f..e926ae8fbc 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 cbfeb28fd2..73b6a2011e 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 9d6662322b..1f27171727 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 01e1f7e7b1..b67027ca37 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 8b5fe68192..108e283df6 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 6ccd73d023..bb474f656d 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 9640031c92..7b72b967a3 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 915bd3cb4e..261296c6bc 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 6d6e7282d1..991c39edaa 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 8eea445eb0..ef1d8255f1 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 c3e9cc9701..7a0a822438 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 3da6834354..46096435ab 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 30071dc126..5ff307a5af 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 3b8119fffb..6fb88c85ee 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 259cdbb915..0270daec47 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 6a130d1682..994ea22d52 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 e4011c7a32..0c74808427 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 4cace300c9..5146dd922b 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 1be48658a7..6d5bfe1723 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 d6b1ccf27c..5bfa6c1fa7 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 ea27d4a310..bef20cc454 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 9f6996aa7b..9e30eb294d 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 4749188098..2fe158b607 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 bda56c09c1..891a020fd6 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 8202b725fa..a1c739d2cf 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 ae31470d98..d21c5b037e 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 206f041c60..10f2547bab 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 f4b21257a9..4bab4d6e00 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 464ffabf62..6f1128985a 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 9651bae678..4c31afb9f5 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 239a7a3851..fbd32d4a84 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 555174f261..5da9c6c826 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 46ba45daf9..394348b518 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 fa4e01b6a6..d506ebc421 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 b8cd19ba34..b9dcaad37e 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 0fc471fcfe..4c0235dafc 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 dda56432a9..f1d7b7f2f2 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 ebf1f48b13..d793092f44 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 1c6e189b14..ef3c330f1e 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 4d5dfcd4f1..48e775fb7e 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 b0882cde82..78173e3b6b 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 9339f7e25f..9cabd9c426 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 f654cb6fec..10bc0fe209 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 334566680c..35ff0e57e1 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 b98ee5aefd..fd1016a55e 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 09fef75bdb..af7bbf41c3 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 d16d54c145..3f947d4b42 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 9ba29eafd5..2154d2ac0a 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 d6409650eb..f6f26b537d 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 eb3f73e661..9b35294e0b 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 3b714744d7..f063f5e219 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 b5b5dc76c8..abdd6fd4a6 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 449dbef48c..4af6cede79 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 d99df1d52d..47d6c37d06 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 0a08581605..c180e1b74e 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 bc9c974f83..3613b9dbf5 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 44eef360dd..6c093a05fd 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 6c5910ec91..6ac3e4b929 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 56011785dc..bfba3eb4b0 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 ed6274c82c..1527dc0ec8 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 3e58b83fff..0c3363fc7e 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 076f3f557d..2709734c8e 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 8d5516f1e2..cf7257b1a4 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 24514a4720..f7b3071e6c 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 775a763e96..edcfacea25 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 1182b90191..3cca442271 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 ceee3c5d05..2191e3a376 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 8c96e4cbba..1a4c2a67c1 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 9a149136ff..1784d7785d 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 1b82f45aae..89ecc9c691 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 7da8abad4f..62aec7d531 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 cdd421f34b..88038bacb6 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 e8943b7dca..c35b865ed1 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 75c25d064a..e5a31a89ef 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 e3d54a7031..93e861cee5 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 3dca552afc..ed099d9389 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 46b3c06a57..9600bde63e 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 018c13fc72..e574da1aea 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 44fb14904d..fdd56890a0 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 989b91d77d..5f70d8cde6 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 f35acd9021..cd854b0498 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 2f2b5ec6c3..8fc2c776af 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 0dc74ac8fd..2be90129ad 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 abc798964a..d4fe57e9dd 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 67ac99527e..487c5488c3 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 5fb442d00a..e11cda60ad 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 238ddd1951..fb405a4f3a 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 a148cf76b3..410b31a070 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 ac3234fe0c..246b1cbe38 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 23a89836d5..cc0d498b29 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 cd3458e590..4e380248dd 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 36a428c87d..fb0a0c95b3 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 92827f5cd1..2c6e84cd17 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 b89f599dbf..ae1eb07f82 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 279ff2fd6a..12c42e3b24 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 dc6bbef668..82ecc90ed3 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 a83f864571..27eb25054e 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 02e3ec3afc..cc0f49fbf0 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 e04bac57aa..8d5169e1e6 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 297608e8e7..fe7322baec 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 7ab95b79bc..66a662539f 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 7bf85eea4c..8e1d3c606b 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 587739e59b..c3b5248338 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 1f3478ec4d..fc9bf4a481 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 fdedd07ae5..5b86b26447 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 26a3991c8c..f098bd1c4b 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 c3a4f26c53..7d3a258e8c 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 bfb29035ce..a1dacf74ef 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 bb522ddf71..4497c56bfe 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 e80eb8c425..d5e92685e3 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 95016198e4..0fc33cebc7 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 266a66c06d..8f3c38be93 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 809b104074..dce05c426f 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 f04de8e8b2..3998c75456 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 1e2b6f5b8c..088384b3bf 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 42564fdd60..5d868be51f 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 01fe10714c..5f5c3b75d7 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 f1a27225ac..ab49e00a12 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 d8397c3aac..ef8272a03d 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 359462c96c..cf9a9fb856 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 4f50ec4cb6..ce3ca67932 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 f2c6f787e1..86e5ed3aea 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 7c55d2c5c2..3616b47420 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 6f6af2ac27..cc4dc12fe4 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 ec4e01767d..0d6ee3e5cc 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 384cbe8631..40c6de2172 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 178a2aeced..050f57ab8f 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 10e6d49e30..40a8fab27b 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 cb63d4fa5b..69050b36f7 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 d322f05dd7..8e23906db9 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 14e9aad0ef..c47d433b0d 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 4ddab5fe07..0a7159bd9b 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 a81cadc696..e07ba606f0 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 e7f2e5471b..987cb59ef1 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 e3e7b35600..b76ef8b3f0 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 dbefeedcf7..c8b411d28e 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 cf881a2002..caf9cb0357 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 c470979e0f..6f6e5711ef 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 ad3828c7a2..75cf99d3a5 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 fce5ae1165..b002ec486f 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 db5a1b47d8..2a559646bd 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 c891fbdecc..daa78528c5 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 e9887141aa..b240feffbf 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 6518c622b6..69aaa5efca 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 d29ec19b19..daea47c31f 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 4251b122f8..2fa7d18952 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 47459b3bfc..b9aae2d469 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 b5a5490e73..f226f18b2f 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 0f11387575..f1f3560dd4 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 c26e09e0b0..f74a9037d9 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 31eb7d61cb..e6d252d998 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 8afa0a9d1e..0798b0debf 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 1cf399f4b3..c25364365c 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 13e3dcc912..1d18deaaa5 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 f52a61e8b4..ad15cd3bc9 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 7b495958de..746e7946fa 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 b11fb90b29..acd5f730c7 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 b7936b3710..9b0794e8aa 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 e6a8b92aa7..2e5c427b78 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 f66162dc29..b26e52ab5f 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 0347a3edc0..2cbc3f435a 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 f8ef7f31a3..093031ba20 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 f20ecc4545..4c0d553592 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 4212b56bca..2faa132426 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 d288ef1ec2..793da0ce64 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 20b780b9f7..4371c0efb7 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 c1db909d76..a9a0c0cfb4 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 9dfb9a2e48..5166e35fd0 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 aeb2f9bdb1..71ae6f595e 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 7f45652ed1..548a5bb359 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 21c3c74c98..14b17d10f0 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 4976d9fe58..1eed1250ea 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 c23d09f39d..e72a112373 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 d6c63755b4..dec029105e 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 838863194b..09d0a9f7e4 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 42dda2a4b0..214d83d628 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 e84ee09880..c132183996 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 777506f513..cc9d40eb34 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 1863a7bad1..b564a7326d 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 ab1ee73c0a..0e5982c3fc 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 f37240a371..838d36e92b 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 0cc684cf85..9e97b05bf1 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 ecbb4e2c37..f4e53afc99 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 6f008f8604..240d6806ce 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 1731e2cefd..aa99889163 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 f6271fc83f..c524f13c8e 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 73466e65e0..dec014381c 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 d47d852f0b..f987c701ed 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 53be7fff28..569bad298b 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 987349d345..0d0f1f8e21 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 af3be25483..298f618b97 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 4245057c82..040adc1127 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 9c3105ad8b..4a55720267 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 b49bf2b4c2..b8cab73d65 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 11fc4bfffe..2457d7f154 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 64106fdf69..9efe9ed766 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 af05478d6f..2119086cdd 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 0d5f52112f..d005c8c9e6 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 bdfc6b505f..588fb633e0 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 77caed3469..5c74a1b0d4 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 ea9a065b45..f2b4f5d560 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 2c7508d6e1..aea1bf863c 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 f139dd78df..e874818c5c 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 aa8492d397..c74353ce98 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 af127eaacb..d3a6b8f821 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 8771039c50..c3c27bb0f1 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 e5c7ddbdd3..c676407c07 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 d9a0c0d940..5ea59d402f 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 71562daba9..22458b2c45 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 d2775e2f30..1923408e48 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 5da97fe984..998c76c6cb 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 f24b2fc09f..8af4e016b2 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 78da03786e..7424d1f4b2 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 5906f36f79..92cb329f40 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 ad6f4366f8..768af14d44 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 994a5cfcee..70ef2dd780 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 007c54e165..b74a227b08 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 e18105b566..1ac33ed6d1 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 b450c55260..55f58f8097 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 720a1b5e4e..2767245165 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 1a9e3a7d0b..569cde8731 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 c510ea6173..b2dc6730bb 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 4c3d460dce..e81bd3b55c 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 040468e042..06dd335148 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 bb26815e72..5ccca851e8 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 3f810cb452..0d7dbaa522 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 54b2d39f9e..9bd08859c0 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 8840b57afe..ed1d476add 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 3164f7c2b6..e102017d0b 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 ba3bd42655..6859aeab3c 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 b03498eede..58740c407e 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 a774f94795..736ec903b9 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 064a404627..05ac418f19 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 867afaeff2..b544e15fb0 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 034bc02bf6..5e592d00fc 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 c2b3e83d12..46658266c0 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 50a4587066..b964a33095 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 b1c7b421a2..777e665a6d 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 144987cff1..0989b0539e 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 b5eef3b307..94b7b9449e 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 847aed08f1..22c5cb5f76 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 f9994f77ff..6dd4e00d80 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 c1c62db669..26500c67d8 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 9209991d13..9041635b9c 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 eebefd9611..fa2df1744d 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 ea64d6cff0..847e16a9a1 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 9b74621b4a..c6c34b6d63 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 f47798fe30..b6e0cf67df 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 b9613412bf..aae98f99b6 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 dacc0957c1..63bf28acda 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 3c918cbaed..bcf4190172 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 88d2fb9958..9548a95b1d 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 3837aae59e..535ea684a6 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 90da14223b..79d13f889e 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 5b07802707..e1306be9fd 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 8172657fb1..d3b6d6366d 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 61edee561e..e6423102ed 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 abe55353a0..c5b8e11d81 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 b6268b737a..73246a4e97 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 b3cdfcecb9..6bf9ae5b32 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 b83b1166eb..8569f61d0c 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 0453b99a21..0a288f0824 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 f48e87e2ea..8da24ac5c7 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 8cd22f963a..1d0400849c 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 1d6c54a7f3..2f749c0904 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 b1d0a4c4d9..69034f480d 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 2eb26d5ca5..f7cf9dda29 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 2fa7a5a87b..f30430e312 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 c3b98b2ded..a2c1866869 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 95bcfcf18f..4a5400031b 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 9ae5615566..d2f164a984 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 bc87c01818..4ebd79d810 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 c47ff9295d..1840b1ff07 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 cb9e1546b6..376ea948a0 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 a3a9c0e1c3..d2636aabaf 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 474c1f1ad1..48889634a8 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 05ed0c1489..b8014b0ec2 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 974e146dee..961789b92a 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 3473c1957e..245ad2a916 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 ff0747c98d..c971bb0ba2 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 af2c67365f..81a8700370 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 6acb32cd79..245f55dc14 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 d0d3bc348d..1e5a3c5e33 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 bbc47802a6..f47b35276f 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 6953eaefbc..e5f5d8d29f 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 37fc7a5cd3..dbeefd3c11 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 6b23f10974..6e4344236f 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 81b33447e6..266b46096b 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 72242258a9..2f915d0c10 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 c87ce20bbd..22210fa1a5 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 27baec0055..927bb940cc 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 a70d76a18c..8cd1dfc93f 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 d6b91ce101..8baae0b44f 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 217661eda1..916aed0939 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 1d2eb432f1..df0631443d 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 abeab5cb4b..a33e200e16 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 3ab37e7482..a8f10bae3e 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 eb95326494..611e432f71 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 b0d8be1adc..c04f43dbec 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 5bcb2be537..6035119b47 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 c8c56c2b9f..bb20a59530 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 05746115e5..900ea7de38 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 0577049d4b..343ae5b376 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 126a7d15a8..6c255cdc56 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 7cca4548ba..1377a013b9 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 afc1106a8d..4b9ba9b3c1 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 a6105c6b27..936470e3aa 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 243a0a1f3c..02187168b8 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 63ab83632e..997fb5f907 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 57423a7be9..bda337437e 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 7dc6626336..6d6093dede 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 194777d6af..54b0e85c66 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 52f3b2c1ff..5de853b8ba 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 eb1e4aa07a..496358bd45 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 864697dd82..9ef1e93ae3 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 c870924abd..ecbe8381a9 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 7f0a0501a0..daf282b341 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 3b7d915e19..128c3e810e 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 0c713b3a5c..21cba12ec4 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 1db5458234..b1ec42c26b 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 127fcc0665..def8f2b45f 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 997ae5e580..484a31c6c4 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 2d504d5401..0a1f2b6c76 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 6f58fa63a4..704b98428e 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 ebd7feacbc..99fa6f7585 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 bd67293e9a..c82137c9e6 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 bc901c40fc..bb9ec958c1 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 186b342814..7094eb5053 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 cb75675052..d21b8aaac9 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 c14e0aa16b..f7077b7e7d 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 92587ec30f..814cc219e5 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 8c8f3591ae..e3fc8e5354 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 0e2ace5603..2c4594de9d 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 853d2fbfb4..138bbea193 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 b5d795662c..b306b2c206 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 f03a1135cb..479a44d57d 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 a8c2ffff91..a92aefb97f 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 4e352ef430..b59030fe06 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 118d0812af..fd401a87b6 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 5ecb3a1488..b9ba5e8940 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 12c9b8d2d2..b47e7e17d6 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 e5288c29df..cff6d0c6e4 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 7cd54a7731..403ac1936b 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 47d7005c22..7b9f9f8d1b 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 06b4ee14b1..cf61591bcd 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 30bd513a71..bc78371f5c 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 51ac6fd4b9..c923e558b6 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 b570bfafbe..6c3e88a951 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 7df2f5ac65..e2960bcfb6 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 379058666c..0e9da1da35 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 64cb030208..b4ebbf3ca2 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 f8001b9621..3cea530254 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 8bfcd78fbe..535c64ebf2 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 8e69ed997a..81b05196b3 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 e9c6340e64..45da21d643 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 758a09bb01..51a12410c0 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 b80b3fb031..5717329e42 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 781f7f7898..b7f7cdd1e3 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 84dad56ec6..4504314fa6 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 8ec2138f9f..52ef2084c3 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 1a8faf597e..e71ff8d72e 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 2dbd56792f..91a32f4545 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 89d293e431..8126b87b37 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 c61a70b031..c44307157c 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 6e3ea6cae3..cf42009b3f 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 4810aae4c3..946aa2f59f 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 32376b4960..301354e991 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 b2488af93c..990df5b4e0 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 ab0db1a092..a8cefe0ae9 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 f0e8df2dc1..85aa7077b5 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 0ef5fba265..ab276c5158 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 b0c1aaaff5..a203bd2ea1 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 2f8d010dc5..c817c68f3b 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 3be926658a..a93ea9a90c 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 cf9d3c48c9..e17377436f 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 d30c7c66fc..04d095f66d 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 9b7e13e81d..44417b721a 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 d57665a23b..92f4a2bab8 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 469acfaca9..6cb5d88272 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 904f83308a..6013afd3fb 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 77721ab4c5..f8d0328dc4 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 488a15edf6..ffe18cb95a 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 04f2935fa4..7dc7f14b3a 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 e1f9e6dac7..0e49b69609 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 7a5056167d..751b190d1d 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 dd7670f75b..9c2797aa9f 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 f323deff07..8bf0c7c72b 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 7db1845dc4..d440121900 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 9305a8f7df..51ce16d9e9 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 f932d6761f..9f72ac0a74 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 46a297c669..0e1e981f8e 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 aefccbcb9a..f55e52b26b 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 a24df56661..5d399256c3 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 f45884fb8b..21e786665f 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 96400ade31..9b17240d9f 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 c9354e4287..2e0ecd40ec 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 af8908d02c..4ef70cbf85 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 feed479b0b..6fc6f660b9 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 37226070ab..85c3be2ab0 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 09af9701f3..6c3d3ca99c 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 7428879d91..9ca94b98f7 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 b517149708..a243156b23 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 beda159c83..3e1417f00b 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 3ea549fce3..148477286a 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 d82a97ff30..7a6b83d73a 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 2271061315..fbaf5afce6 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 e21eefe4bd..0a7a54e763 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 67c4cf185b..c614d606d1 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 940afe71a2..c308f74410 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 367c38cc85..bc79177e73 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 66c60e52a1..e61f3135ad 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 56084edaf6..4190aec352 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 044d0279cb..b677279805 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 ca0807f7ca..00b8a92cda 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 30cea9f81e..c790461f93 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 4cdc2dce11..6443e4b9b6 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 5052dd8654..894c3dad90 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 b9aace631b..f3ebbed327 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 3d3a8a84f2..acb63c8cd3 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 c603ac70bb..dc49a528f8 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 8bab1e7141..8945ece473 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 5ff804c490..4dd6f7a55d 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 8c8a294bfd..545096e0d7 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 59eb1f7ce4..718ffffb89 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 790676c8ec..0f60581a69 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 7cbf529aff..78fc2264bd 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 0d5090b80b..593e9d1e85 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 0bf52b14fc..6b6dac16bb 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 94f9d2441d..a1926abbca 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 17479b60eb..7914756840 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 3d62e18b32..87565ba42d 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 116105f564..5787642161 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 cb8b5c0ed7..bff9f402dc 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 a9ad9741d6..fbcf72b7f5 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 a093122641..baf2b77848 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 9b9d1b9caf..4372728b95 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 8e40707353..e1b5a211e2 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 cd78f2eff3..242cfbdb4d 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 4b7fda4135..0d19f64fe7 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 e7379c3162..907e537d1c 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 7520bfe560..7c04acebb2 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 0b94066417..db3bd14e08 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 57a9579960..a17a78eb2b 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 46ca58d26e..2b63b7994f 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 6b4faf1bf1..600e86b58c 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 f23221d13e..c1e99c93a7 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 7c5fe9288a..6b0fff0efc 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 54b27d9a71..7d6cd4d9a2 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 e433f1a4e2..facc7235c0 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 ee368ce3d1..ddb86396d5 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 5279439dc4..c9c6dc7499 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 ec47246033..9c63af42cb 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 5568fb5180..85f857a6aa 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 7c6f3c61db..e3b1773cdb 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 4523bb779d..f5abe5f1aa 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 90d787a529..7dbfb73d4b 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 4603e3d1b6..64ab80aaf0 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 b21a6c8fa5..04d8ea348c 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 3def6a4224..d22f084a63 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 22886a5ec3..e9b118b8d0 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 4fd5ab1c74..2a602a11b5 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 7d763a2308..5366c43c27 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 cad64a83c5..6c4aa1d2f9 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 9e69f6c106..fe48d4f5f2 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 6c227cdfd3..6404fa8733 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 6db37c1095..d56badfe62 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 e1398e02eb..3e4c841419 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 089366d438..ffc281d85a 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 73bda77ab3..f0f2da5d5c 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 0616257f44..d013bea980 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 ee892af6e0..62c8ad97f4 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 4ec48aa8f7..417b11d712 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 23568d0c35..d710b88ff0 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 280ee9e851..ee1129c65f 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 a1acbc6e0e..9d99f46d53 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 2beacba720..cd01e20e95 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 3b82b90b71..b8d4fe49f0 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 a0e3aa9eff..ccf2454160 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 2b2d83f989..5072f53c30 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 a5414aaf97..f3de5eda36 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 64b22dae9c..a10f22e83b 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 adb646a6a2..94e9c40215 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 ab5ee6d4e2..bcca737ba2 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 c73639326b..ece07e2a4d 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 8fc9520290..2e049e6c7a 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 54543499b3..eb9edcb84f 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 ce785ca50f..ae32557c13 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 771de6e95a..78c5d65254 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 34b76a1e1e..7342197b75 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 eb66e91c01..7059844987 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 5156bb23c1..84351f1feb 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 6bf9d96a2b..fe0e4cbb4b 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 1638552a48..d38b30c3a7 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 f4569f1301..c06e8d30aa 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 a6586e628e..9959821f24 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 380ce3b1de..95363cd204 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 97ffd52c74..ddd0312090 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 cbcd68623a..bc302eda3e 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 d78951231c..9d79b7e351 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 4beb6cd602..e80a2ac8c0 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 fa9fd988c1..1f94183f18 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 f3e1aa81b4..94d5d02e77 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 d66e7e0e6b..3337282268 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 ad3b4a5e01..4dd9ce1020 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 8e070b58ca..fe810aebcd 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 c466d718c6..e3aeb79717 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 73d322ab11..99defc6010 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 6e910b3732..8b624a074e 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 c4689adb1a..327a1c15fa 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 020cc2c2bb..17ab2d6a44 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 62c4a4022d..6fc724075f 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 030ef673da..5d584b5123 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 8604045efd..1a9b354fbc 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 9ca7194d28..116c79cc89 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 0106d20e1e..12aa60fad3 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 bc19ba9f0c..dbaa7fe56c 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 14bc0398b1..b502f8c83f 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 b6df383b58..2df7acb4fc 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 c2c6557092..3706b24868 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 cdb70afd35..a4e7bfec77 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 62cc0eb8a1..2e4bfcda11 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 db25ecd486..48f54f721e 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 055682afc8..1cd6dae587 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 ecb46a6f67..bced4807d9 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 abc4a61563..f0617c9129 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 769b20cad6..4f54c5716b 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 79ebf9772c..132bed3055 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 359006c491..4966efff51 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 a6b6a9e39d..c55118719b 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 ae3a21e177..ea87a8a464 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 9300be2dba..40c3f823e2 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 377e540c84..8e760ae57b 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 aaff9f8ed7..50ad937a19 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 29fda7075e..f90a231241 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 327aa7b680..a9ee77c2cb 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 c9352664db..49984f644c 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 27ded2ac9f..12fe660c43 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 3286548957..2ae36978e0 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 90a4391f5b..a7d2ea465a 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 2b8253512c..77e189fb64 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 fdf0a8582e..669cf17716 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 4d46de3399..a310cc65ad 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 e6005d0fac..aed85227b0 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 e133e7cd2d..880d1945a5 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 3b05f70a2d..19925513a3 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 4d2f7c4e1f..fa1c3330d3 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 2e19d7d229..473bec80a7 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 bea70ed1c7..bd7ccc8b44 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 7d73ec5116..1bfc7c2994 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 4d5888db8e..701922b708 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 4d10c554ae..14b70fcfb9 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 ff36e46bf0..12dfbe498f 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 6c8ae0b8f4..b323e52668 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 5a4ef6c85e..8bff7dd5a2 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 d5d028c37f..9fe3a485d6 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 e80e901537..95f3090d1b 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 2f1de2c486..895eb6da20 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 5b045d29ff..7ccb1fe2f0 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 44afebbda5..6690de54ba 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 443d675a61..3f719c8ea2 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 7c64a76566..4e34d88216 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 87e5fc878a..97341f59b8 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 0e13c3ae8c..438e1020fc 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 0b464d8435..33b2fd0498 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 ffcf829df4..767f14370c 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 95d81aaafe..b35a2b655e 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 b6db20f18a..73be734363 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 a8a7f68f6c..ad05c0d1b2 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 121a864771..d1d4e3826d 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 17e8cb4c8b..64fce0e148 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 ff587a7216..b7af043ddf 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 d5de7b792d..e54ed4260d 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 32e2a8d1e9..3b01602bcb 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 8ab18c7345..5b9663b637 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 90961c52c0..5023f1a98f 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 afd36da430..a093bc86ec 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 3c308d2a70..3aa40e3399 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 e4adc8012a..91da0789a1 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 a34bd92cd9..4968840018 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 4300f0686c..08e352cfc3 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 4023727d45..0920be79a5 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 7977e38730..87275a1f94 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 69c854827a..0389f9cfc5 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 ea28b3aabe..4b38e4d69b 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 bb609dff67..ce2bad6f3c 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 fd159c1ccf..85447443a1 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 d84de7c576..c547f3c803 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 e0c203fc12..cfb4defb50 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 3c10614a4b..192d08628b 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 bbbf56ac79..43b6a21b3d 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 94bda6ca67..df2a2cb311 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 a4b85c18dd..1012d13c62 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 555e894b79..2d2631d1f3 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 78f4fb6c74..b737405c5a 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 4c5e92a84e..b3d9abb431 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 7abe3f7da7..4bbdec5fa4 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 c59b1481e6..ec19e42c9d 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 ab2ee4396c..56929ae537 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 5b7a0268a9..f81e95e040 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 7359829dc0..824a874ab9 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 fa986de21a..5dfb0716e6 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 df686d0193..2fd7a9644c 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 0264790a0e..b1daaf4a62 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 3a62ba9ef6..2e6cf57c82 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 66c3d09520..c45a870599 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 b53380345f..c590e250ff 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 f9934e9876..b78b58bd11 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 2a25c212ce..10646e3ae0 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 1addac713f..bd8bcff9f3 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 731ed29c3e..c20f639271 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 5079a9f05a..e9b125050d 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 0db1bb154b..207f2f0259 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 a3044bcdd3..f3dcd55084 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 d71d845888..b662c433c4 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 36a7d09e81..b37dc06ed9 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 397016bee0..ffae64ec4d 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 1bf85b0b89..e184646660 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 83acb51ace..a4d0433627 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 0756a0b122..0c69d28782 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 09a283212c..0998950a2b 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 fec0e61c61..c0a50e7e83 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 97b9ddad12..106828025d 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 14ea809b5f..565a0b327c 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 b2c70bc931..d36a0931d8 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 dce170b8de..be6395564d 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 e44725396d..0d4c98552a 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 624ee071c8..46d47f8f0d 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 d9101c309a..63fd259bc0 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 0537f3697e..46021e9b24 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 42e8aa64e8..932b63f5ad 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 5204bb5b86..e119cc29ba 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 663da04d4f..2b0a4a7502 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 01ba575626..31be1eb317 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 630f3c08e3..0d785f202f 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 89b231c268..53ee97210f 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 8db71afa57..87d6b10b74 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 da3acced68..c871cc3242 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 09d25ef8fe..1c4dca7e7d 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 d5d24ada8e..45a4dab256 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 0b79dc8d88..d0bf382b11 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 df2e8b1ec9..e566e006a7 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 598e78782f..d7c8ebbf5b 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 fcdeb4ddad..09345ef66f 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 cd0df29f49..2dd738d0a8 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 895342372a..aec1dbc1a6 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 8170a12935..cd3886ed70 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 202cfc7b00..c9636a0e99 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 e2dda64458..d544fd2423 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 f2f60f61fb..e65b7d2e7f 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 6e4a1d1701..cf74ab2599 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 9b81f9235e..a2d26b791e 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 f3e4691f8f..21aabe6eee 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 3aada1bd0c..82fed5c206 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 bc6c2ca239..5c785c2e14 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 eec84ea3b9..4e56f81f26 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 ec994c5c37..df1777a1a9 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 52ae5abd05..22d2b9cb39 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 d222114668..651dc03074 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 d577c2aa29..06f507ca8e 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 c43af1f336..65f6519c58 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 45fdacc999..7c15ba0956 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 aea48f9cf7..8ff56c3521 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 a9a8883fd5..78f78e7a66 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 338e10f4c3..bd911739b6 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 2338d5e298..d657e6b594 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 c30c5e27ca..2adf23dca0 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 c5abbfc1c7..6e1c76a428 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 de569e4332..476dd54f3d 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 b472e98729..904b2f6c13 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 06ac33d7fc..9daa0283ae 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 226ec14ae8..ac88154bbb 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 0e8b5bc80b..726dc5657a 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 bbc995fb3a..373b3b7a4f 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 d23f1c8d05..3fc98cbd71 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 fcf3efcd5a..5bc1f0b6fb 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 64dc3ebc84..3972a350fb 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 263e9dccb7..e2d6fb6ad6 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 c0832fdeca..80e733ef90 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 6f661e98a9..5dda2de49f 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 18673713bc..2cccd93ac8 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 047e643b00..75ce1cefb3 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 de5cb4b377..18d4fd227e 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 583dcfe3a1..55bd1afe67 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 6d2f54c965..df134ac42d 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 729a3a6256..7e1c5c6e62 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 a5a86ec536..6be15da9ca 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 7ab39db316..a29c8af5e2 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 93d5afa72c..02d78d05e7 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 62cc953484..85ff8a5b3c 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 5fca22bdc9..89199058c7 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 7d435279a6..2955063102 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 353cb93415..35c3243baa 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 8381fd3364..5a0b3a98c1 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 baba2beb38..d697682890 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 7f8a1c5c12..58ae040cb6 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 cc9e37e740..c6cd3a50f2 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 f9c4f35819..805838b09c 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 48113a40b3..334d16c271 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 07eaee4919..8ddf472c37 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 80d44a2aeb..90e5870641 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 439b120247..19a299a8e2 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 830ab1f69f..92531a5004 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 f974703d9b..2f8d57d9c6 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 d8f8313bc3..6fe38ba8d9 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 02900e3f27..21f121cf17 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 4f8cb48b02..80e20ed65c 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 89e702021e..46607739c3 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 1ca0820ac4..bccee5331c 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 3c21f880cc..4328b1f3f2 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 027c97710b..66c3962159 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 6f5e7c2261..409063c2e5 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 b23ac7a86d..9f151a7b34 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 2048f6bcaa..e955be9c40 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 f548ebdf89..12ea481d4f 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 dfa47c51d9..41c18ccb7d 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 6ef50e82fc..1835ae4078 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 99a1229c08..311f5fd92c 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 5a626c8661..07e2336603 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 1c3c77c9af..5e85a00ee1 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 fca71f89fc..58ec21977a 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 2b6be2b14c..19f6648e4f 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 d8f2ee4064..c058c06a69 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 6e0826232d..016bde394c 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 3c7ff8c15d..868116716d 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 3d4bbc5a6e..50bc5d75ca 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 5caf17daba..1063bd3d40 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 8e5c2b282c..8bd8004c78 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 48342d574f..9517e4fafb 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 43b32840f8..871fc94a6f 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 ee2d4b37e7..6dfe59a144 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 a21d6aac0a..a7e1f3d36c 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 916085fec3..fa18d6f6d3 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 f474b02b5b..b847db2f3c 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 74926c95a2..00bd7573d8 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 58595dfcf9..1432b9227e 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 1ac3006013..902911d44f 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 7b7237055d..0ad7bcde07 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 61da1fa6c6..5780ae6058 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 3212702d0d..ea511edcd4 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 cb85bc31e9..0bd4f37dfd 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 570944b397..d7d7205a07 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 3e11130e97..2efed5f31f 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 a16990053b..fef661fa91 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 c0eb398502..ae8196af94 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 21d2b22713..cfec4386a2 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 909d58f84b..c07f1fd26e 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 beb2658302..a6edd1ea54 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 947f4b02b3..5a0e91efd6 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 3b830db810..003080c226 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 4276d6512f..b10e300d8d 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 e04266e3f0..cd67d10fd2 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 88fa191477..e011737fae 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 90638d889d..ac409a6c52 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 df82530e86..77abd752a5 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 13a9fa3724..3a175b935c 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 c0f046779f..885d5bb7a4 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 fa324db051..6c4169b916 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 a9540112ba..50961f649f 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 1538de4af8..1db8c2c0d8 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 3d33533876..8ddb8bfb01 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 5530a605e8..750a1ef6bf 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 01bdb47629..cb3679967e 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 9b7b1f2628..182596c63c 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 6b773486d0..c97c2e632d 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 d99fb86f87..3b72e7d61a 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 b7bad2fbf6..a8febbd41c 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 7b88644715..d39cf05256 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 2704774ab7..6a53108e82 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 0111b5c8b5..fa8d51c81d 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 dcfbdb1ce1..0c79b6e8a8 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 2f936215be..0306ec6ada 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 53d808aa69..0791e2b3a0 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 1a9ead8480..4b253fe6e9 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 8594df9517..62a892adcc 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 f98bcebcbc..5d6efd4f97 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 1aa333593e..d0c0832044 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 4a27120274..d7e98448f8 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 ff9654e657..e6f536f4ac 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 6bbf189328..59d3a3780f 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 30807b8486..1be622250d 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 a7415a0327..ea1a6600d5 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 7b76528e94..4a24e9f8a4 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 703ec2220a..be8bd68e4c 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 eeaa21be95..0cb4f6d8c4 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 24134ee3f9..a242c19363 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 cc3ed9e662..79b2377edf 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 4b10494eb4..aa7ebcccc8 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 3d0445c85a..05533da201 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 7646b37f3f..e5e7ed8dce 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 86ba05632e..29a0ee71e6 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 e77e33f357..f8877c5e15 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 1345b00806..3dc4e80b04 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 72378c68a6..3808b511b1 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 3cc3bd9e43..70cc4e4a6f 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 ddee927acb..2b2c557d5f 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 0bd264856e..9548142902 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 fa8cb3d454..a51bcde3a5 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 a7142e049c..ca3274002c 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 37f7695c9c..e9f10ee557 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 2178ed800c..41cac413c4 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 febc8ab869..49c3799a09 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 d7d8addfda..1d4cbaa60c 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 998aed36eb..dffb4c4f7f 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 0a9e356450..8f8218d732 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 5d79ab5cd0..5afd18e905 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 3349f054eb..023de32e70 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 b184bcaa31..c0c0ee15a7 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 1af3f38a5d..80655006e1 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 6e9612e678..af8d62dc43 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 0fdafdfef2..8b1ebf706f 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 9b4d643d0d..29abc14f8a 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 fa6e623d32..158864b1c9 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 88c35f3096..64cce9bbcf 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 7f4efc4f1f..e1f87b7ec3 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 c02e15277b..7df8be302c 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 08c2f3db98..747473bb79 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 9eb59c9e30..abbaaeeda6 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 044b63c58c..3166d6c44d 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 5fd04e428f..b7101053c2 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 a52b800150..28b5dd9885 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 701b0a98ee..49e233912d 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 3c32969c00..e9270813d7 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 0e4c5e22a0..6932338009 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 7230450e0c..99f068c5ed 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 354a69ce48..e24c9ca6c2 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 1d571876dd..8af625eddb 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 01d87a583d..1c44c7c5c9 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 38a711a815..413fd18ff8 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 587775ad06..84fc639770 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 e121c5695d..4c7cf7a445 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 fb4217318c..1ffc93081c 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 0355918714..ee934a4f89 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 73c270ea34..3b0dc6e2ad 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 d27fec4d11..9f5430f106 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 846e8bffb3..b9f0e3c8ae 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 12dde957e0..7d7de0cb8c 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 d8ab14cc62..2eca547dbc 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 a711ec3328..be0e45ca2f 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 7981e1d5ca..096a8b92c9 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 0a9b057eec..08f8ada44b 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 10882fb4ff..10c5bdcc14 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 47c87d2584..d3fdc7c464 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 424e921053..463d3e4e02 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 ed368c5e4a..78114d7320 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 0b1a5456b1..93651e5d7f 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 a0eb30f9f0..a8e44f5ffd 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 00896a78f7..43749dc271 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 63f374802d..e354b79f8d 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 aaeadb19da..9711206ae6 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 616714043c..894436bf71 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 d70b8594a4..3eff26b826 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 1342a1b587..d78d057b00 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 ca5c139ac2..4305313dc7 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 f4ed4165c9..ce3c93819a 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 8e5d8f139d..0c9d64a45d 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 eb5afbd0ec..a4440123e7 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 6479ab21de..bebdbca46e 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 f8da2cffd4..d9433b818b 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 856de2ba9e..a092d6d4ce 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 1adc9bc86d..a0135d08b7 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 3a8e0f6b5f..9ef0fc8b93 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 192e036bf7..badbd227e4 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 16b16267b9..dd64ea2de3 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 974094c23f..29839d9629 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 8b07cf2ef4..208691fbf7 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 9552fd2535..b6888499f9 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 d69c4ec861..5ee5c60b2f 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 6933db7e0a..929c0c4f15 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 37d84b9920..ca8fe8e325 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