From 9e8bc56d5a50470b9b747a9dd9d27f0369c53a4f Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 12 Jul 2023 03:44:15 -0400 Subject: [PATCH 01/17] Enable Rubocop Style/Semicolon with config (#23652) --- .rubocop.yml | 5 +++++ .rubocop_todo.yml | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index eff89bdae..5c109a7e5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -192,6 +192,11 @@ Style/RedundantBegin: Style/RescueStandardError: EnforcedStyle: implicit +# Reason: Simplify some spec layouts +# https://docs.rubocop.org/rubocop/cops_style.html#stylesemicolon +Style/Semicolon: + AllowAsExpressionSeparator: true + # Reason: Originally disabled for CodeClimate, and no config consensus has been found # https://docs.rubocop.org/rubocop/cops_style.html#stylesymbolarray Style/SymbolArray: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 24f02d4d3..a2b27bcfa 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1336,13 +1336,6 @@ Style/SafeNavigation: - 'app/models/concerns/account_finder_concern.rb' - 'app/models/status.rb' -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowAsExpressionSeparator. -Style/Semicolon: - Exclude: - - 'spec/services/activitypub/process_status_update_service_spec.rb' - - 'spec/validators/blacklisted_email_validator_spec.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: only_raise, only_fail, semantic From 1d557305d2fbd53a8a0e66af4e46ccc84d597ce8 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 12 Jul 2023 03:47:08 -0400 Subject: [PATCH 02/17] Enable Rubocop Style/FrozenStringLiteralComment (#23793) --- .rubocop_todo.yml | 399 ------------------ app/views/accounts/show.rss.ruby | 2 + app/views/tags/show.rss.ruby | 2 + app/views/well_known/host_meta/show.xml.ruby | 2 + config/application.rb | 2 + config/boot.rb | 2 + config/environment.rb | 2 + config/environments/development.rb | 2 + config/environments/production.rb | 2 + config/environments/test.rb | 2 + .../0_post_deployment_migrations.rb | 2 + .../initializers/active_model_serializers.rb | 2 + .../application_controller_renderer.rb | 1 + config/initializers/assets.rb | 2 + config/initializers/backtrace_silencers.rb | 2 + config/initializers/cache_logging.rb | 2 + config/initializers/chewy.rb | 2 + .../initializers/content_security_policy.rb | 2 + config/initializers/cookies_serializer.rb | 2 + config/initializers/cors.rb | 2 + config/initializers/devise.rb | 2 + config/initializers/doorkeeper.rb | 2 + config/initializers/fast_blank.rb | 2 + config/initializers/ffmpeg.rb | 2 + .../initializers/filter_parameter_logging.rb | 2 + config/initializers/http_client_proxy.rb | 2 + config/initializers/httplog.rb | 2 + config/initializers/inflections.rb | 2 + config/initializers/mail_delivery_job.rb | 2 + config/initializers/mime_types.rb | 2 + config/initializers/oj.rb | 2 + config/initializers/omniauth.rb | 2 + config/initializers/open_uri_redirection.rb | 2 + config/initializers/permissions_policy.rb | 1 + config/initializers/pghero.rb | 2 + config/initializers/preload_link_headers.rb | 2 + config/initializers/premailer_rails.rb | 2 + config/initializers/rack_attack_logging.rb | 2 + config/initializers/redis.rb | 2 + config/initializers/session_store.rb | 2 + config/initializers/simple_form.rb | 2 + config/initializers/stoplight.rb | 2 + config/initializers/trusted_proxies.rb | 2 + config/initializers/twitter_regex.rb | 2 + config/initializers/webauthn.rb | 2 + config/initializers/wrap_parameters.rb | 2 + config/locales/sr-Latn.rb | 2 + config/locales/sr.rb | 2 + config/puma.rb | 2 + db/migrate/20160220174730_create_accounts.rb | 2 + db/migrate/20160220211917_create_statuses.rb | 2 + db/migrate/20160221003140_create_users.rb | 2 + db/migrate/20160221003621_create_follows.rb | 2 + .../20160222122600_create_stream_entries.rb | 2 + ...22143943_add_profile_fields_to_accounts.rb | 2 + ...20160223162837_add_metadata_to_statuses.rb | 2 + ...23164502_make_uris_nullable_in_statuses.rb | 2 + .../20160223165723_add_url_to_statuses.rb | 2 + .../20160223165855_add_url_to_accounts.rb | 2 + .../20160223171800_create_favourites.rb | 2 + db/migrate/20160224223247_create_mentions.rb | 2 + ...30233_add_attachment_avatar_to_accounts.rb | 2 + .../20160305115639_add_devise_to_users.rb | 2 + ...20160306172223_create_doorkeeper_tables.rb | 2 + ...93225_add_attachment_header_to_accounts.rb | 2 + ...20160314164231_add_owner_to_application.rb | 2 + .../20160316103650_add_missing_indices.rb | 2 + ...93748_add_avatar_remote_url_to_accounts.rb | 2 + .../20160325130944_add_admin_to_users.rb | 2 + ...5805_add_superapp_to_oauth_applications.rb | 2 + ...20160905150353_create_media_attachments.rb | 2 + ...add_subscription_expires_at_to_accounts.rb | 2 + ...03904_remove_verify_token_from_accounts.rb | 2 + ...926213048_remove_owner_from_application.rb | 2 + ...20161003142332_add_confirmable_to_users.rb | 2 + db/migrate/20161003145426_create_blocks.rb | 2 + ...20161006213403_rails_settings_migration.rb | 2 + .../20161009120834_create_domain_blocks.rb | 2 + ...20161027172456_add_silenced_to_accounts.rb | 2 + db/migrate/20161104173623_create_tags.rb | 2 + ...5130633_create_statuses_tags_join_table.rb | 2 + .../20161116162355_add_locale_to_users.rb | 2 + .../20161119211120_create_notifications.rb | 2 + .../20161122163057_remove_unneeded_indexes.rb | 2 + ...0161123093447_add_sensitive_to_statuses.rb | 2 + .../20161128103007_create_subscriptions.rb | 2 + ...successful_delivery_at_to_subscriptions.rb | 2 + ...161130185319_add_visibility_to_statuses.rb | 2 + ..._add_in_reply_to_account_id_to_statuses.rb | 2 + ...20_add_from_account_id_to_notifications.rb | 2 + ...0161205214545_add_suspended_to_accounts.rb | 2 + ...1221152630_add_hidden_to_stream_entries.rb | 2 + .../20161222201034_add_locked_to_accounts.rb | 2 + .../20161222204147_create_follow_requests.rb | 2 + ...4407_add_shortcode_to_media_attachments.rb | 2 + .../20170109120109_create_web_settings.rb | 2 + db/migrate/20170112154826_migrate_settings.rb | 2 + ...70114194937_add_application_to_statuses.rb | 2 + ...203041_add_website_to_oauth_application.rb | 2 + .../20170119214911_create_preview_cards.rb | 2 + ...123162658_add_severity_to_domain_blocks.rb | 2 + ...03248_add_reject_media_to_domain_blocks.rb | 2 + ...0125145934_add_spoiler_text_to_statuses.rb | 2 + ...27165745_add_devise_two_factor_to_users.rb | 2 + db/migrate/20170205175257_remove_devices.rb | 2 + .../20170209184350_add_reply_to_statuses.rb | 2 + db/migrate/20170214110202_create_reports.rb | 2 + ...dd_reblog_of_id_foreign_key_to_statuses.rb | 2 + db/migrate/20170301222600_create_mutes.rb | 2 + ...0303212857_add_last_emailed_at_to_users.rb | 2 + ...304202101_add_type_to_media_attachments.rb | 2 + ...0317193015_add_search_index_to_accounts.rb | 2 + ...14217_add_header_remote_url_to_accounts.rb | 2 + ...2021028_add_lowercase_index_to_accounts.rb | 2 + ...hange_primary_key_to_bigint_on_statuses.rb | 2 + ...20170322162804_add_search_index_to_tags.rb | 2 + .../20170330021336_add_counter_caches.rb | 2 + db/migrate/20170330163835_create_imports.rb | 2 + ...30164118_add_attachment_data_to_imports.rb | 2 + ...d_action_taken_by_account_id_to_reports.rb | 2 + ...5112956_add_index_on_mentions_status_id.rb | 2 + ...dd_notifications_and_favourites_indices.rb | 2 + ...753_add_last_webfingered_at_to_accounts.rb | 2 + ...d_devise_two_factor_backupable_to_users.rb | 2 + ...20170414132105_add_language_to_statuses.rb | 2 + ...728_add_indexes_to_reports_for_accounts.rb | 2 + ...423005413_add_allowed_languages_to_user.rb | 2 + ...0424003227_create_account_domain_blocks.rb | 2 + ...22_add_status_id_index_to_statuses_tags.rb | 2 + ...0170425131920_add_media_attachment_meta.rb | 2 + ...70425202925_add_oembed_to_preview_cards.rb | 2 + ...70427011934_re_add_owner_to_application.rb | 2 + .../20170506235850_create_conversations.rb | 2 + ...7000211_add_conversation_id_to_statuses.rb | 2 + ...0507141759_optimize_index_subscriptions.rb | 2 + ...0170508230434_create_conversation_mutes.rb | 2 + ...0170516072309_add_index_accounts_on_uri.rb | 2 + ...45338_change_language_filter_to_opt_out.rb | 2 + ...d_index_on_media_attachments_account_id.rb | 2 + ...604144747_add_foreign_keys_for_accounts.rb | 2 + ...113804_change_tag_search_index_to_btree.rb | 2 + ...6_remove_default_language_from_statuses.rb | 2 + ...000_add_statuses_index_on_account_id_id.rb | 2 + ...170623152212_create_session_activations.rb | 2 + ..._add_description_to_session_activations.rb | 2 + ..._access_token_id_to_session_activations.rb | 2 + .../20170711225116_fix_null_booleans.rb | 2 + ...112503_make_tag_search_case_insensitive.rb | 2 + ...713175513_create_web_push_subscriptions.rb | 2 + ...ush_subscription_to_session_activations.rb | 2 + ...70714184731_add_domain_to_subscriptions.rb | 2 + ...16191202_add_hide_notifications_to_mute.rb | 2 + ...70718211102_add_activitypub_to_accounts.rb | 2 + ...d_index_favourites_on_account_id_and_id.rb | 2 + .../20170823162448_create_status_pins.rb | 2 + ...824103029_add_timestamps_to_status_pins.rb | 2 + ...215220_remove_status_pins_account_index.rb | 2 + .../20170901141119_truncate_preview_cards.rb | 2 + ...reate_join_table_preview_cards_statuses.rb | 2 + ...count_id_activity_type_on_notifications.rb | 2 + .../20170905165803_add_local_to_statuses.rb | 2 + .../20170913000752_create_site_uploads.rb | 2 + .../20170917153509_create_custom_emojis.rb | 2 + db/migrate/20170918125918_ids_to_bigints.rb | 2 + ...70920024819_status_ids_to_timestamp_ids.rb | 2 + .../20170920032311_fix_reblogs_in_feeds.rb | 2 + db/migrate/20170924022025_ids_to_bigints2.rb | 2 + ...09_add_description_to_media_attachments.rb | 2 + ...170928082043_create_email_domain_blocks.rb | 2 + ...5102658_create_account_moderation_notes.rb | 2 + ...005171936_add_disabled_to_custom_emojis.rb | 2 + ...20171006142024_add_uri_to_custom_emojis.rb | 2 + ...foreign_key_to_account_moderation_notes.rb | 2 + ...nonnullable_in_account_moderation_notes.rb | 2 + ...8_add_visible_in_picker_to_custom_emoji.rb | 2 + .../20171028221157_add_reblogs_to_follows.rb | 2 + ...20171107143332_add_memorial_to_accounts.rb | 2 + .../20171107143624_add_disabled_to_users.rb | 2 + ...0171109012327_add_moderator_to_accounts.rb | 2 + ...add_index_domain_to_email_domain_blocks.rb | 2 + db/migrate/20171114231651_create_lists.rb | 2 + .../20171116161857_create_list_accounts.rb | 2 + ...443_add_moved_to_account_id_to_accounts.rb | 2 + ...20171119172437_create_admin_action_logs.rb | 2 + ...ex_account_and_reblog_of_id_to_statuses.rb | 2 + db/migrate/20171125024930_create_invites.rb | 2 + .../20171125031751_add_invite_id_to_users.rb | 2 + ...ex_reblog_of_id_and_account_to_statuses.rb | 2 + ...735_remove_old_reblog_index_on_statuses.rb | 2 + ...71129172043_add_index_on_stream_entries.rb | 2 + ...30000000_add_embed_url_to_preview_cards.rb | 2 + ..._change_account_id_nonnullable_in_lists.rb | 2 + ...95226_remove_duplicate_indexes_in_lists.rb | 2 + ...4803_more_faster_index_on_notifications.rb | 2 + ...for_api_v1_accounts_account_id_statuses.rb | 2 + ...80109143959_add_remember_token_to_users.rb | 2 + .../20180204034416_create_identities.rb | 2 + ...180206000000_change_user_id_nonnullable.rb | 2 + db/migrate/20180211015820_create_backups.rb | 2 + ...add_featured_collection_url_to_accounts.rb | 2 + ...ge_columns_in_notifications_nonnullable.rb | 2 + ...1200_add_assigned_account_id_to_reports.rb | 2 + .../20180402040909_create_report_notes.rb | 2 + .../20180410204633_add_fields_to_accounts.rb | 2 + ...20180416210259_add_uri_to_relationships.rb | 2 + ...180506221944_add_actor_type_to_accounts.rb | 2 + ...cess_token_id_to_web_push_subscriptions.rb | 2 + ...10230049_migrate_web_push_subscriptions.rb | 2 + ...0180528141303_fix_accounts_unique_index.rb | 2 + ...08213548_reject_following_blocked_users.rb | 2 + ...9104432_migrate_web_push_subscriptions2.rb | 2 + ...0180615122121_add_autofollow_to_invites.rb | 2 + ...616192031_add_chosen_languages_to_users.rb | 2 + .../20180617162849_remove_unused_indexes.rb | 2 + .../20180628181026_create_custom_filters.rb | 2 + ...7154237_add_whole_word_to_custom_filter.rb | 2 + db/migrate/20180711152640_create_relays.rb | 2 + .../20180808175627_create_account_pins.rb | 2 + .../20180812123222_change_relays_enabled.rb | 2 + .../20180812162710_create_status_stats.rb | 2 + .../20180812173710_copy_status_stats.rb | 2 + ..._confidential_to_doorkeeper_application.rb | 2 + db/migrate/20180831171112_create_bookmarks.rb | 2 + ...0929222014_create_account_conversations.rb | 2 + ...0181007025445_create_pghero_space_stats.rb | 2 + .../20181010141500_add_silent_to_mentions.rb | 2 + ...937_add_reject_reports_to_domain_blocks.rb | 2 + ...649_add_unread_to_account_conversations.rb | 2 + ...024224956_migrate_account_conversations.rb | 2 + ...3_remove_faux_remote_account_duplicates.rb | 2 + .../20181116165755_create_account_stats.rb | 2 + .../20181116173541_copy_account_stats.rb | 2 + .../20181127130500_identity_id_to_bigint.rb | 2 + ...0181127165847_add_show_replies_to_lists.rb | 2 + ...3003808_create_accounts_tags_join_table.rb | 2 + ...1203021853_add_discoverable_to_accounts.rb | 2 + ...439_add_last_status_at_to_account_stats.rb | 2 + ...20181204215309_create_account_tag_stats.rb | 2 + ...207011115_downcase_custom_emoji_domains.rb | 2 + .../20181213184704_create_account_warnings.rb | 2 + ...13185533_create_account_warning_presets.rb | 2 + ..._add_created_by_application_id_to_users.rb | 2 + ...226021420_add_also_known_as_to_accounts.rb | 2 + ...0190103124649_create_scheduled_statuses.rb | 2 + ...cheduled_status_id_to_media_attachments.rb | 2 + .../20190117114553_create_tombstones.rb | 2 + ...20190201012802_add_overwrite_to_imports.rb | 2 + .../20190203180359_create_featured_tags.rb | 2 + db/migrate/20190225031541_create_polls.rb | 2 + .../20190225031625_create_poll_votes.rb | 2 + .../20190226003449_add_poll_id_to_statuses.rb | 2 + .../20190304152020_add_uri_to_poll_votes.rb | 2 + ...0190306145741_add_lock_version_to_polls.rb | 2 + .../20190307234537_add_approved_to_users.rb | 2 + ...1829_migrate_open_registrations_setting.rb | 2 + ...16190352_create_account_identity_proofs.rb | 2 + .../20190317135723_add_uri_to_reports.rb | 2 + .../20190403141604_add_comment_to_invites.rb | 2 + ...90409054914_create_user_invite_requests.rb | 2 + ...25523_add_blurhash_to_media_attachments.rb | 2 + ...509164208_add_by_moderator_to_tombstone.rb | 2 + ...dd_silenced_at_suspended_at_to_accounts.rb | 2 + ..._preserve_old_layout_for_existing_users.rb | 2 + ...27222225_create_custom_emoji_categories.rb | 2 + ...222826_add_category_id_to_custom_emojis.rb | 2 + ...90701022101_add_trust_level_to_accounts.rb | 2 + .../20190705002136_create_domain_allows.rb | 2 + .../20190715164535_add_instance_actor.rb | 2 + ...5042_add_case_insensitive_index_to_tags.rb | 2 + .../20190729185330_add_score_to_tags.rb | 2 + ...20190805123746_add_capabilities_to_tags.rb | 2 + ...807135426_add_comments_to_domain_blocks.rb | 2 + ...190815225426_add_last_status_at_to_tags.rb | 2 + ...190819134503_add_deleted_at_to_statuses.rb | 2 + .../20190820003045_update_statuses_index.rb | 2 + ...90823221802_add_local_index_to_statuses.rb | 2 + .../20190901035623_add_max_score_to_tags.rb | 2 + db/migrate/20190904222339_create_markers.rb | 2 + ...0190914202517_create_account_migrations.rb | 2 + .../20190915194355_create_account_aliases.rb | 2 + ...0190927232842_add_voters_count_to_polls.rb | 2 + ...13028_add_lock_version_to_account_stats.rb | 2 + .../20191007013357_update_pt_locales.rb | 2 + ...205_change_list_account_follow_nullable.rb | 2 + .../20191212003415_increase_backup_size.rb | 2 + ...163405_add_hide_collections_to_accounts.rb | 2 + .../20191218153258_create_announcements.rb | 2 + ...0200113125135_create_announcement_mutes.rb | 2 + ...114113335_create_announcement_reactions.rb | 2 + ...0119112504_add_public_index_to_statuses.rb | 2 + ...03551_add_published_at_to_announcements.rb | 2 + ...625_add_processing_to_media_attachments.rb | 2 + ...20200309150742_add_forwarded_to_reports.rb | 2 + ...58_add_title_to_account_warning_presets.rb | 2 + ...2162302_add_status_ids_to_announcements.rb | 2 + ...43_add_parent_id_to_email_domain_blocks.rb | 2 + .../20200317021758_add_expires_at_to_mutes.rb | 2 + ...200407201300_create_unavailable_domains.rb | 2 + ...00407202420_migrate_unavailable_inboxes.rb | 2 + ...200417125749_add_storage_schema_version.rb | 2 + .../20200508212852_reset_unique_jobs_locks.rb | 2 + .../20200510110808_reset_web_app_secret.rb | 2 + ...181721_remove_duplicated_indexes_pghero.rb | 2 + db/migrate/20200516180352_create_devices.rb | 2 + .../20200516183822_create_one_time_keys.rb | 2 + ...0200518083523_create_encrypted_messages.rb | 2 + ..._encrypted_message_ids_to_timestamp_ids.rb | 2 + ...00529214050_add_devices_url_to_accounts.rb | 2 + .../20200601222558_create_system_keys.rb | 2 + ...605155027_add_blurhash_to_preview_cards.rb | 2 + ...200608113046_add_sign_in_token_to_users.rb | 2 + ...200614002136_add_sensitized_to_accounts.rb | 2 + ...3_add_fixed_lowercase_index_to_accounts.rb | 2 + ...5_media_attachment_ids_to_timestamp_ids.rb | 2 + ..._thumbnail_columns_to_media_attachments.rb | 2 + .../20200628133322_create_account_notes.rb | 2 + ...00630190240_create_webauthn_credentials.rb | 2 + ...20200630190544_add_webauthn_id_to_users.rb | 2 + ...193330_create_account_deletion_requests.rb | 2 + .../20200917192924_add_notify_to_follows.rb | 2 + ...0200917193034_add_type_to_notifications.rb | 2 + ...7222316_add_index_notifications_on_type.rb | 2 + db/migrate/20201008202037_create_ip_blocks.rb | 2 + .../20201008220312_add_sign_up_ip_to_users.rb | 2 + ...33919_add_suspension_origin_to_accounts.rb | 2 + db/migrate/20201206004238_create_instances.rb | 2 + ...18054746_add_obfuscate_to_domain_blocks.rb | 2 + db/migrate/20210221045109_create_rules.rb | 2 + ...0306164523_account_ids_to_timestamp_ids.rb | 2 + ...20210322164601_create_account_summaries.rb | 2 + ...323114347_create_follow_recommendations.rb | 2 + ...eate_follow_recommendation_suppressions.rb | 2 + ...416200740_create_canonical_email_blocks.rb | 2 + ...dd_case_insensitive_btree_index_to_tags.rb | 2 + ..._media_attachments_account_id_status_id.rb | 2 + ...ate_follow_recommendations_to_version_2.rb | 2 + .../20210609202149_create_login_activities.rb | 2 + db/migrate/20210616214526_create_user_ips.rb | 2 + ...1221010_add_skip_sign_in_token_to_users.rb | 2 + ..._fix_canonical_email_blocks_foreign_key.rb | 2 + ...reate_account_statuses_cleanup_policies.rb | 2 + ...0210904215403_add_edited_at_to_statuses.rb | 2 + .../20210908220918_create_status_edits.rb | 2 + ...031031021_create_preview_card_providers.rb | 2 + ...112011713_add_language_to_preview_cards.rb | 2 + ...15032527_add_trendable_to_preview_cards.rb | 2 + ...23212714_add_link_type_to_preview_cards.rb | 2 + ...6_update_account_summaries_to_version_2.rb | 2 + .../20211231080958_add_category_to_reports.rb | 2 + ...5163928_remove_mentions_status_id_index.rb | 2 + ...25126_add_report_id_to_account_warnings.rb | 2 + ...20115125341_fix_account_warning_actions.rb | 2 + ...202951_add_deleted_at_index_on_statuses.rb | 2 + db/migrate/20220124141035_create_appeals.rb | 2 + ...0220202200743_add_trendable_to_accounts.rb | 2 + ...0220202200926_add_trendable_to_statuses.rb | 2 + ...19_add_overruled_at_to_account_warnings.rb | 2 + ...24010024_add_ips_to_email_domain_blocks.rb | 2 + ...add_last_used_at_to_oauth_access_tokens.rb | 2 + ...rdered_media_attachment_ids_to_statuses.rb | 2 + ...ed_media_attachment_ids_to_status_edits.rb | 2 + ...4195405_migrate_hide_network_preference.rb | 2 + ...307094650_fix_featured_tags_constraints.rb | 2 + .../20220309213005_fix_reblog_deleted_at.rb | 2 + .../20220316233212_update_kurdish_locales.rb | 2 + ...112511_add_index_statuses_on_account_id.rb | 2 + ...27_add_index_statuses_pins_on_status_id.rb | 2 + ...dd_index_reports_on_assigned_account_id.rb | 2 + ...x_reports_on_action_taken_by_account_id.rb | 2 + db/migrate/20220606044941_create_webhooks.rb | 2 + .../20220611210335_create_user_roles.rb | 2 + .../20220611212541_add_role_id_to_users.rb | 2 + ...20220710102457_add_display_name_to_tags.rb | 2 + .../20220714171049_create_tag_follows.rb | 2 + ...d_human_identifier_to_admin_action_logs.rb | 2 + .../20220824233535_create_status_trends.rb | 2 + ..._change_canonical_email_blocks_nullable.rb | 2 + ...20220829192633_add_languages_to_follows.rb | 2 + ...192658_add_languages_to_follow_requests.rb | 2 + ...221006061337_create_preview_card_trends.rb | 2 + ...1012181003_add_blurhash_to_site_uploads.rb | 2 + ..._featured_tags_on_account_id_and_tag_id.rb | 2 + ...0221025171544_add_index_ip_blocks_on_ip.rb | 2 + ...0221104133904_add_name_to_featured_tags.rb | 2 + ...9130537_remove_boosts_widening_audience.rb | 2 + ...e_subscription_expires_at_from_accounts.rb | 2 + ...18183123_remove_rememberable_from_users.rb | 2 + db/seeds/01_web_app.rb | 2 + db/seeds/02_instance_actor.rb | 2 + db/seeds/03_roles.rb | 2 + db/seeds/04_admin.rb | 2 + lib/rails/engine_extensions.rb | 2 + lib/tasks/branding.rake | 2 + spec/fabricators_spec.rb | 2 + 394 files changed, 784 insertions(+), 399 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a2b27bcfa..9b74778b0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -776,405 +776,6 @@ Style/FormatStringToken: - 'config/initializers/devise.rb' - 'lib/paperclip/color_extractor.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: - Exclude: - - 'app/views/accounts/show.rss.ruby' - - 'app/views/tags/show.rss.ruby' - - 'app/views/well_known/host_meta/show.xml.ruby' - - 'config/application.rb' - - 'config/boot.rb' - - 'config/environment.rb' - - 'config/environments/development.rb' - - 'config/environments/production.rb' - - 'config/environments/test.rb' - - 'config/initializers/0_post_deployment_migrations.rb' - - 'config/initializers/active_model_serializers.rb' - - 'config/initializers/application_controller_renderer.rb' - - 'config/initializers/assets.rb' - - 'config/initializers/backtrace_silencers.rb' - - 'config/initializers/cache_logging.rb' - - 'config/initializers/chewy.rb' - - 'config/initializers/content_security_policy.rb' - - 'config/initializers/cookies_serializer.rb' - - 'config/initializers/cors.rb' - - 'config/initializers/devise.rb' - - 'config/initializers/doorkeeper.rb' - - 'config/initializers/fast_blank.rb' - - 'config/initializers/ffmpeg.rb' - - 'config/initializers/filter_parameter_logging.rb' - - 'config/initializers/http_client_proxy.rb' - - 'config/initializers/httplog.rb' - - 'config/initializers/inflections.rb' - - 'config/initializers/mail_delivery_job.rb' - - 'config/initializers/mime_types.rb' - - 'config/initializers/oj.rb' - - 'config/initializers/omniauth.rb' - - 'config/initializers/open_uri_redirection.rb' - - 'config/initializers/permissions_policy.rb' - - 'config/initializers/pghero.rb' - - 'config/initializers/preload_link_headers.rb' - - 'config/initializers/premailer_rails.rb' - - 'config/initializers/rack_attack_logging.rb' - - 'config/initializers/redis.rb' - - 'config/initializers/session_store.rb' - - 'config/initializers/simple_form.rb' - - 'config/initializers/stoplight.rb' - - 'config/initializers/trusted_proxies.rb' - - 'config/initializers/twitter_regex.rb' - - 'config/initializers/webauthn.rb' - - 'config/initializers/wrap_parameters.rb' - - 'config/locales/sr-Latn.rb' - - 'config/locales/sr.rb' - - 'config/puma.rb' - - 'db/migrate/20160220174730_create_accounts.rb' - - 'db/migrate/20160220211917_create_statuses.rb' - - 'db/migrate/20160221003140_create_users.rb' - - 'db/migrate/20160221003621_create_follows.rb' - - 'db/migrate/20160222122600_create_stream_entries.rb' - - 'db/migrate/20160222143943_add_profile_fields_to_accounts.rb' - - 'db/migrate/20160223162837_add_metadata_to_statuses.rb' - - 'db/migrate/20160223164502_make_uris_nullable_in_statuses.rb' - - 'db/migrate/20160223165723_add_url_to_statuses.rb' - - 'db/migrate/20160223165855_add_url_to_accounts.rb' - - 'db/migrate/20160223171800_create_favourites.rb' - - 'db/migrate/20160224223247_create_mentions.rb' - - 'db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb' - - 'db/migrate/20160305115639_add_devise_to_users.rb' - - 'db/migrate/20160306172223_create_doorkeeper_tables.rb' - - 'db/migrate/20160312193225_add_attachment_header_to_accounts.rb' - - 'db/migrate/20160314164231_add_owner_to_application.rb' - - 'db/migrate/20160316103650_add_missing_indices.rb' - - 'db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb' - - 'db/migrate/20160325130944_add_admin_to_users.rb' - - 'db/migrate/20160826155805_add_superapp_to_oauth_applications.rb' - - 'db/migrate/20160905150353_create_media_attachments.rb' - - 'db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb' - - 'db/migrate/20160920003904_remove_verify_token_from_accounts.rb' - - 'db/migrate/20160926213048_remove_owner_from_application.rb' - - 'db/migrate/20161003142332_add_confirmable_to_users.rb' - - 'db/migrate/20161003145426_create_blocks.rb' - - 'db/migrate/20161006213403_rails_settings_migration.rb' - - 'db/migrate/20161009120834_create_domain_blocks.rb' - - 'db/migrate/20161027172456_add_silenced_to_accounts.rb' - - 'db/migrate/20161104173623_create_tags.rb' - - 'db/migrate/20161105130633_create_statuses_tags_join_table.rb' - - 'db/migrate/20161116162355_add_locale_to_users.rb' - - 'db/migrate/20161119211120_create_notifications.rb' - - 'db/migrate/20161122163057_remove_unneeded_indexes.rb' - - 'db/migrate/20161123093447_add_sensitive_to_statuses.rb' - - 'db/migrate/20161128103007_create_subscriptions.rb' - - 'db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb' - - 'db/migrate/20161130185319_add_visibility_to_statuses.rb' - - 'db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb' - - 'db/migrate/20161203164520_add_from_account_id_to_notifications.rb' - - 'db/migrate/20161205214545_add_suspended_to_accounts.rb' - - 'db/migrate/20161221152630_add_hidden_to_stream_entries.rb' - - 'db/migrate/20161222201034_add_locked_to_accounts.rb' - - 'db/migrate/20161222204147_create_follow_requests.rb' - - 'db/migrate/20170105224407_add_shortcode_to_media_attachments.rb' - - 'db/migrate/20170109120109_create_web_settings.rb' - - 'db/migrate/20170112154826_migrate_settings.rb' - - 'db/migrate/20170114194937_add_application_to_statuses.rb' - - 'db/migrate/20170114203041_add_website_to_oauth_application.rb' - - 'db/migrate/20170119214911_create_preview_cards.rb' - - 'db/migrate/20170123162658_add_severity_to_domain_blocks.rb' - - 'db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb' - - 'db/migrate/20170125145934_add_spoiler_text_to_statuses.rb' - - 'db/migrate/20170127165745_add_devise_two_factor_to_users.rb' - - 'db/migrate/20170205175257_remove_devices.rb' - - 'db/migrate/20170209184350_add_reply_to_statuses.rb' - - 'db/migrate/20170214110202_create_reports.rb' - - 'db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb' - - 'db/migrate/20170301222600_create_mutes.rb' - - 'db/migrate/20170303212857_add_last_emailed_at_to_users.rb' - - 'db/migrate/20170304202101_add_type_to_media_attachments.rb' - - 'db/migrate/20170317193015_add_search_index_to_accounts.rb' - - 'db/migrate/20170318214217_add_header_remote_url_to_accounts.rb' - - 'db/migrate/20170322021028_add_lowercase_index_to_accounts.rb' - - 'db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb' - - 'db/migrate/20170322162804_add_search_index_to_tags.rb' - - 'db/migrate/20170330021336_add_counter_caches.rb' - - 'db/migrate/20170330163835_create_imports.rb' - - 'db/migrate/20170330164118_add_attachment_data_to_imports.rb' - - 'db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb' - - 'db/migrate/20170405112956_add_index_on_mentions_status_id.rb' - - 'db/migrate/20170406215816_add_notifications_and_favourites_indices.rb' - - 'db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb' - - 'db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb' - - 'db/migrate/20170414132105_add_language_to_statuses.rb' - - 'db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb' - - 'db/migrate/20170423005413_add_allowed_languages_to_user.rb' - - 'db/migrate/20170424003227_create_account_domain_blocks.rb' - - 'db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb' - - 'db/migrate/20170425131920_add_media_attachment_meta.rb' - - 'db/migrate/20170425202925_add_oembed_to_preview_cards.rb' - - 'db/migrate/20170427011934_re_add_owner_to_application.rb' - - 'db/migrate/20170506235850_create_conversations.rb' - - 'db/migrate/20170507000211_add_conversation_id_to_statuses.rb' - - 'db/migrate/20170507141759_optimize_index_subscriptions.rb' - - 'db/migrate/20170508230434_create_conversation_mutes.rb' - - 'db/migrate/20170516072309_add_index_accounts_on_uri.rb' - - 'db/migrate/20170520145338_change_language_filter_to_opt_out.rb' - - 'db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb' - - 'db/migrate/20170604144747_add_foreign_keys_for_accounts.rb' - - 'db/migrate/20170606113804_change_tag_search_index_to_btree.rb' - - 'db/migrate/20170609145826_remove_default_language_from_statuses.rb' - - 'db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb' - - 'db/migrate/20170623152212_create_session_activations.rb' - - 'db/migrate/20170624134742_add_description_to_session_activations.rb' - - 'db/migrate/20170625140443_add_access_token_id_to_session_activations.rb' - - 'db/migrate/20170711225116_fix_null_booleans.rb' - - 'db/migrate/20170713112503_make_tag_search_case_insensitive.rb' - - 'db/migrate/20170713175513_create_web_push_subscriptions.rb' - - 'db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb' - - 'db/migrate/20170714184731_add_domain_to_subscriptions.rb' - - 'db/migrate/20170716191202_add_hide_notifications_to_mute.rb' - - 'db/migrate/20170718211102_add_activitypub_to_accounts.rb' - - 'db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb' - - 'db/migrate/20170823162448_create_status_pins.rb' - - 'db/migrate/20170824103029_add_timestamps_to_status_pins.rb' - - 'db/migrate/20170829215220_remove_status_pins_account_index.rb' - - 'db/migrate/20170901141119_truncate_preview_cards.rb' - - 'db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb' - - 'db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb' - - 'db/migrate/20170905165803_add_local_to_statuses.rb' - - 'db/migrate/20170913000752_create_site_uploads.rb' - - 'db/migrate/20170917153509_create_custom_emojis.rb' - - 'db/migrate/20170918125918_ids_to_bigints.rb' - - 'db/migrate/20170920024819_status_ids_to_timestamp_ids.rb' - - 'db/migrate/20170920032311_fix_reblogs_in_feeds.rb' - - 'db/migrate/20170924022025_ids_to_bigints2.rb' - - 'db/migrate/20170927215609_add_description_to_media_attachments.rb' - - 'db/migrate/20170928082043_create_email_domain_blocks.rb' - - 'db/migrate/20171005102658_create_account_moderation_notes.rb' - - 'db/migrate/20171005171936_add_disabled_to_custom_emojis.rb' - - 'db/migrate/20171006142024_add_uri_to_custom_emojis.rb' - - 'db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb' - - 'db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb' - - 'db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb' - - 'db/migrate/20171028221157_add_reblogs_to_follows.rb' - - 'db/migrate/20171107143332_add_memorial_to_accounts.rb' - - 'db/migrate/20171107143624_add_disabled_to_users.rb' - - 'db/migrate/20171109012327_add_moderator_to_accounts.rb' - - 'db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb' - - 'db/migrate/20171114231651_create_lists.rb' - - 'db/migrate/20171116161857_create_list_accounts.rb' - - 'db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb' - - 'db/migrate/20171119172437_create_admin_action_logs.rb' - - 'db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb' - - 'db/migrate/20171125024930_create_invites.rb' - - 'db/migrate/20171125031751_add_invite_id_to_users.rb' - - 'db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb' - - 'db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb' - - 'db/migrate/20171129172043_add_index_on_stream_entries.rb' - - 'db/migrate/20171130000000_add_embed_url_to_preview_cards.rb' - - 'db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb' - - 'db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb' - - 'db/migrate/20171226094803_more_faster_index_on_notifications.rb' - - 'db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb' - - 'db/migrate/20180109143959_add_remember_token_to_users.rb' - - 'db/migrate/20180204034416_create_identities.rb' - - 'db/migrate/20180206000000_change_user_id_nonnullable.rb' - - 'db/migrate/20180211015820_create_backups.rb' - - 'db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb' - - 'db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb' - - 'db/migrate/20180402031200_add_assigned_account_id_to_reports.rb' - - 'db/migrate/20180402040909_create_report_notes.rb' - - 'db/migrate/20180410204633_add_fields_to_accounts.rb' - - 'db/migrate/20180416210259_add_uri_to_relationships.rb' - - 'db/migrate/20180506221944_add_actor_type_to_accounts.rb' - - 'db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb' - - 'db/migrate/20180510230049_migrate_web_push_subscriptions.rb' - - 'db/migrate/20180528141303_fix_accounts_unique_index.rb' - - 'db/migrate/20180608213548_reject_following_blocked_users.rb' - - 'db/migrate/20180609104432_migrate_web_push_subscriptions2.rb' - - 'db/migrate/20180615122121_add_autofollow_to_invites.rb' - - 'db/migrate/20180616192031_add_chosen_languages_to_users.rb' - - 'db/migrate/20180617162849_remove_unused_indexes.rb' - - 'db/migrate/20180628181026_create_custom_filters.rb' - - 'db/migrate/20180707154237_add_whole_word_to_custom_filter.rb' - - 'db/migrate/20180711152640_create_relays.rb' - - 'db/migrate/20180808175627_create_account_pins.rb' - - 'db/migrate/20180812123222_change_relays_enabled.rb' - - 'db/migrate/20180812162710_create_status_stats.rb' - - 'db/migrate/20180812173710_copy_status_stats.rb' - - 'db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb' - - 'db/migrate/20180831171112_create_bookmarks.rb' - - 'db/migrate/20180929222014_create_account_conversations.rb' - - 'db/migrate/20181007025445_create_pghero_space_stats.rb' - - 'db/migrate/20181010141500_add_silent_to_mentions.rb' - - 'db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb' - - 'db/migrate/20181018205649_add_unread_to_account_conversations.rb' - - 'db/migrate/20181024224956_migrate_account_conversations.rb' - - 'db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb' - - 'db/migrate/20181116165755_create_account_stats.rb' - - 'db/migrate/20181116173541_copy_account_stats.rb' - - 'db/migrate/20181127130500_identity_id_to_bigint.rb' - - 'db/migrate/20181127165847_add_show_replies_to_lists.rb' - - 'db/migrate/20181203003808_create_accounts_tags_join_table.rb' - - 'db/migrate/20181203021853_add_discoverable_to_accounts.rb' - - 'db/migrate/20181204193439_add_last_status_at_to_account_stats.rb' - - 'db/migrate/20181204215309_create_account_tag_stats.rb' - - 'db/migrate/20181207011115_downcase_custom_emoji_domains.rb' - - 'db/migrate/20181213184704_create_account_warnings.rb' - - 'db/migrate/20181213185533_create_account_warning_presets.rb' - - 'db/migrate/20181219235220_add_created_by_application_id_to_users.rb' - - 'db/migrate/20181226021420_add_also_known_as_to_accounts.rb' - - 'db/migrate/20190103124649_create_scheduled_statuses.rb' - - 'db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb' - - 'db/migrate/20190117114553_create_tombstones.rb' - - 'db/migrate/20190201012802_add_overwrite_to_imports.rb' - - 'db/migrate/20190203180359_create_featured_tags.rb' - - 'db/migrate/20190225031541_create_polls.rb' - - 'db/migrate/20190225031625_create_poll_votes.rb' - - 'db/migrate/20190226003449_add_poll_id_to_statuses.rb' - - 'db/migrate/20190304152020_add_uri_to_poll_votes.rb' - - 'db/migrate/20190306145741_add_lock_version_to_polls.rb' - - 'db/migrate/20190307234537_add_approved_to_users.rb' - - 'db/migrate/20190314181829_migrate_open_registrations_setting.rb' - - 'db/migrate/20190316190352_create_account_identity_proofs.rb' - - 'db/migrate/20190317135723_add_uri_to_reports.rb' - - 'db/migrate/20190403141604_add_comment_to_invites.rb' - - 'db/migrate/20190409054914_create_user_invite_requests.rb' - - 'db/migrate/20190420025523_add_blurhash_to_media_attachments.rb' - - 'db/migrate/20190509164208_add_by_moderator_to_tombstone.rb' - - 'db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb' - - 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb' - - 'db/migrate/20190627222225_create_custom_emoji_categories.rb' - - 'db/migrate/20190627222826_add_category_id_to_custom_emojis.rb' - - 'db/migrate/20190701022101_add_trust_level_to_accounts.rb' - - 'db/migrate/20190705002136_create_domain_allows.rb' - - 'db/migrate/20190715164535_add_instance_actor.rb' - - 'db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb' - - 'db/migrate/20190729185330_add_score_to_tags.rb' - - 'db/migrate/20190805123746_add_capabilities_to_tags.rb' - - 'db/migrate/20190807135426_add_comments_to_domain_blocks.rb' - - 'db/migrate/20190815225426_add_last_status_at_to_tags.rb' - - 'db/migrate/20190819134503_add_deleted_at_to_statuses.rb' - - 'db/migrate/20190820003045_update_statuses_index.rb' - - 'db/migrate/20190823221802_add_local_index_to_statuses.rb' - - 'db/migrate/20190901035623_add_max_score_to_tags.rb' - - 'db/migrate/20190904222339_create_markers.rb' - - 'db/migrate/20190914202517_create_account_migrations.rb' - - 'db/migrate/20190915194355_create_account_aliases.rb' - - 'db/migrate/20190927232842_add_voters_count_to_polls.rb' - - 'db/migrate/20191001213028_add_lock_version_to_account_stats.rb' - - 'db/migrate/20191007013357_update_pt_locales.rb' - - 'db/migrate/20191031163205_change_list_account_follow_nullable.rb' - - 'db/migrate/20191212003415_increase_backup_size.rb' - - 'db/migrate/20191212163405_add_hide_collections_to_accounts.rb' - - 'db/migrate/20191218153258_create_announcements.rb' - - 'db/migrate/20200113125135_create_announcement_mutes.rb' - - 'db/migrate/20200114113335_create_announcement_reactions.rb' - - 'db/migrate/20200119112504_add_public_index_to_statuses.rb' - - 'db/migrate/20200126203551_add_published_at_to_announcements.rb' - - 'db/migrate/20200306035625_add_processing_to_media_attachments.rb' - - 'db/migrate/20200309150742_add_forwarded_to_reports.rb' - - 'db/migrate/20200312144258_add_title_to_account_warning_presets.rb' - - 'db/migrate/20200312162302_add_status_ids_to_announcements.rb' - - 'db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb' - - 'db/migrate/20200317021758_add_expires_at_to_mutes.rb' - - 'db/migrate/20200407201300_create_unavailable_domains.rb' - - 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb' - - 'db/migrate/20200417125749_add_storage_schema_version.rb' - - 'db/migrate/20200508212852_reset_unique_jobs_locks.rb' - - 'db/migrate/20200510110808_reset_web_app_secret.rb' - - 'db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb' - - 'db/migrate/20200516180352_create_devices.rb' - - 'db/migrate/20200516183822_create_one_time_keys.rb' - - 'db/migrate/20200518083523_create_encrypted_messages.rb' - - 'db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb' - - 'db/migrate/20200529214050_add_devices_url_to_accounts.rb' - - 'db/migrate/20200601222558_create_system_keys.rb' - - 'db/migrate/20200605155027_add_blurhash_to_preview_cards.rb' - - 'db/migrate/20200608113046_add_sign_in_token_to_users.rb' - - 'db/migrate/20200614002136_add_sensitized_to_accounts.rb' - - 'db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb' - - 'db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb' - - 'db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb' - - 'db/migrate/20200628133322_create_account_notes.rb' - - 'db/migrate/20200630190240_create_webauthn_credentials.rb' - - 'db/migrate/20200630190544_add_webauthn_id_to_users.rb' - - 'db/migrate/20200908193330_create_account_deletion_requests.rb' - - 'db/migrate/20200917192924_add_notify_to_follows.rb' - - 'db/migrate/20200917193034_add_type_to_notifications.rb' - - 'db/migrate/20200917222316_add_index_notifications_on_type.rb' - - 'db/migrate/20201008202037_create_ip_blocks.rb' - - 'db/migrate/20201008220312_add_sign_up_ip_to_users.rb' - - 'db/migrate/20201017233919_add_suspension_origin_to_accounts.rb' - - 'db/migrate/20201206004238_create_instances.rb' - - 'db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb' - - 'db/migrate/20210221045109_create_rules.rb' - - 'db/migrate/20210306164523_account_ids_to_timestamp_ids.rb' - - 'db/migrate/20210322164601_create_account_summaries.rb' - - 'db/migrate/20210323114347_create_follow_recommendations.rb' - - 'db/migrate/20210324171613_create_follow_recommendation_suppressions.rb' - - 'db/migrate/20210416200740_create_canonical_email_blocks.rb' - - 'db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb' - - 'db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb' - - 'db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb' - - 'db/migrate/20210609202149_create_login_activities.rb' - - 'db/migrate/20210616214526_create_user_ips.rb' - - 'db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb' - - 'db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb' - - 'db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb' - - 'db/migrate/20210904215403_add_edited_at_to_statuses.rb' - - 'db/migrate/20210908220918_create_status_edits.rb' - - 'db/migrate/20211031031021_create_preview_card_providers.rb' - - 'db/migrate/20211112011713_add_language_to_preview_cards.rb' - - 'db/migrate/20211115032527_add_trendable_to_preview_cards.rb' - - 'db/migrate/20211123212714_add_link_type_to_preview_cards.rb' - - 'db/migrate/20211213040746_update_account_summaries_to_version_2.rb' - - 'db/migrate/20211231080958_add_category_to_reports.rb' - - 'db/migrate/20220105163928_remove_mentions_status_id_index.rb' - - 'db/migrate/20220115125126_add_report_id_to_account_warnings.rb' - - 'db/migrate/20220115125341_fix_account_warning_actions.rb' - - 'db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb' - - 'db/migrate/20220124141035_create_appeals.rb' - - 'db/migrate/20220202200743_add_trendable_to_accounts.rb' - - 'db/migrate/20220202200926_add_trendable_to_statuses.rb' - - 'db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb' - - 'db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb' - - 'db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb' - - 'db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb' - - 'db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb' - - 'db/migrate/20220304195405_migrate_hide_network_preference.rb' - - 'db/migrate/20220307094650_fix_featured_tags_constraints.rb' - - 'db/migrate/20220309213005_fix_reblog_deleted_at.rb' - - 'db/migrate/20220316233212_update_kurdish_locales.rb' - - 'db/migrate/20220428112511_add_index_statuses_on_account_id.rb' - - 'db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb' - - 'db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb' - - 'db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb' - - 'db/migrate/20220606044941_create_webhooks.rb' - - 'db/migrate/20220611210335_create_user_roles.rb' - - 'db/migrate/20220611212541_add_role_id_to_users.rb' - - 'db/migrate/20220710102457_add_display_name_to_tags.rb' - - 'db/migrate/20220714171049_create_tag_follows.rb' - - 'db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb' - - 'db/migrate/20220824233535_create_status_trends.rb' - - 'db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb' - - 'db/migrate/20220829192633_add_languages_to_follows.rb' - - 'db/migrate/20220829192658_add_languages_to_follow_requests.rb' - - 'db/migrate/20221006061337_create_preview_card_trends.rb' - - 'db/migrate/20221012181003_add_blurhash_to_site_uploads.rb' - - 'db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb' - - 'db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb' - - 'db/migrate/20221104133904_add_name_to_featured_tags.rb' - - 'db/post_migrate/20190519130537_remove_boosts_widening_audience.rb' - - 'db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb' - - 'db/post_migrate/20220118183123_remove_rememberable_from_users.rb' - - 'db/seeds/01_web_app.rb' - - 'db/seeds/02_instance_actor.rb' - - 'db/seeds/03_roles.rb' - - 'db/seeds/04_admin.rb' - - 'lib/rails/engine_extensions.rb' - - 'lib/tasks/branding.rake' - - 'spec/fabricators_spec.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). Style/GlobalStdStream: Exclude: diff --git a/app/views/accounts/show.rss.ruby b/app/views/accounts/show.rss.ruby index 7a77511ce..33ba8364b 100644 --- a/app/views/accounts/show.rss.ruby +++ b/app/views/accounts/show.rss.ruby @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSS::Builder.build do |doc| doc.title(display_name(@account)) doc.description(I18n.t('rss.descriptions.account', acct: @account.local_username_and_domain)) diff --git a/app/views/tags/show.rss.ruby b/app/views/tags/show.rss.ruby index bbda1ad4b..5a2b4fb56 100644 --- a/app/views/tags/show.rss.ruby +++ b/app/views/tags/show.rss.ruby @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSS::Builder.build do |doc| doc.title("##{@tag.display_name}") doc.description(I18n.t('rss.descriptions.tag', hashtag: @tag.display_name)) diff --git a/app/views/well_known/host_meta/show.xml.ruby b/app/views/well_known/host_meta/show.xml.ruby index bb5a01a1b..25c5cf394 100644 --- a/app/views/well_known/host_meta/show.xml.ruby +++ b/app/views/well_known/host_meta/show.xml.ruby @@ -1,3 +1,5 @@ +# frozen_string_literal: true + doc = Ox::Document.new(version: '1.0') doc << Ox::Element.new('XRD').tap do |xrd| diff --git a/config/application.rb b/config/application.rb index 8c4ec27e7..26f794203 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'boot' require 'rails' diff --git a/config/boot.rb b/config/boot.rb index 3a1d1d6d2..3e44cbe58 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + unless ENV.key?('RAILS_ENV') STDERR.puts 'ERROR: Missing RAILS_ENV environment variable, please set it to "production", "development", or "test".' exit 1 diff --git a/config/environment.rb b/config/environment.rb index caae5f1a0..637d3829a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Load the Rails application. require_relative 'application' diff --git a/config/environments/development.rb b/config/environments/development.rb index 306324c04..fc46d611d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.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 018d3c1c2..0e45a5f35 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.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 08cc4c4d3..9393d8ad4 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/config/initializers/0_post_deployment_migrations.rb b/config/initializers/0_post_deployment_migrations.rb index 61121ccd7..8e4d63a2e 100644 --- a/config/initializers/0_post_deployment_migrations.rb +++ b/config/initializers/0_post_deployment_migrations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Post deployment migrations are included by default. This file must be loaded # before other initializers as Rails may otherwise memoize a list of migrations # excluding the post deployment migrations. diff --git a/config/initializers/active_model_serializers.rb b/config/initializers/active_model_serializers.rb index 0e69e1d96..46f2bb8b9 100644 --- a/config/initializers/active_model_serializers.rb +++ b/config/initializers/active_model_serializers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveModelSerializers.config.tap do |config| config.default_includes = '**' end diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb index 89d2efab2..f4556db39 100644 --- a/config/initializers/application_controller_renderer.rb +++ b/config/initializers/application_controller_renderer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 53b39718d..9f12d7082 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 33699c309..74f30e887 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/config/initializers/cache_logging.rb b/config/initializers/cache_logging.rb index 08aa80742..4f4b2ebe9 100644 --- a/config/initializers/cache_logging.rb +++ b/config/initializers/cache_logging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Log cache errors with Rail's logger # This used to be the default in old Rails versions: https://github.com/rails/rails/commit/7fcf8590e788cef8b64cc266f75931c418902ca9#diff-f0748f0be8a653eea13369ebb1cadabcad71ede7cfaf20282447e64329817befL86 Rails.cache.logger = Rails.logger diff --git a/config/initializers/chewy.rb b/config/initializers/chewy.rb index daf4a5f32..dc9017621 100644 --- a/config/initializers/chewy.rb +++ b/config/initializers/chewy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + enabled = ENV['ES_ENABLED'] == 'true' host = ENV.fetch('ES_HOST') { 'localhost' } port = ENV.fetch('ES_PORT') { 9200 } diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index a05b67440..adc9adcc3 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Define an application-wide content security policy # For further information see the following documentation # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index 5a6a32d37..ee8dff9c9 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Specify a serializer for the signed and encrypted cookie jars. diff --git a/config/initializers/cors.rb b/config/initializers/cors.rb index 55f8c9c91..1fde35f9d 100644 --- a/config/initializers/cors.rb +++ b/config/initializers/cors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Avoid CORS issues when API is called from the frontend app. diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index d7b252c3f..7bbaff71f 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'devise/strategies/authenticatable' Warden::Manager.after_set_user except: :fetch do |user, warden| diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 43aac5769..a78405ace 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Doorkeeper.configure do # Change the ORM that doorkeeper will use (needs plugins) orm :active_record diff --git a/config/initializers/fast_blank.rb b/config/initializers/fast_blank.rb index f0b7cac78..349fc023c 100644 --- a/config/initializers/fast_blank.rb +++ b/config/initializers/fast_blank.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if String.method_defined?(:blank_as?) class String alias blank? blank_as? diff --git a/config/initializers/ffmpeg.rb b/config/initializers/ffmpeg.rb index cd5914eb5..30ea617fc 100644 --- a/config/initializers/ffmpeg.rb +++ b/config/initializers/ffmpeg.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if ENV['FFMPEG_BINARY'].present? FFMPEG.ffmpeg_binary = ENV['FFMPEG_BINARY'] end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 06cb15bbb..2246442db 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. diff --git a/config/initializers/http_client_proxy.rb b/config/initializers/http_client_proxy.rb index b29e9edd7..7332ffb53 100644 --- a/config/initializers/http_client_proxy.rb +++ b/config/initializers/http_client_proxy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.application.configure do config.x.http_client_proxy = {} diff --git a/config/initializers/httplog.rb b/config/initializers/httplog.rb index 5cfc16a8b..02fcef412 100644 --- a/config/initializers/httplog.rb +++ b/config/initializers/httplog.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + HttpLog.configure do |config| config.logger = Rails.logger config.color = { color: :yellow } diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 95f0b5788..0dad009b1 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/mail_delivery_job.rb b/config/initializers/mail_delivery_job.rb index 327817396..5c8af8421 100644 --- a/config/initializers/mail_delivery_job.rb +++ b/config/initializers/mail_delivery_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActionMailer::MailDeliveryJob.class_eval do discard_on ActiveJob::DeserializationError end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 58a6c0063..b843c09ea 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. Mime::Type.register 'application/json', :json, %w(text/x-json application/jsonrequest application/jrd+json application/activity+json application/ld+json) diff --git a/config/initializers/oj.rb b/config/initializers/oj.rb index de3e17f2e..9b2d90863 100644 --- a/config/initializers/oj.rb +++ b/config/initializers/oj.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Oj.default_options = { mode: :compat, time_format: :ruby, use_to_json: true } diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index c2cd444f0..0f968bd66 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.application.config.middleware.use OmniAuth::Builder do # Vanilla omniauth strategies end diff --git a/config/initializers/open_uri_redirection.rb b/config/initializers/open_uri_redirection.rb index 0e57c53c6..cf1f27c5c 100644 --- a/config/initializers/open_uri_redirection.rb +++ b/config/initializers/open_uri_redirection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open-uri' module OpenURI diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb index 00f64d71b..50bcf4ead 100644 --- a/config/initializers/permissions_policy.rb +++ b/config/initializers/permissions_policy.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Define an application-wide HTTP permissions policy. For further # information see https://developers.google.com/web/updates/2018/06/feature-policy # diff --git a/config/initializers/pghero.rb b/config/initializers/pghero.rb index 0c77d6d0f..dc26397b3 100644 --- a/config/initializers/pghero.rb +++ b/config/initializers/pghero.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + PgHero.show_migrations = Rails.env.development? diff --git a/config/initializers/preload_link_headers.rb b/config/initializers/preload_link_headers.rb index 364a7cc1b..168b88781 100644 --- a/config/initializers/preload_link_headers.rb +++ b/config/initializers/preload_link_headers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Since Rails 6.1, ActionView adds preload links for javascript files # in the Links header per default. diff --git a/config/initializers/premailer_rails.rb b/config/initializers/premailer_rails.rb index 31c02dffa..98b208271 100644 --- a/config/initializers/premailer_rails.rb +++ b/config/initializers/premailer_rails.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative '../../lib/mastodon/premailer_webpack_strategy' Premailer::Rails.config.merge!(remove_ids: true, diff --git a/config/initializers/rack_attack_logging.rb b/config/initializers/rack_attack_logging.rb index ab4822e96..458bc799f 100644 --- a/config/initializers/rack_attack_logging.rb +++ b/config/initializers/rack_attack_logging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ActiveSupport::Notifications.subscribe(/rack_attack/) do |_name, _start, _finish, _request_id, payload| req = payload[:request] diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb index f2bbd1e45..8865d8578 100644 --- a/config/initializers/redis.rb +++ b/config/initializers/redis.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Redis.sadd_returns_boolean = false diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 210964b1f..b29e0a815 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 74034f36f..9d90cc6ca 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Use this setup block to configure all options available in SimpleForm. module AppendComponent diff --git a/config/initializers/stoplight.rb b/config/initializers/stoplight.rb index 8c3c5755a..72fe40600 100644 --- a/config/initializers/stoplight.rb +++ b/config/initializers/stoplight.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'stoplight' Rails.application.reloader.to_prepare do diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb index 3c2afd8cd..aa2f4510c 100644 --- a/config/initializers/trusted_proxies.rb +++ b/config/initializers/trusted_proxies.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rack class Request def trusted_proxy?(ip) diff --git a/config/initializers/twitter_regex.rb b/config/initializers/twitter_regex.rb index 2e80cabcd..4673fbdd4 100644 --- a/config/initializers/twitter_regex.rb +++ b/config/initializers/twitter_regex.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Twitter::TwitterText class Configuration def emoji_parsing_enabled diff --git a/config/initializers/webauthn.rb b/config/initializers/webauthn.rb index a4f027947..924ce6d87 100644 --- a/config/initializers/webauthn.rb +++ b/config/initializers/webauthn.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + WebAuthn.configure do |config| # This value needs to match `window.location.origin` evaluated by # the User Agent during registration and authentication ceremonies. diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index bbfc3961b..2f3c0db47 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/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/locales/sr-Latn.rb b/config/locales/sr-Latn.rb index fc2dafc94..b7a403a8e 100644 --- a/config/locales/sr-Latn.rb +++ b/config/locales/sr-Latn.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_i18n/common_pluralizations/romanian' ::RailsI18n::Pluralization::Romanian.with_locale(:'sr-Latn') diff --git a/config/locales/sr.rb b/config/locales/sr.rb index 86b89a07e..0605de334 100644 --- a/config/locales/sr.rb +++ b/config/locales/sr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_i18n/common_pluralizations/romanian' ::RailsI18n::Pluralization::Romanian.with_locale(:sr) diff --git a/config/puma.rb b/config/puma.rb index c4e2b0b85..ac9ccac20 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + persistent_timeout ENV.fetch('PERSISTENT_TIMEOUT') { 20 }.to_i max_threads_count = ENV.fetch('MAX_THREADS') { 5 }.to_i diff --git a/db/migrate/20160220174730_create_accounts.rb b/db/migrate/20160220174730_create_accounts.rb index daf7c6552..d23ed1f38 100644 --- a/db/migrate/20160220174730_create_accounts.rb +++ b/db/migrate/20160220174730_create_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccounts < ActiveRecord::Migration[4.2] def change create_table :accounts do |t| diff --git a/db/migrate/20160220211917_create_statuses.rb b/db/migrate/20160220211917_create_statuses.rb index b17468568..b8439eff8 100644 --- a/db/migrate/20160220211917_create_statuses.rb +++ b/db/migrate/20160220211917_create_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateStatuses < ActiveRecord::Migration[4.2] def change create_table :statuses do |t| diff --git a/db/migrate/20160221003140_create_users.rb b/db/migrate/20160221003140_create_users.rb index 267466a94..076ee5da3 100644 --- a/db/migrate/20160221003140_create_users.rb +++ b/db/migrate/20160221003140_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/20160221003621_create_follows.rb b/db/migrate/20160221003621_create_follows.rb index 17287d09b..65d745e70 100644 --- a/db/migrate/20160221003621_create_follows.rb +++ b/db/migrate/20160221003621_create_follows.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateFollows < ActiveRecord::Migration[4.2] def change create_table :follows do |t| diff --git a/db/migrate/20160222122600_create_stream_entries.rb b/db/migrate/20160222122600_create_stream_entries.rb index 00782abc3..598cc469e 100644 --- a/db/migrate/20160222122600_create_stream_entries.rb +++ b/db/migrate/20160222122600_create_stream_entries.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateStreamEntries < ActiveRecord::Migration[4.2] def change create_table :stream_entries do |t| diff --git a/db/migrate/20160222143943_add_profile_fields_to_accounts.rb b/db/migrate/20160222143943_add_profile_fields_to_accounts.rb index cf279a535..058eb702c 100644 --- a/db/migrate/20160222143943_add_profile_fields_to_accounts.rb +++ b/db/migrate/20160222143943_add_profile_fields_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddProfileFieldsToAccounts < ActiveRecord::Migration[4.2] def change add_column :accounts, :note, :text, null: false, default: '' diff --git a/db/migrate/20160223162837_add_metadata_to_statuses.rb b/db/migrate/20160223162837_add_metadata_to_statuses.rb index d11d5f5cd..c564d6942 100644 --- a/db/migrate/20160223162837_add_metadata_to_statuses.rb +++ b/db/migrate/20160223162837_add_metadata_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddMetadataToStatuses < ActiveRecord::Migration[4.2] def change add_column :statuses, :in_reply_to_id, :integer, null: true diff --git a/db/migrate/20160223164502_make_uris_nullable_in_statuses.rb b/db/migrate/20160223164502_make_uris_nullable_in_statuses.rb index 24b9b6e19..fff07093c 100644 --- a/db/migrate/20160223164502_make_uris_nullable_in_statuses.rb +++ b/db/migrate/20160223164502_make_uris_nullable_in_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MakeUrisNullableInStatuses < ActiveRecord::Migration[4.2] def change change_column :statuses, :uri, :string, null: true, default: nil diff --git a/db/migrate/20160223165723_add_url_to_statuses.rb b/db/migrate/20160223165723_add_url_to_statuses.rb index fee7f9c59..6e4884afa 100644 --- a/db/migrate/20160223165723_add_url_to_statuses.rb +++ b/db/migrate/20160223165723_add_url_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddURLToStatuses < ActiveRecord::Migration[4.2] def change add_column :statuses, :url, :string, null: true, default: nil diff --git a/db/migrate/20160223165855_add_url_to_accounts.rb b/db/migrate/20160223165855_add_url_to_accounts.rb index a4db8814a..a6d0e5003 100644 --- a/db/migrate/20160223165855_add_url_to_accounts.rb +++ b/db/migrate/20160223165855_add_url_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddURLToAccounts < ActiveRecord::Migration[4.2] def change add_column :accounts, :url, :string, null: true, default: nil diff --git a/db/migrate/20160223171800_create_favourites.rb b/db/migrate/20160223171800_create_favourites.rb index 64f5cf119..dda1c3080 100644 --- a/db/migrate/20160223171800_create_favourites.rb +++ b/db/migrate/20160223171800_create_favourites.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateFavourites < ActiveRecord::Migration[4.2] def change create_table :favourites do |t| diff --git a/db/migrate/20160224223247_create_mentions.rb b/db/migrate/20160224223247_create_mentions.rb index 6dd742d3b..92df6d01d 100644 --- a/db/migrate/20160224223247_create_mentions.rb +++ b/db/migrate/20160224223247_create_mentions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateMentions < ActiveRecord::Migration[4.2] def change create_table :mentions do |t| diff --git a/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb b/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb index c107c4c7f..3666abf1c 100644 --- a/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb +++ b/db/migrate/20160227230233_add_attachment_avatar_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAttachmentAvatarToAccounts < ActiveRecord::Migration[4.2] def self.up change_table :accounts do |t| diff --git a/db/migrate/20160305115639_add_devise_to_users.rb b/db/migrate/20160305115639_add_devise_to_users.rb index fa1e521b2..5b9a817c6 100644 --- a/db/migrate/20160305115639_add_devise_to_users.rb +++ b/db/migrate/20160305115639_add_devise_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDeviseToUsers < ActiveRecord::Migration[4.2] def self.up change_table(:users) do |t| diff --git a/db/migrate/20160306172223_create_doorkeeper_tables.rb b/db/migrate/20160306172223_create_doorkeeper_tables.rb index 462343e88..0137520d2 100644 --- a/db/migrate/20160306172223_create_doorkeeper_tables.rb +++ b/db/migrate/20160306172223_create_doorkeeper_tables.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateDoorkeeperTables < ActiveRecord::Migration[4.2] def change create_table :oauth_applications do |t| diff --git a/db/migrate/20160312193225_add_attachment_header_to_accounts.rb b/db/migrate/20160312193225_add_attachment_header_to_accounts.rb index ac9562cbb..37108fc18 100644 --- a/db/migrate/20160312193225_add_attachment_header_to_accounts.rb +++ b/db/migrate/20160312193225_add_attachment_header_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAttachmentHeaderToAccounts < ActiveRecord::Migration[4.2] def self.up change_table :accounts do |t| diff --git a/db/migrate/20160314164231_add_owner_to_application.rb b/db/migrate/20160314164231_add_owner_to_application.rb index 553c18b5e..d4eda38df 100644 --- a/db/migrate/20160314164231_add_owner_to_application.rb +++ b/db/migrate/20160314164231_add_owner_to_application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddOwnerToApplication < ActiveRecord::Migration[4.2] def change add_column :oauth_applications, :owner_id, :integer, null: true diff --git a/db/migrate/20160316103650_add_missing_indices.rb b/db/migrate/20160316103650_add_missing_indices.rb index 8b6bc5771..76ac7e390 100644 --- a/db/migrate/20160316103650_add_missing_indices.rb +++ b/db/migrate/20160316103650_add_missing_indices.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddMissingIndices < ActiveRecord::Migration[4.2] def change add_index :users, :account_id diff --git a/db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb b/db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb index 0792863a3..fbfd0fc2d 100644 --- a/db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb +++ b/db/migrate/20160322193748_add_avatar_remote_url_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAvatarRemoteURLToAccounts < ActiveRecord::Migration[4.2] def change add_column :accounts, :avatar_remote_url, :string, null: true, default: nil diff --git a/db/migrate/20160325130944_add_admin_to_users.rb b/db/migrate/20160325130944_add_admin_to_users.rb index b0cd35e00..6b701ebcc 100644 --- a/db/migrate/20160325130944_add_admin_to_users.rb +++ b/db/migrate/20160325130944_add_admin_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAdminToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :admin, :boolean, default: false diff --git a/db/migrate/20160826155805_add_superapp_to_oauth_applications.rb b/db/migrate/20160826155805_add_superapp_to_oauth_applications.rb index a1b92fada..af8bd922f 100644 --- a/db/migrate/20160826155805_add_superapp_to_oauth_applications.rb +++ b/db/migrate/20160826155805_add_superapp_to_oauth_applications.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSuperappToOauthApplications < ActiveRecord::Migration[5.0] def change add_column :oauth_applications, :superapp, :boolean, default: false, null: false diff --git a/db/migrate/20160905150353_create_media_attachments.rb b/db/migrate/20160905150353_create_media_attachments.rb index 32d0897d8..3903a7b9a 100644 --- a/db/migrate/20160905150353_create_media_attachments.rb +++ b/db/migrate/20160905150353_create_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateMediaAttachments < ActiveRecord::Migration[5.0] def change create_table :media_attachments do |t| diff --git a/db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb b/db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb index 5fd7f39e6..12aaffa97 100644 --- a/db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb +++ b/db/migrate/20160919221059_add_subscription_expires_at_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSubscriptionExpiresAtToAccounts < ActiveRecord::Migration[5.0] def change add_column :accounts, :subscription_expires_at, :datetime, null: true, default: nil diff --git a/db/migrate/20160920003904_remove_verify_token_from_accounts.rb b/db/migrate/20160920003904_remove_verify_token_from_accounts.rb index ab6a6c84c..132b4c974 100644 --- a/db/migrate/20160920003904_remove_verify_token_from_accounts.rb +++ b/db/migrate/20160920003904_remove_verify_token_from_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveVerifyTokenFromAccounts < ActiveRecord::Migration[5.0] def change remove_column :accounts, :verify_token, :string, null: false, default: '' diff --git a/db/migrate/20160926213048_remove_owner_from_application.rb b/db/migrate/20160926213048_remove_owner_from_application.rb index a42f53a29..0be01dc4c 100644 --- a/db/migrate/20160926213048_remove_owner_from_application.rb +++ b/db/migrate/20160926213048_remove_owner_from_application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveOwnerFromApplication < ActiveRecord::Migration[5.0] def change remove_index :oauth_applications, [:owner_id, :owner_type] diff --git a/db/migrate/20161003142332_add_confirmable_to_users.rb b/db/migrate/20161003142332_add_confirmable_to_users.rb index cbef4c4df..b33c9eada 100644 --- a/db/migrate/20161003142332_add_confirmable_to_users.rb +++ b/db/migrate/20161003142332_add_confirmable_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddConfirmableToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :confirmation_token, :string diff --git a/db/migrate/20161003145426_create_blocks.rb b/db/migrate/20161003145426_create_blocks.rb index 14bae1e7f..fec513c65 100644 --- a/db/migrate/20161003145426_create_blocks.rb +++ b/db/migrate/20161003145426_create_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateBlocks < ActiveRecord::Migration[5.0] def change create_table :blocks do |t| diff --git a/db/migrate/20161006213403_rails_settings_migration.rb b/db/migrate/20161006213403_rails_settings_migration.rb index 02932610c..401b7a83b 100644 --- a/db/migrate/20161006213403_rails_settings_migration.rb +++ b/db/migrate/20161006213403_rails_settings_migration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + MIGRATION_BASE_CLASS = if ActiveRecord::VERSION::MAJOR >= 5 ActiveRecord::Migration[5.0] else diff --git a/db/migrate/20161009120834_create_domain_blocks.rb b/db/migrate/20161009120834_create_domain_blocks.rb index dda1606d3..9006f601a 100644 --- a/db/migrate/20161009120834_create_domain_blocks.rb +++ b/db/migrate/20161009120834_create_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateDomainBlocks < ActiveRecord::Migration[5.0] def change create_table :domain_blocks do |t| diff --git a/db/migrate/20161027172456_add_silenced_to_accounts.rb b/db/migrate/20161027172456_add_silenced_to_accounts.rb index cd3b9f8d0..1b06d381f 100644 --- a/db/migrate/20161027172456_add_silenced_to_accounts.rb +++ b/db/migrate/20161027172456_add_silenced_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSilencedToAccounts < ActiveRecord::Migration[5.0] def change add_column :accounts, :silenced, :boolean, null: false, default: false diff --git a/db/migrate/20161104173623_create_tags.rb b/db/migrate/20161104173623_create_tags.rb index d6831ff8f..d8f120956 100644 --- a/db/migrate/20161104173623_create_tags.rb +++ b/db/migrate/20161104173623_create_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateTags < ActiveRecord::Migration[5.0] def change create_table :tags do |t| diff --git a/db/migrate/20161105130633_create_statuses_tags_join_table.rb b/db/migrate/20161105130633_create_statuses_tags_join_table.rb index 8a436c6ea..b140f84c4 100644 --- a/db/migrate/20161105130633_create_statuses_tags_join_table.rb +++ b/db/migrate/20161105130633_create_statuses_tags_join_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateStatusesTagsJoinTable < ActiveRecord::Migration[5.0] def change create_join_table :statuses, :tags do |t| diff --git a/db/migrate/20161116162355_add_locale_to_users.rb b/db/migrate/20161116162355_add_locale_to_users.rb index ec1a42ef1..ce8e55119 100644 --- a/db/migrate/20161116162355_add_locale_to_users.rb +++ b/db/migrate/20161116162355_add_locale_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLocaleToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :locale, :string diff --git a/db/migrate/20161119211120_create_notifications.rb b/db/migrate/20161119211120_create_notifications.rb index e6bf1d66e..5f2e8e71b 100644 --- a/db/migrate/20161119211120_create_notifications.rb +++ b/db/migrate/20161119211120_create_notifications.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateNotifications < ActiveRecord::Migration[5.0] def change create_table :notifications do |t| diff --git a/db/migrate/20161122163057_remove_unneeded_indexes.rb b/db/migrate/20161122163057_remove_unneeded_indexes.rb index 12cc9c5b2..7ed92127d 100644 --- a/db/migrate/20161122163057_remove_unneeded_indexes.rb +++ b/db/migrate/20161122163057_remove_unneeded_indexes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveUnneededIndexes < ActiveRecord::Migration[5.0] def change remove_index :notifications, name: 'index_notifications_on_account_id' diff --git a/db/migrate/20161123093447_add_sensitive_to_statuses.rb b/db/migrate/20161123093447_add_sensitive_to_statuses.rb index 109f761ed..7487b2ee3 100644 --- a/db/migrate/20161123093447_add_sensitive_to_statuses.rb +++ b/db/migrate/20161123093447_add_sensitive_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSensitiveToStatuses < ActiveRecord::Migration[5.0] def change add_column :statuses, :sensitive, :boolean, default: false diff --git a/db/migrate/20161128103007_create_subscriptions.rb b/db/migrate/20161128103007_create_subscriptions.rb index 46443680a..c6ddc5d3e 100644 --- a/db/migrate/20161128103007_create_subscriptions.rb +++ b/db/migrate/20161128103007_create_subscriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateSubscriptions < ActiveRecord::Migration[5.0] def change create_table :subscriptions do |t| diff --git a/db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb b/db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb index 614155b91..6f06794f6 100644 --- a/db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb +++ b/db/migrate/20161130142058_add_last_successful_delivery_at_to_subscriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLastSuccessfulDeliveryAtToSubscriptions < ActiveRecord::Migration[5.0] def change add_column :subscriptions, :last_successful_delivery_at, :datetime, null: true, default: nil diff --git a/db/migrate/20161130185319_add_visibility_to_statuses.rb b/db/migrate/20161130185319_add_visibility_to_statuses.rb index 3ad2abe01..e38755b56 100644 --- a/db/migrate/20161130185319_add_visibility_to_statuses.rb +++ b/db/migrate/20161130185319_add_visibility_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddVisibilityToStatuses < ActiveRecord::Migration[5.0] def change add_column :statuses, :visibility, :integer, null: false, default: 0 diff --git a/db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb b/db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb index 3a559ccd6..111c48610 100644 --- a/db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb +++ b/db/migrate/20161202132159_add_in_reply_to_account_id_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddInReplyToAccountIdToStatuses < ActiveRecord::Migration[5.0] def up add_column :statuses, :in_reply_to_account_id, :integer, null: true, default: nil diff --git a/db/migrate/20161203164520_add_from_account_id_to_notifications.rb b/db/migrate/20161203164520_add_from_account_id_to_notifications.rb index 142adbe9c..484cb9f4d 100644 --- a/db/migrate/20161203164520_add_from_account_id_to_notifications.rb +++ b/db/migrate/20161203164520_add_from_account_id_to_notifications.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddFromAccountIdToNotifications < ActiveRecord::Migration[5.0] def up add_column :notifications, :from_account_id, :integer diff --git a/db/migrate/20161205214545_add_suspended_to_accounts.rb b/db/migrate/20161205214545_add_suspended_to_accounts.rb index 0d7e2beac..d389cd0e3 100644 --- a/db/migrate/20161205214545_add_suspended_to_accounts.rb +++ b/db/migrate/20161205214545_add_suspended_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSuspendedToAccounts < ActiveRecord::Migration[5.0] def change add_column :accounts, :suspended, :boolean, null: false, default: false diff --git a/db/migrate/20161221152630_add_hidden_to_stream_entries.rb b/db/migrate/20161221152630_add_hidden_to_stream_entries.rb index 0d2def7f8..c3e0bb454 100644 --- a/db/migrate/20161221152630_add_hidden_to_stream_entries.rb +++ b/db/migrate/20161221152630_add_hidden_to_stream_entries.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddHiddenToStreamEntries < ActiveRecord::Migration[5.0] def change add_column :stream_entries, :hidden, :boolean, null: false, default: false diff --git a/db/migrate/20161222201034_add_locked_to_accounts.rb b/db/migrate/20161222201034_add_locked_to_accounts.rb index c246a90ce..367dbb395 100644 --- a/db/migrate/20161222201034_add_locked_to_accounts.rb +++ b/db/migrate/20161222201034_add_locked_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLockedToAccounts < ActiveRecord::Migration[5.0] def change add_column :accounts, :locked, :boolean, null: false, default: false diff --git a/db/migrate/20161222204147_create_follow_requests.rb b/db/migrate/20161222204147_create_follow_requests.rb index fbe5edf3d..572c2215f 100644 --- a/db/migrate/20161222204147_create_follow_requests.rb +++ b/db/migrate/20161222204147_create_follow_requests.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateFollowRequests < ActiveRecord::Migration[5.0] def change create_table :follow_requests do |t| diff --git a/db/migrate/20170105224407_add_shortcode_to_media_attachments.rb b/db/migrate/20170105224407_add_shortcode_to_media_attachments.rb index fba46a4b6..5f1dd62af 100644 --- a/db/migrate/20170105224407_add_shortcode_to_media_attachments.rb +++ b/db/migrate/20170105224407_add_shortcode_to_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddShortcodeToMediaAttachments < ActiveRecord::Migration[5.0] def up add_column :media_attachments, :shortcode, :string, null: true, default: nil diff --git a/db/migrate/20170109120109_create_web_settings.rb b/db/migrate/20170109120109_create_web_settings.rb index 2aeae1f91..75ad5fa91 100644 --- a/db/migrate/20170109120109_create_web_settings.rb +++ b/db/migrate/20170109120109_create_web_settings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateWebSettings < ActiveRecord::Migration[5.0] def change create_table :web_settings do |t| diff --git a/db/migrate/20170112154826_migrate_settings.rb b/db/migrate/20170112154826_migrate_settings.rb index 0f5afe1d3..a1dc0fe4e 100644 --- a/db/migrate/20170112154826_migrate_settings.rb +++ b/db/migrate/20170112154826_migrate_settings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MigrateSettings < ActiveRecord::Migration[4.2] def up remove_index :settings, [:target_type, :target_id, :var] diff --git a/db/migrate/20170114194937_add_application_to_statuses.rb b/db/migrate/20170114194937_add_application_to_statuses.rb index b699db2ac..c8e8310c1 100644 --- a/db/migrate/20170114194937_add_application_to_statuses.rb +++ b/db/migrate/20170114194937_add_application_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddApplicationToStatuses < ActiveRecord::Migration[5.0] def change add_column :statuses, :application_id, :int diff --git a/db/migrate/20170114203041_add_website_to_oauth_application.rb b/db/migrate/20170114203041_add_website_to_oauth_application.rb index ee674be72..5a0f2b790 100644 --- a/db/migrate/20170114203041_add_website_to_oauth_application.rb +++ b/db/migrate/20170114203041_add_website_to_oauth_application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddWebsiteToOauthApplication < ActiveRecord::Migration[5.0] def change add_column :oauth_applications, :website, :string diff --git a/db/migrate/20170119214911_create_preview_cards.rb b/db/migrate/20170119214911_create_preview_cards.rb index 70ed91bbd..41a4da6b3 100644 --- a/db/migrate/20170119214911_create_preview_cards.rb +++ b/db/migrate/20170119214911_create_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreatePreviewCards < ActiveRecord::Migration[5.0] def change create_table :preview_cards do |t| diff --git a/db/migrate/20170123162658_add_severity_to_domain_blocks.rb b/db/migrate/20170123162658_add_severity_to_domain_blocks.rb index dcbc32a1a..3bdee4458 100644 --- a/db/migrate/20170123162658_add_severity_to_domain_blocks.rb +++ b/db/migrate/20170123162658_add_severity_to_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSeverityToDomainBlocks < ActiveRecord::Migration[5.0] def change add_column :domain_blocks, :severity, :integer, default: 0 diff --git a/db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb b/db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb index 999fccda0..5282602ce 100644 --- a/db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb +++ b/db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0] def change add_column :domain_blocks, :reject_media, :boolean diff --git a/db/migrate/20170125145934_add_spoiler_text_to_statuses.rb b/db/migrate/20170125145934_add_spoiler_text_to_statuses.rb index 39cd41c00..7d46af300 100644 --- a/db/migrate/20170125145934_add_spoiler_text_to_statuses.rb +++ b/db/migrate/20170125145934_add_spoiler_text_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSpoilerTextToStatuses < ActiveRecord::Migration[5.0] def change add_column :statuses, :spoiler_text, :text, default: '', null: false diff --git a/db/migrate/20170127165745_add_devise_two_factor_to_users.rb b/db/migrate/20170127165745_add_devise_two_factor_to_users.rb index f4183e4a9..f4eb72a6b 100644 --- a/db/migrate/20170127165745_add_devise_two_factor_to_users.rb +++ b/db/migrate/20170127165745_add_devise_two_factor_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDeviseTwoFactorToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :encrypted_otp_secret, :string diff --git a/db/migrate/20170205175257_remove_devices.rb b/db/migrate/20170205175257_remove_devices.rb index 9ef5c440e..643e196bf 100644 --- a/db/migrate/20170205175257_remove_devices.rb +++ b/db/migrate/20170205175257_remove_devices.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveDevices < ActiveRecord::Migration[5.0] def change drop_table :devices if table_exists?(:devices) diff --git a/db/migrate/20170209184350_add_reply_to_statuses.rb b/db/migrate/20170209184350_add_reply_to_statuses.rb index b8b5c1306..ffef97609 100644 --- a/db/migrate/20170209184350_add_reply_to_statuses.rb +++ b/db/migrate/20170209184350_add_reply_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddReplyToStatuses < ActiveRecord::Migration[5.0] def up add_column :statuses, :reply, :boolean, nil: false, default: false diff --git a/db/migrate/20170214110202_create_reports.rb b/db/migrate/20170214110202_create_reports.rb index aa772803b..547fbf203 100644 --- a/db/migrate/20170214110202_create_reports.rb +++ b/db/migrate/20170214110202_create_reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateReports < ActiveRecord::Migration[5.0] def change create_table :reports do |t| diff --git a/db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb b/db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb index 175d4048f..21007a920 100644 --- a/db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb +++ b/db/migrate/20170217012631_add_reblog_of_id_foreign_key_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddReblogOfIdForeignKeyToStatuses < ActiveRecord::Migration[5.0] def change add_foreign_key :statuses, :statuses, column: :reblog_of_id, on_delete: :cascade diff --git a/db/migrate/20170301222600_create_mutes.rb b/db/migrate/20170301222600_create_mutes.rb index 4c27eca1e..56c0b5213 100644 --- a/db/migrate/20170301222600_create_mutes.rb +++ b/db/migrate/20170301222600_create_mutes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateMutes < ActiveRecord::Migration[5.0] def change create_table :mutes do |t| diff --git a/db/migrate/20170303212857_add_last_emailed_at_to_users.rb b/db/migrate/20170303212857_add_last_emailed_at_to_users.rb index 9ae3da4fb..c288140ce 100644 --- a/db/migrate/20170303212857_add_last_emailed_at_to_users.rb +++ b/db/migrate/20170303212857_add_last_emailed_at_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLastEmailedAtToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :last_emailed_at, :datetime, null: true, default: nil diff --git a/db/migrate/20170304202101_add_type_to_media_attachments.rb b/db/migrate/20170304202101_add_type_to_media_attachments.rb index 514079958..bbf14f515 100644 --- a/db/migrate/20170304202101_add_type_to_media_attachments.rb +++ b/db/migrate/20170304202101_add_type_to_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTypeToMediaAttachments < ActiveRecord::Migration[5.0] def up add_column :media_attachments, :type, :integer, default: 0, null: false diff --git a/db/migrate/20170317193015_add_search_index_to_accounts.rb b/db/migrate/20170317193015_add_search_index_to_accounts.rb index 14e174147..e29da61b1 100644 --- a/db/migrate/20170317193015_add_search_index_to_accounts.rb +++ b/db/migrate/20170317193015_add_search_index_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSearchIndexToAccounts < ActiveRecord::Migration[5.0] def up execute 'CREATE INDEX search_index ON accounts USING gin((setweight(to_tsvector(\'simple\', accounts.display_name), \'A\') || setweight(to_tsvector(\'simple\', accounts.username), \'B\') || setweight(to_tsvector(\'simple\', coalesce(accounts.domain, \'\')), \'C\')));' diff --git a/db/migrate/20170318214217_add_header_remote_url_to_accounts.rb b/db/migrate/20170318214217_add_header_remote_url_to_accounts.rb index 20c965988..e9c986368 100644 --- a/db/migrate/20170318214217_add_header_remote_url_to_accounts.rb +++ b/db/migrate/20170318214217_add_header_remote_url_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddHeaderRemoteURLToAccounts < ActiveRecord::Migration[5.0] def change add_column :accounts, :header_remote_url, :string, null: false, default: '' diff --git a/db/migrate/20170322021028_add_lowercase_index_to_accounts.rb b/db/migrate/20170322021028_add_lowercase_index_to_accounts.rb index 43032747a..16f9aab01 100644 --- a/db/migrate/20170322021028_add_lowercase_index_to_accounts.rb +++ b/db/migrate/20170322021028_add_lowercase_index_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLowercaseIndexToAccounts < ActiveRecord::Migration[5.0] def up execute 'CREATE INDEX index_accounts_on_username_and_domain_lower ON accounts (lower(username), lower(domain))' diff --git a/db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb b/db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb index 16b5db7dd..09959100a 100644 --- a/db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb +++ b/db/migrate/20170322143850_change_primary_key_to_bigint_on_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangePrimaryKeyToBigintOnStatuses < ActiveRecord::Migration[5.0] def change change_column :statuses, :id, :bigint diff --git a/db/migrate/20170322162804_add_search_index_to_tags.rb b/db/migrate/20170322162804_add_search_index_to_tags.rb index 415dff9a0..87ae87ead 100644 --- a/db/migrate/20170322162804_add_search_index_to_tags.rb +++ b/db/migrate/20170322162804_add_search_index_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSearchIndexToTags < ActiveRecord::Migration[5.0] def up execute 'CREATE INDEX hashtag_search_index ON tags USING gin(to_tsvector(\'simple\', tags.name));' diff --git a/db/migrate/20170330021336_add_counter_caches.rb b/db/migrate/20170330021336_add_counter_caches.rb index cf064b9e1..a9e496ad2 100644 --- a/db/migrate/20170330021336_add_counter_caches.rb +++ b/db/migrate/20170330021336_add_counter_caches.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCounterCaches < ActiveRecord::Migration[5.0] def change add_column :statuses, :favourites_count, :integer, null: false, default: 0 diff --git a/db/migrate/20170330163835_create_imports.rb b/db/migrate/20170330163835_create_imports.rb index d6f74823d..6bd9e28b5 100644 --- a/db/migrate/20170330163835_create_imports.rb +++ b/db/migrate/20170330163835_create_imports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateImports < ActiveRecord::Migration[5.0] def change create_table :imports do |t| diff --git a/db/migrate/20170330164118_add_attachment_data_to_imports.rb b/db/migrate/20170330164118_add_attachment_data_to_imports.rb index 2deda1886..908d4da96 100644 --- a/db/migrate/20170330164118_add_attachment_data_to_imports.rb +++ b/db/migrate/20170330164118_add_attachment_data_to_imports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAttachmentDataToImports < ActiveRecord::Migration[4.2] def self.up change_table :imports do |t| diff --git a/db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb b/db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb index 2d4e12198..9afe7b960 100644 --- a/db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb +++ b/db/migrate/20170403172249_add_action_taken_by_account_id_to_reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddActionTakenByAccountIdToReports < ActiveRecord::Migration[5.0] def change add_column :reports, :action_taken_by_account_id, :integer diff --git a/db/migrate/20170405112956_add_index_on_mentions_status_id.rb b/db/migrate/20170405112956_add_index_on_mentions_status_id.rb index 3ed1a20cf..20f783517 100644 --- a/db/migrate/20170405112956_add_index_on_mentions_status_id.rb +++ b/db/migrate/20170405112956_add_index_on_mentions_status_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexOnMentionsStatusId < ActiveRecord::Migration[5.0] def change add_index :mentions, :status_id diff --git a/db/migrate/20170406215816_add_notifications_and_favourites_indices.rb b/db/migrate/20170406215816_add_notifications_and_favourites_indices.rb index 00e41bf3a..29df295d2 100644 --- a/db/migrate/20170406215816_add_notifications_and_favourites_indices.rb +++ b/db/migrate/20170406215816_add_notifications_and_favourites_indices.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddNotificationsAndFavouritesIndices < ActiveRecord::Migration[5.0] def change add_index :notifications, [:activity_id, :activity_type] diff --git a/db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb b/db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb index 08c916fe2..6b66911e1 100644 --- a/db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb +++ b/db/migrate/20170409170753_add_last_webfingered_at_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLastWebfingeredAtToAccounts < ActiveRecord::Migration[5.0] def change add_column :accounts, :last_webfingered_at, :datetime diff --git a/db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb b/db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb index 65517d9f4..ee9db3434 100644 --- a/db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb +++ b/db/migrate/20170414080609_add_devise_two_factor_backupable_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDeviseTwoFactorBackupableToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :otp_backup_codes, :string, array: true diff --git a/db/migrate/20170414132105_add_language_to_statuses.rb b/db/migrate/20170414132105_add_language_to_statuses.rb index 59d51cb86..43bff1f0e 100644 --- a/db/migrate/20170414132105_add_language_to_statuses.rb +++ b/db/migrate/20170414132105_add_language_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLanguageToStatuses < ActiveRecord::Migration[5.0] def change add_column :statuses, :language, :string, null: false, default: 'en' diff --git a/db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb b/db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb index cd69bb8b1..cf0817829 100644 --- a/db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb +++ b/db/migrate/20170418160728_add_indexes_to_reports_for_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexesToReportsForAccounts < ActiveRecord::Migration[5.0] def change add_index :reports, :account_id diff --git a/db/migrate/20170423005413_add_allowed_languages_to_user.rb b/db/migrate/20170423005413_add_allowed_languages_to_user.rb index 044a13334..134815f3e 100644 --- a/db/migrate/20170423005413_add_allowed_languages_to_user.rb +++ b/db/migrate/20170423005413_add_allowed_languages_to_user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAllowedLanguagesToUser < ActiveRecord::Migration[5.0] def change add_column :users, :allowed_languages, :string, array: true, default: [], null: false diff --git a/db/migrate/20170424003227_create_account_domain_blocks.rb b/db/migrate/20170424003227_create_account_domain_blocks.rb index b9448aca4..ebdf0eeb2 100644 --- a/db/migrate/20170424003227_create_account_domain_blocks.rb +++ b/db/migrate/20170424003227_create_account_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountDomainBlocks < ActiveRecord::Migration[5.0] def change create_table :account_domain_blocks do |t| diff --git a/db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb b/db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb index d1db8cc62..83bb55373 100644 --- a/db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb +++ b/db/migrate/20170424112722_add_status_id_index_to_statuses_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddStatusIdIndexToStatusesTags < ActiveRecord::Migration[5.0] def change add_index :statuses_tags, :status_id diff --git a/db/migrate/20170425131920_add_media_attachment_meta.rb b/db/migrate/20170425131920_add_media_attachment_meta.rb index c4da65635..0cc6997ee 100644 --- a/db/migrate/20170425131920_add_media_attachment_meta.rb +++ b/db/migrate/20170425131920_add_media_attachment_meta.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddMediaAttachmentMeta < ActiveRecord::Migration[5.0] def change add_column :media_attachments, :file_meta, :json diff --git a/db/migrate/20170425202925_add_oembed_to_preview_cards.rb b/db/migrate/20170425202925_add_oembed_to_preview_cards.rb index 6a932bbf2..f71d2c27e 100644 --- a/db/migrate/20170425202925_add_oembed_to_preview_cards.rb +++ b/db/migrate/20170425202925_add_oembed_to_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddOEmbedToPreviewCards < ActiveRecord::Migration[5.0] def change add_column :preview_cards, :type, :integer, default: 0, null: false diff --git a/db/migrate/20170427011934_re_add_owner_to_application.rb b/db/migrate/20170427011934_re_add_owner_to_application.rb index a41d71d2a..182ce36d2 100644 --- a/db/migrate/20170427011934_re_add_owner_to_application.rb +++ b/db/migrate/20170427011934_re_add_owner_to_application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ReAddOwnerToApplication < ActiveRecord::Migration[5.0] def change add_column :oauth_applications, :owner_id, :integer, null: true diff --git a/db/migrate/20170506235850_create_conversations.rb b/db/migrate/20170506235850_create_conversations.rb index eaf66ded7..92fd3f327 100644 --- a/db/migrate/20170506235850_create_conversations.rb +++ b/db/migrate/20170506235850_create_conversations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateConversations < ActiveRecord::Migration[5.0] def change create_table :conversations, id: :bigserial do |t| diff --git a/db/migrate/20170507000211_add_conversation_id_to_statuses.rb b/db/migrate/20170507000211_add_conversation_id_to_statuses.rb index d1ef7c290..4cf7fb5e5 100644 --- a/db/migrate/20170507000211_add_conversation_id_to_statuses.rb +++ b/db/migrate/20170507000211_add_conversation_id_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddConversationIdToStatuses < ActiveRecord::Migration[5.0] def change add_column :statuses, :conversation_id, :bigint, null: true, default: nil diff --git a/db/migrate/20170507141759_optimize_index_subscriptions.rb b/db/migrate/20170507141759_optimize_index_subscriptions.rb index 26acd5c4d..cf0305fc7 100644 --- a/db/migrate/20170507141759_optimize_index_subscriptions.rb +++ b/db/migrate/20170507141759_optimize_index_subscriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class OptimizeIndexSubscriptions < ActiveRecord::Migration[5.0] def up add_index :subscriptions, [:account_id, :callback_url], unique: true diff --git a/db/migrate/20170508230434_create_conversation_mutes.rb b/db/migrate/20170508230434_create_conversation_mutes.rb index 81edf2733..01122c451 100644 --- a/db/migrate/20170508230434_create_conversation_mutes.rb +++ b/db/migrate/20170508230434_create_conversation_mutes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateConversationMutes < ActiveRecord::Migration[5.0] def change create_table :conversation_mutes do |t| diff --git a/db/migrate/20170516072309_add_index_accounts_on_uri.rb b/db/migrate/20170516072309_add_index_accounts_on_uri.rb index d98e9faa5..19c4a1400 100644 --- a/db/migrate/20170516072309_add_index_accounts_on_uri.rb +++ b/db/migrate/20170516072309_add_index_accounts_on_uri.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexAccountsOnUri < ActiveRecord::Migration[5.0] def change add_index :accounts, :uri diff --git a/db/migrate/20170520145338_change_language_filter_to_opt_out.rb b/db/migrate/20170520145338_change_language_filter_to_opt_out.rb index 8dac98ee8..12e045480 100644 --- a/db/migrate/20170520145338_change_language_filter_to_opt_out.rb +++ b/db/migrate/20170520145338_change_language_filter_to_opt_out.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeLanguageFilterToOptOut < ActiveRecord::Migration[5.0] def change remove_index :users, :allowed_languages diff --git a/db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb b/db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb index c51ab28e5..a0ce062ea 100644 --- a/db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb +++ b/db/migrate/20170601210557_add_index_on_media_attachments_account_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexOnMediaAttachmentsAccountId < ActiveRecord::Migration[5.1] def change add_index :media_attachments, :account_id diff --git a/db/migrate/20170604144747_add_foreign_keys_for_accounts.rb b/db/migrate/20170604144747_add_foreign_keys_for_accounts.rb index 76a836ca0..039679ec5 100644 --- a/db/migrate/20170604144747_add_foreign_keys_for_accounts.rb +++ b/db/migrate/20170604144747_add_foreign_keys_for_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddForeignKeysForAccounts < ActiveRecord::Migration[5.1] def change add_foreign_key :statuses, :accounts, on_delete: :cascade diff --git a/db/migrate/20170606113804_change_tag_search_index_to_btree.rb b/db/migrate/20170606113804_change_tag_search_index_to_btree.rb index 979df2e74..12ebbde60 100644 --- a/db/migrate/20170606113804_change_tag_search_index_to_btree.rb +++ b/db/migrate/20170606113804_change_tag_search_index_to_btree.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeTagSearchIndexToBtree < ActiveRecord::Migration[5.1] def up remove_index :tags, name: :hashtag_search_index diff --git a/db/migrate/20170609145826_remove_default_language_from_statuses.rb b/db/migrate/20170609145826_remove_default_language_from_statuses.rb index 46b90ae89..28b4172a8 100644 --- a/db/migrate/20170609145826_remove_default_language_from_statuses.rb +++ b/db/migrate/20170609145826_remove_default_language_from_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveDefaultLanguageFromStatuses < ActiveRecord::Migration[5.1] def change change_column :statuses, :language, :string, default: nil, null: true diff --git a/db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb b/db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb index 86e425559..fce70663b 100644 --- a/db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb +++ b/db/migrate/20170610000000_add_statuses_index_on_account_id_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddStatusesIndexOnAccountIdId < ActiveRecord::Migration[5.1] disable_ddl_transaction! diff --git a/db/migrate/20170623152212_create_session_activations.rb b/db/migrate/20170623152212_create_session_activations.rb index 81c776135..0535320bd 100644 --- a/db/migrate/20170623152212_create_session_activations.rb +++ b/db/migrate/20170623152212_create_session_activations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateSessionActivations < ActiveRecord::Migration[5.1] def change create_table :session_activations do |t| diff --git a/db/migrate/20170624134742_add_description_to_session_activations.rb b/db/migrate/20170624134742_add_description_to_session_activations.rb index 9dbb15564..78f9e7a8d 100644 --- a/db/migrate/20170624134742_add_description_to_session_activations.rb +++ b/db/migrate/20170624134742_add_description_to_session_activations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDescriptionToSessionActivations < ActiveRecord::Migration[5.1] def change add_column :session_activations, :user_agent, :string, null: false, default: '' diff --git a/db/migrate/20170625140443_add_access_token_id_to_session_activations.rb b/db/migrate/20170625140443_add_access_token_id_to_session_activations.rb index 213a77a83..591dd8833 100644 --- a/db/migrate/20170625140443_add_access_token_id_to_session_activations.rb +++ b/db/migrate/20170625140443_add_access_token_id_to_session_activations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAccessTokenIdToSessionActivations < ActiveRecord::Migration[5.1] def change add_column :session_activations, :access_token_id, :integer diff --git a/db/migrate/20170711225116_fix_null_booleans.rb b/db/migrate/20170711225116_fix_null_booleans.rb index aabb81f21..12cc9b8b8 100644 --- a/db/migrate/20170711225116_fix_null_booleans.rb +++ b/db/migrate/20170711225116_fix_null_booleans.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FixNullBooleans < ActiveRecord::Migration[5.1] def change safety_assured do diff --git a/db/migrate/20170713112503_make_tag_search_case_insensitive.rb b/db/migrate/20170713112503_make_tag_search_case_insensitive.rb index 33ed6c005..e99b795b4 100644 --- a/db/migrate/20170713112503_make_tag_search_case_insensitive.rb +++ b/db/migrate/20170713112503_make_tag_search_case_insensitive.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MakeTagSearchCaseInsensitive < ActiveRecord::Migration[5.1] def up remove_index :tags, name: :hashtag_search_index diff --git a/db/migrate/20170713175513_create_web_push_subscriptions.rb b/db/migrate/20170713175513_create_web_push_subscriptions.rb index 4e5c2ba00..405050f46 100644 --- a/db/migrate/20170713175513_create_web_push_subscriptions.rb +++ b/db/migrate/20170713175513_create_web_push_subscriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateWebPushSubscriptions < ActiveRecord::Migration[5.1] def change create_table :web_push_subscriptions do |t| diff --git a/db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb b/db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb index d69cdfa50..0113c52ce 100644 --- a/db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb +++ b/db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddWebPushSubscriptionToSessionActivations < ActiveRecord::Migration[5.1] def change add_column :session_activations, :web_push_subscription_id, :integer diff --git a/db/migrate/20170714184731_add_domain_to_subscriptions.rb b/db/migrate/20170714184731_add_domain_to_subscriptions.rb index 7c01a64f5..313758c44 100644 --- a/db/migrate/20170714184731_add_domain_to_subscriptions.rb +++ b/db/migrate/20170714184731_add_domain_to_subscriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDomainToSubscriptions < ActiveRecord::Migration[5.1] def change add_column :subscriptions, :domain, :string diff --git a/db/migrate/20170716191202_add_hide_notifications_to_mute.rb b/db/migrate/20170716191202_add_hide_notifications_to_mute.rb index a498396b7..b817d512d 100644 --- a/db/migrate/20170716191202_add_hide_notifications_to_mute.rb +++ b/db/migrate/20170716191202_add_hide_notifications_to_mute.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddHideNotificationsToMute < ActiveRecord::Migration[5.1] diff --git a/db/migrate/20170718211102_add_activitypub_to_accounts.rb b/db/migrate/20170718211102_add_activitypub_to_accounts.rb index c08e38bb9..83a45f13a 100644 --- a/db/migrate/20170718211102_add_activitypub_to_accounts.rb +++ b/db/migrate/20170718211102_add_activitypub_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddActivityPubToAccounts < ActiveRecord::Migration[5.1] def change add_column :accounts, :inbox_url, :string, null: false, default: '' diff --git a/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb b/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb index 99903584c..f50f91f2e 100644 --- a/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb +++ b/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexFavouritesOnAccountIdAndId < ActiveRecord::Migration[5.1] def change # Used to query favourites of an account ordered by id. diff --git a/db/migrate/20170823162448_create_status_pins.rb b/db/migrate/20170823162448_create_status_pins.rb index 9a6d4a7b9..c8d3fab3a 100644 --- a/db/migrate/20170823162448_create_status_pins.rb +++ b/db/migrate/20170823162448_create_status_pins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateStatusPins < ActiveRecord::Migration[5.1] def change create_table :status_pins do |t| diff --git a/db/migrate/20170824103029_add_timestamps_to_status_pins.rb b/db/migrate/20170824103029_add_timestamps_to_status_pins.rb index 09f0fbeaf..837b1e10c 100644 --- a/db/migrate/20170824103029_add_timestamps_to_status_pins.rb +++ b/db/migrate/20170824103029_add_timestamps_to_status_pins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTimestampsToStatusPins < ActiveRecord::Migration[5.1] def change add_timestamps :status_pins, null: false, default: -> { 'CURRENT_TIMESTAMP' } diff --git a/db/migrate/20170829215220_remove_status_pins_account_index.rb b/db/migrate/20170829215220_remove_status_pins_account_index.rb index e0144242e..5c8643915 100644 --- a/db/migrate/20170829215220_remove_status_pins_account_index.rb +++ b/db/migrate/20170829215220_remove_status_pins_account_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveStatusPinsAccountIndex < ActiveRecord::Migration[5.1] def change remove_index :status_pins, :account_id diff --git a/db/migrate/20170901141119_truncate_preview_cards.rb b/db/migrate/20170901141119_truncate_preview_cards.rb index 4d9802f3b..22a773109 100644 --- a/db/migrate/20170901141119_truncate_preview_cards.rb +++ b/db/migrate/20170901141119_truncate_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TruncatePreviewCards < ActiveRecord::Migration[5.1] def up rename_table :preview_cards, :deprecated_preview_cards diff --git a/db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb b/db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb index be7f533b5..34808877e 100644 --- a/db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb +++ b/db/migrate/20170901142658_create_join_table_preview_cards_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateJoinTablePreviewCardsStatuses < ActiveRecord::Migration[5.1] def change create_join_table :preview_cards, :statuses do |t| diff --git a/db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb b/db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb index c47cea9e2..cb86555cf 100644 --- a/db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb +++ b/db/migrate/20170905044538_add_index_id_account_id_activity_type_on_notifications.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexIdAccountIdActivityTypeOnNotifications < ActiveRecord::Migration[5.1] def change add_index :notifications, [:id, :account_id, :activity_type], order: { id: :desc } diff --git a/db/migrate/20170905165803_add_local_to_statuses.rb b/db/migrate/20170905165803_add_local_to_statuses.rb index fb4e7019d..cb6307c26 100644 --- a/db/migrate/20170905165803_add_local_to_statuses.rb +++ b/db/migrate/20170905165803_add_local_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLocalToStatuses < ActiveRecord::Migration[5.1] def change add_column :statuses, :local, :boolean, null: true, default: nil diff --git a/db/migrate/20170913000752_create_site_uploads.rb b/db/migrate/20170913000752_create_site_uploads.rb index 2246e48cd..43a793806 100644 --- a/db/migrate/20170913000752_create_site_uploads.rb +++ b/db/migrate/20170913000752_create_site_uploads.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateSiteUploads < ActiveRecord::Migration[5.1] def change create_table :site_uploads do |t| diff --git a/db/migrate/20170917153509_create_custom_emojis.rb b/db/migrate/20170917153509_create_custom_emojis.rb index 4040c8312..984fcd218 100644 --- a/db/migrate/20170917153509_create_custom_emojis.rb +++ b/db/migrate/20170917153509_create_custom_emojis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateCustomEmojis < ActiveRecord::Migration[5.1] def change create_table :custom_emojis do |t| diff --git a/db/migrate/20170918125918_ids_to_bigints.rb b/db/migrate/20170918125918_ids_to_bigints.rb index e3fc34a51..83c5ab971 100644 --- a/db/migrate/20170918125918_ids_to_bigints.rb +++ b/db/migrate/20170918125918_ids_to_bigints.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative '../../lib/mastodon/migration_helpers' require_relative '../../lib/mastodon/migration_warning' diff --git a/db/migrate/20170920024819_status_ids_to_timestamp_ids.rb b/db/migrate/20170920024819_status_ids_to_timestamp_ids.rb index 82e91f1e1..b92337336 100644 --- a/db/migrate/20170920024819_status_ids_to_timestamp_ids.rb +++ b/db/migrate/20170920024819_status_ids_to_timestamp_ids.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StatusIdsToTimestampIds < ActiveRecord::Migration[5.1] def up # Prepare the function we will use to generate IDs. diff --git a/db/migrate/20170920032311_fix_reblogs_in_feeds.rb b/db/migrate/20170920032311_fix_reblogs_in_feeds.rb index 7e2db0ff3..fd6ad39f0 100644 --- a/db/migrate/20170920032311_fix_reblogs_in_feeds.rb +++ b/db/migrate/20170920032311_fix_reblogs_in_feeds.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FixReblogsInFeeds < ActiveRecord::Migration[5.1] def up redis = RedisConfiguration.pool.checkout diff --git a/db/migrate/20170924022025_ids_to_bigints2.rb b/db/migrate/20170924022025_ids_to_bigints2.rb index db8ccd919..f194d0e49 100644 --- a/db/migrate/20170924022025_ids_to_bigints2.rb +++ b/db/migrate/20170924022025_ids_to_bigints2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IdsToBigints2 < ActiveRecord::Migration[5.1] def up change_column :statuses_tags, :tag_id, :bigint diff --git a/db/migrate/20170927215609_add_description_to_media_attachments.rb b/db/migrate/20170927215609_add_description_to_media_attachments.rb index 9c3312373..8d27d4756 100644 --- a/db/migrate/20170927215609_add_description_to_media_attachments.rb +++ b/db/migrate/20170927215609_add_description_to_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDescriptionToMediaAttachments < ActiveRecord::Migration[5.2] def change add_column :media_attachments, :description, :text diff --git a/db/migrate/20170928082043_create_email_domain_blocks.rb b/db/migrate/20170928082043_create_email_domain_blocks.rb index 2baed54ef..0af561680 100644 --- a/db/migrate/20170928082043_create_email_domain_blocks.rb +++ b/db/migrate/20170928082043_create_email_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateEmailDomainBlocks < ActiveRecord::Migration[5.2] def change create_table :email_domain_blocks do |t| diff --git a/db/migrate/20171005102658_create_account_moderation_notes.rb b/db/migrate/20171005102658_create_account_moderation_notes.rb index afa2f5f25..254da20ef 100644 --- a/db/migrate/20171005102658_create_account_moderation_notes.rb +++ b/db/migrate/20171005102658_create_account_moderation_notes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountModerationNotes < ActiveRecord::Migration[5.2] def change create_table :account_moderation_notes do |t| diff --git a/db/migrate/20171005171936_add_disabled_to_custom_emojis.rb b/db/migrate/20171005171936_add_disabled_to_custom_emojis.rb index 7cf007ae9..d6fd228f9 100644 --- a/db/migrate/20171005171936_add_disabled_to_custom_emojis.rb +++ b/db/migrate/20171005171936_add_disabled_to_custom_emojis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddDisabledToCustomEmojis < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20171006142024_add_uri_to_custom_emojis.rb b/db/migrate/20171006142024_add_uri_to_custom_emojis.rb index ff62aed20..a9d760d04 100644 --- a/db/migrate/20171006142024_add_uri_to_custom_emojis.rb +++ b/db/migrate/20171006142024_add_uri_to_custom_emojis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUriToCustomEmojis < ActiveRecord::Migration[5.2] def change add_column :custom_emojis, :uri, :string diff --git a/db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb b/db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb index a2c0fbcc4..c66a61ffe 100644 --- a/db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb +++ b/db/migrate/20171010023049_add_foreign_key_to_account_moderation_notes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddForeignKeyToAccountModerationNotes < ActiveRecord::Migration[5.2] def change safety_assured { add_foreign_key :account_moderation_notes, :accounts } diff --git a/db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb b/db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb index 62725c88d..02ccf5b45 100644 --- a/db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb +++ b/db/migrate/20171010025614_change_accounts_nonnullable_in_account_moderation_notes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeAccountsNonnullableInAccountModerationNotes < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb b/db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb index 5f7c60a3e..2874066d0 100644 --- a/db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb +++ b/db/migrate/20171020084748_add_visible_in_picker_to_custom_emoji.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddVisibleInPickerToCustomEmoji < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/migrate/20171028221157_add_reblogs_to_follows.rb b/db/migrate/20171028221157_add_reblogs_to_follows.rb index 773904249..0dab84c79 100644 --- a/db/migrate/20171028221157_add_reblogs_to_follows.rb +++ b/db/migrate/20171028221157_add_reblogs_to_follows.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddReblogsToFollows < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20171107143332_add_memorial_to_accounts.rb b/db/migrate/20171107143332_add_memorial_to_accounts.rb index 4fb1216a1..3cf782b81 100644 --- a/db/migrate/20171107143332_add_memorial_to_accounts.rb +++ b/db/migrate/20171107143332_add_memorial_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddMemorialToAccounts < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20171107143624_add_disabled_to_users.rb b/db/migrate/20171107143624_add_disabled_to_users.rb index fb736786d..4ab4df737 100644 --- a/db/migrate/20171107143624_add_disabled_to_users.rb +++ b/db/migrate/20171107143624_add_disabled_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddDisabledToUsers < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20171109012327_add_moderator_to_accounts.rb b/db/migrate/20171109012327_add_moderator_to_accounts.rb index 70b0b598c..e8fc313c8 100644 --- a/db/migrate/20171109012327_add_moderator_to_accounts.rb +++ b/db/migrate/20171109012327_add_moderator_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddModeratorToAccounts < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb b/db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb index 34dc6ff00..3fc966a9e 100644 --- a/db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb +++ b/db/migrate/20171114080328_add_index_domain_to_email_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexDomainToEmailDomainBlocks < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20171114231651_create_lists.rb b/db/migrate/20171114231651_create_lists.rb index b7761abe4..4103d38e4 100644 --- a/db/migrate/20171114231651_create_lists.rb +++ b/db/migrate/20171114231651_create_lists.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateLists < ActiveRecord::Migration[5.2] def change create_table :lists do |t| diff --git a/db/migrate/20171116161857_create_list_accounts.rb b/db/migrate/20171116161857_create_list_accounts.rb index 7dbb78d8d..ff9ab3faa 100644 --- a/db/migrate/20171116161857_create_list_accounts.rb +++ b/db/migrate/20171116161857_create_list_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateListAccounts < ActiveRecord::Migration[5.2] def change create_table :list_accounts do |t| diff --git a/db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb b/db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb index 893972848..21915426f 100644 --- a/db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb +++ b/db/migrate/20171118012443_add_moved_to_account_id_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddMovedToAccountIdToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :moved_to_account_id, :bigint, null: true, default: nil diff --git a/db/migrate/20171119172437_create_admin_action_logs.rb b/db/migrate/20171119172437_create_admin_action_logs.rb index 80d5a3dba..a1758bdfc 100644 --- a/db/migrate/20171119172437_create_admin_action_logs.rb +++ b/db/migrate/20171119172437_create_admin_action_logs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAdminActionLogs < ActiveRecord::Migration[5.2] def change create_table :admin_action_logs do |t| diff --git a/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb b/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb index a02ffe09d..556427d12 100644 --- a/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb +++ b/db/migrate/20171122120436_add_index_account_and_reblog_of_id_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexAccountAndReblogOfIdToStatuses < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20171125024930_create_invites.rb b/db/migrate/20171125024930_create_invites.rb index 2e814babf..4219b26f4 100644 --- a/db/migrate/20171125024930_create_invites.rb +++ b/db/migrate/20171125024930_create_invites.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateInvites < ActiveRecord::Migration[5.2] def change create_table :invites do |t| diff --git a/db/migrate/20171125031751_add_invite_id_to_users.rb b/db/migrate/20171125031751_add_invite_id_to_users.rb index 2ff6c3430..45eadef15 100644 --- a/db/migrate/20171125031751_add_invite_id_to_users.rb +++ b/db/migrate/20171125031751_add_invite_id_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddInviteIdToUsers < ActiveRecord::Migration[5.2] def change safety_assured { add_reference :users, :invite, null: true, default: nil, foreign_key: { on_delete: :nullify }, index: false } diff --git a/db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb b/db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb index 8952387b5..80556438b 100644 --- a/db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb +++ b/db/migrate/20171125185353_add_index_reblog_of_id_and_account_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexReblogOfIdAndAccountToStatuses < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb b/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb index dc7e09a25..14a6888a7 100644 --- a/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb +++ b/db/migrate/20171125190735_remove_old_reblog_index_on_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveOldReblogIndexOnStatuses < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20171129172043_add_index_on_stream_entries.rb b/db/migrate/20171129172043_add_index_on_stream_entries.rb index 4580fb42f..c959135c2 100644 --- a/db/migrate/20171129172043_add_index_on_stream_entries.rb +++ b/db/migrate/20171129172043_add_index_on_stream_entries.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexOnStreamEntries < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb b/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb index 811f6ceae..e78373b24 100644 --- a/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb +++ b/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddEmbedURLToPreviewCards < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb b/db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb index e8e878611..4aa9027c0 100644 --- a/db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb +++ b/db/migrate/20171201000000_change_account_id_nonnullable_in_lists.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeAccountIdNonnullableInLists < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb b/db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb index f3007c77c..362b1367d 100644 --- a/db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb +++ b/db/migrate/20171212195226_remove_duplicate_indexes_in_lists.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveDuplicateIndexesInLists < ActiveRecord::Migration[5.2] def change remove_index :list_accounts, name: 'index_list_accounts_on_account_id' diff --git a/db/migrate/20171226094803_more_faster_index_on_notifications.rb b/db/migrate/20171226094803_more_faster_index_on_notifications.rb index e0e73b27a..429eab96a 100644 --- a/db/migrate/20171226094803_more_faster_index_on_notifications.rb +++ b/db/migrate/20171226094803_more_faster_index_on_notifications.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MoreFasterIndexOnNotifications < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb b/db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb index eb277d3bc..1531c4dd2 100644 --- a/db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb +++ b/db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20180109143959_add_remember_token_to_users.rb b/db/migrate/20180109143959_add_remember_token_to_users.rb index f244fc6f6..0d2185e9e 100644 --- a/db/migrate/20180109143959_add_remember_token_to_users.rb +++ b/db/migrate/20180109143959_add_remember_token_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddRememberTokenToUsers < ActiveRecord::Migration[5.2] def change add_column :users, :remember_token, :string, null: true diff --git a/db/migrate/20180204034416_create_identities.rb b/db/migrate/20180204034416_create_identities.rb index 68288aadf..c9efe9152 100644 --- a/db/migrate/20180204034416_create_identities.rb +++ b/db/migrate/20180204034416_create_identities.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateIdentities < ActiveRecord::Migration[5.2] def change create_table :identities, id: :integer do |t| diff --git a/db/migrate/20180206000000_change_user_id_nonnullable.rb b/db/migrate/20180206000000_change_user_id_nonnullable.rb index 119638387..16e18fce9 100644 --- a/db/migrate/20180206000000_change_user_id_nonnullable.rb +++ b/db/migrate/20180206000000_change_user_id_nonnullable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeUserIdNonnullable < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/migrate/20180211015820_create_backups.rb b/db/migrate/20180211015820_create_backups.rb index 4aaeed83b..67ad0f893 100644 --- a/db/migrate/20180211015820_create_backups.rb +++ b/db/migrate/20180211015820_create_backups.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateBackups < ActiveRecord::Migration[5.2] def change create_table :backups do |t| diff --git a/db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb b/db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb index 46842a9e3..3a427cc30 100644 --- a/db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb +++ b/db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddFeaturedCollectionURLToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :featured_collection_url, :string diff --git a/db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb b/db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb index 8577d0235..778b900b0 100644 --- a/db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb +++ b/db/migrate/20180310000000_change_columns_in_notifications_nonnullable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeColumnsInNotificationsNonnullable < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/migrate/20180402031200_add_assigned_account_id_to_reports.rb b/db/migrate/20180402031200_add_assigned_account_id_to_reports.rb index 27cbd6c2a..be5ab4767 100644 --- a/db/migrate/20180402031200_add_assigned_account_id_to_reports.rb +++ b/db/migrate/20180402031200_add_assigned_account_id_to_reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAssignedAccountIdToReports < ActiveRecord::Migration[5.2] def change safety_assured { add_reference :reports, :assigned_account, null: true, default: nil, foreign_key: { on_delete: :nullify, to_table: :accounts }, index: false } diff --git a/db/migrate/20180402040909_create_report_notes.rb b/db/migrate/20180402040909_create_report_notes.rb index 5d5a33627..40b42abd2 100644 --- a/db/migrate/20180402040909_create_report_notes.rb +++ b/db/migrate/20180402040909_create_report_notes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateReportNotes < ActiveRecord::Migration[5.2] def change create_table :report_notes do |t| diff --git a/db/migrate/20180410204633_add_fields_to_accounts.rb b/db/migrate/20180410204633_add_fields_to_accounts.rb index a1b9504b6..8e39e6db7 100644 --- a/db/migrate/20180410204633_add_fields_to_accounts.rb +++ b/db/migrate/20180410204633_add_fields_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddFieldsToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :fields, :jsonb diff --git a/db/migrate/20180416210259_add_uri_to_relationships.rb b/db/migrate/20180416210259_add_uri_to_relationships.rb index d8eaca450..4bafffeff 100644 --- a/db/migrate/20180416210259_add_uri_to_relationships.rb +++ b/db/migrate/20180416210259_add_uri_to_relationships.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUriToRelationships < ActiveRecord::Migration[5.2] def change add_column :follows, :uri, :string diff --git a/db/migrate/20180506221944_add_actor_type_to_accounts.rb b/db/migrate/20180506221944_add_actor_type_to_accounts.rb index 7cfed640f..38b2c3b63 100644 --- a/db/migrate/20180506221944_add_actor_type_to_accounts.rb +++ b/db/migrate/20180506221944_add_actor_type_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddActorTypeToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :actor_type, :string diff --git a/db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb b/db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb index f60716532..5426d3bbb 100644 --- a/db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb +++ b/db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAccessTokenIdToWebPushSubscriptions < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/migrate/20180510230049_migrate_web_push_subscriptions.rb b/db/migrate/20180510230049_migrate_web_push_subscriptions.rb index 6de1bed79..a9c0be49a 100644 --- a/db/migrate/20180510230049_migrate_web_push_subscriptions.rb +++ b/db/migrate/20180510230049_migrate_web_push_subscriptions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MigrateWebPushSubscriptions < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20180528141303_fix_accounts_unique_index.rb b/db/migrate/20180528141303_fix_accounts_unique_index.rb index 1e67b4bb4..d21422b05 100644 --- a/db/migrate/20180528141303_fix_accounts_unique_index.rb +++ b/db/migrate/20180528141303_fix_accounts_unique_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative '../../lib/mastodon/migration_warning' class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20180608213548_reject_following_blocked_users.rb b/db/migrate/20180608213548_reject_following_blocked_users.rb index bb21bd8fa..4cb639546 100644 --- a/db/migrate/20180608213548_reject_following_blocked_users.rb +++ b/db/migrate/20180608213548_reject_following_blocked_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RejectFollowingBlockedUsers < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20180609104432_migrate_web_push_subscriptions2.rb b/db/migrate/20180609104432_migrate_web_push_subscriptions2.rb index 510db64d2..aed1329df 100644 --- a/db/migrate/20180609104432_migrate_web_push_subscriptions2.rb +++ b/db/migrate/20180609104432_migrate_web_push_subscriptions2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MigrateWebPushSubscriptions2 < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20180615122121_add_autofollow_to_invites.rb b/db/migrate/20180615122121_add_autofollow_to_invites.rb index 8c5fb7410..ef129003a 100644 --- a/db/migrate/20180615122121_add_autofollow_to_invites.rb +++ b/db/migrate/20180615122121_add_autofollow_to_invites.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddAutofollowToInvites < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20180616192031_add_chosen_languages_to_users.rb b/db/migrate/20180616192031_add_chosen_languages_to_users.rb index 48b53019d..eae8d6b4e 100644 --- a/db/migrate/20180616192031_add_chosen_languages_to_users.rb +++ b/db/migrate/20180616192031_add_chosen_languages_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddChosenLanguagesToUsers < ActiveRecord::Migration[5.2] def change add_column :users, :chosen_languages, :string, array: true, null: true, default: nil diff --git a/db/migrate/20180617162849_remove_unused_indexes.rb b/db/migrate/20180617162849_remove_unused_indexes.rb index 9cd6b9164..14766589f 100644 --- a/db/migrate/20180617162849_remove_unused_indexes.rb +++ b/db/migrate/20180617162849_remove_unused_indexes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveUnusedIndexes < ActiveRecord::Migration[5.2] def change remove_index :statuses, name: 'index_statuses_on_conversation_id' diff --git a/db/migrate/20180628181026_create_custom_filters.rb b/db/migrate/20180628181026_create_custom_filters.rb index d19cf2e9d..1e7f4463f 100644 --- a/db/migrate/20180628181026_create_custom_filters.rb +++ b/db/migrate/20180628181026_create_custom_filters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateCustomFilters < ActiveRecord::Migration[5.2] def change create_table :custom_filters do |t| diff --git a/db/migrate/20180707154237_add_whole_word_to_custom_filter.rb b/db/migrate/20180707154237_add_whole_word_to_custom_filter.rb index 63ecb8741..793c3e6cf 100644 --- a/db/migrate/20180707154237_add_whole_word_to_custom_filter.rb +++ b/db/migrate/20180707154237_add_whole_word_to_custom_filter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddWholeWordToCustomFilter < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20180711152640_create_relays.rb b/db/migrate/20180711152640_create_relays.rb index 8762f473a..2d2f546d1 100644 --- a/db/migrate/20180711152640_create_relays.rb +++ b/db/migrate/20180711152640_create_relays.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateRelays < ActiveRecord::Migration[5.2] def change create_table :relays do |t| diff --git a/db/migrate/20180808175627_create_account_pins.rb b/db/migrate/20180808175627_create_account_pins.rb index 43d8185be..551496c34 100644 --- a/db/migrate/20180808175627_create_account_pins.rb +++ b/db/migrate/20180808175627_create_account_pins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountPins < ActiveRecord::Migration[5.2] def change create_table :account_pins do |t| diff --git a/db/migrate/20180812123222_change_relays_enabled.rb b/db/migrate/20180812123222_change_relays_enabled.rb index c4fd8179b..7424b91c7 100644 --- a/db/migrate/20180812123222_change_relays_enabled.rb +++ b/db/migrate/20180812123222_change_relays_enabled.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeRelaysEnabled < ActiveRecord::Migration[5.2] def up # The relays table is supposed to be very small, diff --git a/db/migrate/20180812162710_create_status_stats.rb b/db/migrate/20180812162710_create_status_stats.rb index d4da36fe7..882efce83 100644 --- a/db/migrate/20180812162710_create_status_stats.rb +++ b/db/migrate/20180812162710_create_status_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateStatusStats < ActiveRecord::Migration[5.2] def change create_table :status_stats do |t| diff --git a/db/migrate/20180812173710_copy_status_stats.rb b/db/migrate/20180812173710_copy_status_stats.rb index 45eb9501c..20baeeca6 100644 --- a/db/migrate/20180812173710_copy_status_stats.rb +++ b/db/migrate/20180812173710_copy_status_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CopyStatusStats < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb b/db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb index 7077a4e65..7360c71ac 100644 --- a/db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb +++ b/db/migrate/20180814171349_add_confidential_to_doorkeeper_application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddConfidentialToDoorkeeperApplication < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20180831171112_create_bookmarks.rb b/db/migrate/20180831171112_create_bookmarks.rb index a08e60739..5509f64bb 100644 --- a/db/migrate/20180831171112_create_bookmarks.rb +++ b/db/migrate/20180831171112_create_bookmarks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateBookmarks < ActiveRecord::Migration[5.2] def change create_table :bookmarks do |t| diff --git a/db/migrate/20180929222014_create_account_conversations.rb b/db/migrate/20180929222014_create_account_conversations.rb index 53fa137e1..9386b86e7 100644 --- a/db/migrate/20180929222014_create_account_conversations.rb +++ b/db/migrate/20180929222014_create_account_conversations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountConversations < ActiveRecord::Migration[5.2] def change create_table :account_conversations do |t| diff --git a/db/migrate/20181007025445_create_pghero_space_stats.rb b/db/migrate/20181007025445_create_pghero_space_stats.rb index 6198a6f84..ddaf4aef3 100644 --- a/db/migrate/20181007025445_create_pghero_space_stats.rb +++ b/db/migrate/20181007025445_create_pghero_space_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreatePgheroSpaceStats < ActiveRecord::Migration[5.2] def change create_table :pghero_space_stats do |t| diff --git a/db/migrate/20181010141500_add_silent_to_mentions.rb b/db/migrate/20181010141500_add_silent_to_mentions.rb index dbb4fba26..f9bfc5169 100644 --- a/db/migrate/20181010141500_add_silent_to_mentions.rb +++ b/db/migrate/20181010141500_add_silent_to_mentions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddSilentToMentions < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb b/db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb index f05d50fcd..b6cfd31d2 100644 --- a/db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb +++ b/db/migrate/20181017170937_add_reject_reports_to_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddRejectReportsToDomainBlocks < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20181018205649_add_unread_to_account_conversations.rb b/db/migrate/20181018205649_add_unread_to_account_conversations.rb index 3c28b9a64..fec947639 100644 --- a/db/migrate/20181018205649_add_unread_to_account_conversations.rb +++ b/db/migrate/20181018205649_add_unread_to_account_conversations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddUnreadToAccountConversations < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20181024224956_migrate_account_conversations.rb b/db/migrate/20181024224956_migrate_account_conversations.rb index e4dcdb18b..18f9aca97 100644 --- a/db/migrate/20181024224956_migrate_account_conversations.rb +++ b/db/migrate/20181024224956_migrate_account_conversations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative '../../lib/mastodon/migration_warning' class MigrateAccountConversations < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb b/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb index 40537e9c9..12998f0af 100644 --- a/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb +++ b/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveFauxRemoteAccountDuplicates < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20181116165755_create_account_stats.rb b/db/migrate/20181116165755_create_account_stats.rb index a798e8166..e21c49948 100644 --- a/db/migrate/20181116165755_create_account_stats.rb +++ b/db/migrate/20181116165755_create_account_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountStats < ActiveRecord::Migration[5.2] def change create_table :account_stats do |t| diff --git a/db/migrate/20181116173541_copy_account_stats.rb b/db/migrate/20181116173541_copy_account_stats.rb index f908575cb..88dc0c1fe 100644 --- a/db/migrate/20181116173541_copy_account_stats.rb +++ b/db/migrate/20181116173541_copy_account_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CopyAccountStats < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20181127130500_identity_id_to_bigint.rb b/db/migrate/20181127130500_identity_id_to_bigint.rb index 5f388aca7..51420c79d 100644 --- a/db/migrate/20181127130500_identity_id_to_bigint.rb +++ b/db/migrate/20181127130500_identity_id_to_bigint.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class IdentityIdToBigint < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20181127165847_add_show_replies_to_lists.rb b/db/migrate/20181127165847_add_show_replies_to_lists.rb index f68c98daf..45d457b74 100644 --- a/db/migrate/20181127165847_add_show_replies_to_lists.rb +++ b/db/migrate/20181127165847_add_show_replies_to_lists.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddShowRepliesToLists < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20181203003808_create_accounts_tags_join_table.rb b/db/migrate/20181203003808_create_accounts_tags_join_table.rb index 3c275c2b7..434417647 100644 --- a/db/migrate/20181203003808_create_accounts_tags_join_table.rb +++ b/db/migrate/20181203003808_create_accounts_tags_join_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountsTagsJoinTable < ActiveRecord::Migration[5.2] def change create_join_table :accounts, :tags do |t| diff --git a/db/migrate/20181203021853_add_discoverable_to_accounts.rb b/db/migrate/20181203021853_add_discoverable_to_accounts.rb index 5bbae2203..16576aa04 100644 --- a/db/migrate/20181203021853_add_discoverable_to_accounts.rb +++ b/db/migrate/20181203021853_add_discoverable_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDiscoverableToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :discoverable, :boolean diff --git a/db/migrate/20181204193439_add_last_status_at_to_account_stats.rb b/db/migrate/20181204193439_add_last_status_at_to_account_stats.rb index 946662707..dc1c6084b 100644 --- a/db/migrate/20181204193439_add_last_status_at_to_account_stats.rb +++ b/db/migrate/20181204193439_add_last_status_at_to_account_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLastStatusAtToAccountStats < ActiveRecord::Migration[5.2] def change add_column :account_stats, :last_status_at, :datetime diff --git a/db/migrate/20181204215309_create_account_tag_stats.rb b/db/migrate/20181204215309_create_account_tag_stats.rb index 15ed8587e..1d4477c9c 100644 --- a/db/migrate/20181204215309_create_account_tag_stats.rb +++ b/db/migrate/20181204215309_create_account_tag_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountTagStats < ActiveRecord::Migration[5.2] def change create_table :account_tag_stats do |t| diff --git a/db/migrate/20181207011115_downcase_custom_emoji_domains.rb b/db/migrate/20181207011115_downcase_custom_emoji_domains.rb index e27e0249d..3f3da937a 100644 --- a/db/migrate/20181207011115_downcase_custom_emoji_domains.rb +++ b/db/migrate/20181207011115_downcase_custom_emoji_domains.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DowncaseCustomEmojiDomains < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20181213184704_create_account_warnings.rb b/db/migrate/20181213184704_create_account_warnings.rb index e768be277..35989c986 100644 --- a/db/migrate/20181213184704_create_account_warnings.rb +++ b/db/migrate/20181213184704_create_account_warnings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountWarnings < ActiveRecord::Migration[5.2] def change create_table :account_warnings do |t| diff --git a/db/migrate/20181213185533_create_account_warning_presets.rb b/db/migrate/20181213185533_create_account_warning_presets.rb index 9c81f1b5e..f8a101713 100644 --- a/db/migrate/20181213185533_create_account_warning_presets.rb +++ b/db/migrate/20181213185533_create_account_warning_presets.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountWarningPresets < ActiveRecord::Migration[5.2] def change create_table :account_warning_presets do |t| diff --git a/db/migrate/20181219235220_add_created_by_application_id_to_users.rb b/db/migrate/20181219235220_add_created_by_application_id_to_users.rb index 81c9237e8..0663d9c10 100644 --- a/db/migrate/20181219235220_add_created_by_application_id_to_users.rb +++ b/db/migrate/20181219235220_add_created_by_application_id_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCreatedByApplicationIdToUsers < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20181226021420_add_also_known_as_to_accounts.rb b/db/migrate/20181226021420_add_also_known_as_to_accounts.rb index 1fd956680..b0310fc32 100644 --- a/db/migrate/20181226021420_add_also_known_as_to_accounts.rb +++ b/db/migrate/20181226021420_add_also_known_as_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAlsoKnownAsToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :also_known_as, :string, array: true diff --git a/db/migrate/20190103124649_create_scheduled_statuses.rb b/db/migrate/20190103124649_create_scheduled_statuses.rb index 2b78073b8..a66546187 100644 --- a/db/migrate/20190103124649_create_scheduled_statuses.rb +++ b/db/migrate/20190103124649_create_scheduled_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateScheduledStatuses < ActiveRecord::Migration[5.2] def change create_table :scheduled_statuses do |t| diff --git a/db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb b/db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb index 7d904af60..d575bdcaf 100644 --- a/db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb +++ b/db/migrate/20190103124754_add_scheduled_status_id_to_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddScheduledStatusIdToMediaAttachments < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20190117114553_create_tombstones.rb b/db/migrate/20190117114553_create_tombstones.rb index 06d6d8c5a..b25d7964e 100644 --- a/db/migrate/20190117114553_create_tombstones.rb +++ b/db/migrate/20190117114553_create_tombstones.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateTombstones < ActiveRecord::Migration[5.2] def change create_table :tombstones do |t| diff --git a/db/migrate/20190201012802_add_overwrite_to_imports.rb b/db/migrate/20190201012802_add_overwrite_to_imports.rb index 89b262cc7..fe9423ed0 100644 --- a/db/migrate/20190201012802_add_overwrite_to_imports.rb +++ b/db/migrate/20190201012802_add_overwrite_to_imports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddOverwriteToImports < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20190203180359_create_featured_tags.rb b/db/migrate/20190203180359_create_featured_tags.rb index b08410a3a..fe525aef8 100644 --- a/db/migrate/20190203180359_create_featured_tags.rb +++ b/db/migrate/20190203180359_create_featured_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateFeaturedTags < ActiveRecord::Migration[5.2] def change create_table :featured_tags do |t| diff --git a/db/migrate/20190225031541_create_polls.rb b/db/migrate/20190225031541_create_polls.rb index ea9ad0425..33497c5cb 100644 --- a/db/migrate/20190225031541_create_polls.rb +++ b/db/migrate/20190225031541_create_polls.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreatePolls < ActiveRecord::Migration[5.2] def change create_table :polls do |t| diff --git a/db/migrate/20190225031625_create_poll_votes.rb b/db/migrate/20190225031625_create_poll_votes.rb index a0849d3a5..4b0504e82 100644 --- a/db/migrate/20190225031625_create_poll_votes.rb +++ b/db/migrate/20190225031625_create_poll_votes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreatePollVotes < ActiveRecord::Migration[5.2] def change create_table :poll_votes do |t| diff --git a/db/migrate/20190226003449_add_poll_id_to_statuses.rb b/db/migrate/20190226003449_add_poll_id_to_statuses.rb index 692e8f814..8d0af7ba0 100644 --- a/db/migrate/20190226003449_add_poll_id_to_statuses.rb +++ b/db/migrate/20190226003449_add_poll_id_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddPollIdToStatuses < ActiveRecord::Migration[5.2] def change add_column :statuses, :poll_id, :bigint diff --git a/db/migrate/20190304152020_add_uri_to_poll_votes.rb b/db/migrate/20190304152020_add_uri_to_poll_votes.rb index f6b81f1ba..37a7f0aa8 100644 --- a/db/migrate/20190304152020_add_uri_to_poll_votes.rb +++ b/db/migrate/20190304152020_add_uri_to_poll_votes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUriToPollVotes < ActiveRecord::Migration[5.2] def change add_column :poll_votes, :uri, :string diff --git a/db/migrate/20190306145741_add_lock_version_to_polls.rb b/db/migrate/20190306145741_add_lock_version_to_polls.rb index c9fa471ad..760818d97 100644 --- a/db/migrate/20190306145741_add_lock_version_to_polls.rb +++ b/db/migrate/20190306145741_add_lock_version_to_polls.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddLockVersionToPolls < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20190307234537_add_approved_to_users.rb b/db/migrate/20190307234537_add_approved_to_users.rb index c57a66dbc..9abab29c9 100644 --- a/db/migrate/20190307234537_add_approved_to_users.rb +++ b/db/migrate/20190307234537_add_approved_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddApprovedToUsers < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20190314181829_migrate_open_registrations_setting.rb b/db/migrate/20190314181829_migrate_open_registrations_setting.rb index d2f6bf2c1..3b1a96342 100644 --- a/db/migrate/20190314181829_migrate_open_registrations_setting.rb +++ b/db/migrate/20190314181829_migrate_open_registrations_setting.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MigrateOpenRegistrationsSetting < ActiveRecord::Migration[5.2] def up open_registrations = Setting.find_by(var: 'open_registrations') diff --git a/db/migrate/20190316190352_create_account_identity_proofs.rb b/db/migrate/20190316190352_create_account_identity_proofs.rb index ddcbce3f3..7055dc37b 100644 --- a/db/migrate/20190316190352_create_account_identity_proofs.rb +++ b/db/migrate/20190316190352_create_account_identity_proofs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountIdentityProofs < ActiveRecord::Migration[5.2] def change create_table :account_identity_proofs do |t| diff --git a/db/migrate/20190317135723_add_uri_to_reports.rb b/db/migrate/20190317135723_add_uri_to_reports.rb index 47c0f2a21..722e6af8e 100644 --- a/db/migrate/20190317135723_add_uri_to_reports.rb +++ b/db/migrate/20190317135723_add_uri_to_reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUriToReports < ActiveRecord::Migration[5.2] def change add_column :reports, :uri, :string diff --git a/db/migrate/20190403141604_add_comment_to_invites.rb b/db/migrate/20190403141604_add_comment_to_invites.rb index f0d7b1dcd..5f87a0fe4 100644 --- a/db/migrate/20190403141604_add_comment_to_invites.rb +++ b/db/migrate/20190403141604_add_comment_to_invites.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCommentToInvites < ActiveRecord::Migration[5.2] def change add_column :invites, :comment, :text diff --git a/db/migrate/20190409054914_create_user_invite_requests.rb b/db/migrate/20190409054914_create_user_invite_requests.rb index 974e0f69f..233b5a558 100644 --- a/db/migrate/20190409054914_create_user_invite_requests.rb +++ b/db/migrate/20190409054914_create_user_invite_requests.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateUserInviteRequests < ActiveRecord::Migration[5.2] def change create_table :user_invite_requests do |t| diff --git a/db/migrate/20190420025523_add_blurhash_to_media_attachments.rb b/db/migrate/20190420025523_add_blurhash_to_media_attachments.rb index f2bbe0a85..0f2f68489 100644 --- a/db/migrate/20190420025523_add_blurhash_to_media_attachments.rb +++ b/db/migrate/20190420025523_add_blurhash_to_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddBlurhashToMediaAttachments < ActiveRecord::Migration[5.2] def change add_column :media_attachments, :blurhash, :string diff --git a/db/migrate/20190509164208_add_by_moderator_to_tombstone.rb b/db/migrate/20190509164208_add_by_moderator_to_tombstone.rb index 80c244842..656cd0af5 100644 --- a/db/migrate/20190509164208_add_by_moderator_to_tombstone.rb +++ b/db/migrate/20190509164208_add_by_moderator_to_tombstone.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddByModeratorToTombstone < ActiveRecord::Migration[5.2] def change add_column :tombstones, :by_moderator, :boolean diff --git a/db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb b/db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb index 1e5cd669c..7301e960d 100644 --- a/db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb +++ b/db/migrate/20190511134027_add_silenced_at_suspended_at_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSilencedAtSuspendedAtToAccounts < ActiveRecord::Migration[5.2] class Account < ApplicationRecord # Dummy class, to make migration possible across version changes diff --git a/db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb b/db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb index 1c18b85cb..88dcea436 100644 --- a/db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb +++ b/db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PreserveOldLayoutForExistingUsers < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20190627222225_create_custom_emoji_categories.rb b/db/migrate/20190627222225_create_custom_emoji_categories.rb index 4713793e6..5d8a8b49b 100644 --- a/db/migrate/20190627222225_create_custom_emoji_categories.rb +++ b/db/migrate/20190627222225_create_custom_emoji_categories.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateCustomEmojiCategories < ActiveRecord::Migration[5.2] def change create_table :custom_emoji_categories do |t| diff --git a/db/migrate/20190627222826_add_category_id_to_custom_emojis.rb b/db/migrate/20190627222826_add_category_id_to_custom_emojis.rb index 873b4d05f..b8d102de5 100644 --- a/db/migrate/20190627222826_add_category_id_to_custom_emojis.rb +++ b/db/migrate/20190627222826_add_category_id_to_custom_emojis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCategoryIdToCustomEmojis < ActiveRecord::Migration[5.2] def change add_column :custom_emojis, :category_id, :bigint diff --git a/db/migrate/20190701022101_add_trust_level_to_accounts.rb b/db/migrate/20190701022101_add_trust_level_to_accounts.rb index 917486d2e..2a906e15f 100644 --- a/db/migrate/20190701022101_add_trust_level_to_accounts.rb +++ b/db/migrate/20190701022101_add_trust_level_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTrustLevelToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :trust_level, :integer diff --git a/db/migrate/20190705002136_create_domain_allows.rb b/db/migrate/20190705002136_create_domain_allows.rb index 83b0728d9..cdd8c65d6 100644 --- a/db/migrate/20190705002136_create_domain_allows.rb +++ b/db/migrate/20190705002136_create_domain_allows.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateDomainAllows < ActiveRecord::Migration[5.2] def change create_table :domain_allows do |t| diff --git a/db/migrate/20190715164535_add_instance_actor.rb b/db/migrate/20190715164535_add_instance_actor.rb index 0ae53199a..3785dc255 100644 --- a/db/migrate/20190715164535_add_instance_actor.rb +++ b/db/migrate/20190715164535_add_instance_actor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddInstanceActor < ActiveRecord::Migration[5.2] class Account < ApplicationRecord # Dummy class, to make migration possible across version changes diff --git a/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb b/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb index 3a6527f65..12cc40d96 100644 --- a/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb +++ b/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCaseInsensitiveIndexToTags < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20190729185330_add_score_to_tags.rb b/db/migrate/20190729185330_add_score_to_tags.rb index 75fee4b57..b990209c6 100644 --- a/db/migrate/20190729185330_add_score_to_tags.rb +++ b/db/migrate/20190729185330_add_score_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddScoreToTags < ActiveRecord::Migration[5.2] def change add_column :tags, :score, :int diff --git a/db/migrate/20190805123746_add_capabilities_to_tags.rb b/db/migrate/20190805123746_add_capabilities_to_tags.rb index 43c7763b1..623b56a83 100644 --- a/db/migrate/20190805123746_add_capabilities_to_tags.rb +++ b/db/migrate/20190805123746_add_capabilities_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCapabilitiesToTags < ActiveRecord::Migration[5.2] def change add_column :tags, :usable, :boolean diff --git a/db/migrate/20190807135426_add_comments_to_domain_blocks.rb b/db/migrate/20190807135426_add_comments_to_domain_blocks.rb index 79b9f0212..7cca3229c 100644 --- a/db/migrate/20190807135426_add_comments_to_domain_blocks.rb +++ b/db/migrate/20190807135426_add_comments_to_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddCommentsToDomainBlocks < ActiveRecord::Migration[5.2] def change add_column :domain_blocks, :private_comment, :text diff --git a/db/migrate/20190815225426_add_last_status_at_to_tags.rb b/db/migrate/20190815225426_add_last_status_at_to_tags.rb index d83537c47..03181988c 100644 --- a/db/migrate/20190815225426_add_last_status_at_to_tags.rb +++ b/db/migrate/20190815225426_add_last_status_at_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLastStatusAtToTags < ActiveRecord::Migration[5.2] def change add_column :tags, :last_status_at, :datetime diff --git a/db/migrate/20190819134503_add_deleted_at_to_statuses.rb b/db/migrate/20190819134503_add_deleted_at_to_statuses.rb index 5af109097..43a333375 100644 --- a/db/migrate/20190819134503_add_deleted_at_to_statuses.rb +++ b/db/migrate/20190819134503_add_deleted_at_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDeletedAtToStatuses < ActiveRecord::Migration[5.2] def change add_column :statuses, :deleted_at, :datetime diff --git a/db/migrate/20190820003045_update_statuses_index.rb b/db/migrate/20190820003045_update_statuses_index.rb index 5c2ea1f6a..df9ce0638 100644 --- a/db/migrate/20190820003045_update_statuses_index.rb +++ b/db/migrate/20190820003045_update_statuses_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UpdateStatusesIndex < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20190823221802_add_local_index_to_statuses.rb b/db/migrate/20190823221802_add_local_index_to_statuses.rb index deca25c35..b5baa3028 100644 --- a/db/migrate/20190823221802_add_local_index_to_statuses.rb +++ b/db/migrate/20190823221802_add_local_index_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLocalIndexToStatuses < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20190901035623_add_max_score_to_tags.rb b/db/migrate/20190901035623_add_max_score_to_tags.rb index f936e9871..42a579694 100644 --- a/db/migrate/20190901035623_add_max_score_to_tags.rb +++ b/db/migrate/20190901035623_add_max_score_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddMaxScoreToTags < ActiveRecord::Migration[5.2] def change add_column :tags, :max_score, :float diff --git a/db/migrate/20190904222339_create_markers.rb b/db/migrate/20190904222339_create_markers.rb index 71ca70ac3..5d469ddef 100644 --- a/db/migrate/20190904222339_create_markers.rb +++ b/db/migrate/20190904222339_create_markers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateMarkers < ActiveRecord::Migration[5.2] def change create_table :markers do |t| diff --git a/db/migrate/20190914202517_create_account_migrations.rb b/db/migrate/20190914202517_create_account_migrations.rb index cb9d71c09..44353e08c 100644 --- a/db/migrate/20190914202517_create_account_migrations.rb +++ b/db/migrate/20190914202517_create_account_migrations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountMigrations < ActiveRecord::Migration[5.2] def change create_table :account_migrations do |t| diff --git a/db/migrate/20190915194355_create_account_aliases.rb b/db/migrate/20190915194355_create_account_aliases.rb index 32ce031d9..f5d648e6d 100644 --- a/db/migrate/20190915194355_create_account_aliases.rb +++ b/db/migrate/20190915194355_create_account_aliases.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountAliases < ActiveRecord::Migration[5.2] def change create_table :account_aliases do |t| diff --git a/db/migrate/20190927232842_add_voters_count_to_polls.rb b/db/migrate/20190927232842_add_voters_count_to_polls.rb index 846385700..02d6e4bda 100644 --- a/db/migrate/20190927232842_add_voters_count_to_polls.rb +++ b/db/migrate/20190927232842_add_voters_count_to_polls.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddVotersCountToPolls < ActiveRecord::Migration[5.2] def change add_column :polls, :voters_count, :bigint diff --git a/db/migrate/20191001213028_add_lock_version_to_account_stats.rb b/db/migrate/20191001213028_add_lock_version_to_account_stats.rb index 47f37cca2..0dc165559 100644 --- a/db/migrate/20191001213028_add_lock_version_to_account_stats.rb +++ b/db/migrate/20191001213028_add_lock_version_to_account_stats.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddLockVersionToAccountStats < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20191007013357_update_pt_locales.rb b/db/migrate/20191007013357_update_pt_locales.rb index 9e8f8b424..a3a4e6b60 100644 --- a/db/migrate/20191007013357_update_pt_locales.rb +++ b/db/migrate/20191007013357_update_pt_locales.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UpdatePtLocales < ActiveRecord::Migration[5.2] class User < ApplicationRecord # Dummy class, to make migration possible across version changes diff --git a/db/migrate/20191031163205_change_list_account_follow_nullable.rb b/db/migrate/20191031163205_change_list_account_follow_nullable.rb index 43ebfe892..2416d4e91 100644 --- a/db/migrate/20191031163205_change_list_account_follow_nullable.rb +++ b/db/migrate/20191031163205_change_list_account_follow_nullable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeListAccountFollowNullable < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/migrate/20191212003415_increase_backup_size.rb b/db/migrate/20191212003415_increase_backup_size.rb index a5192263c..c531a198b 100644 --- a/db/migrate/20191212003415_increase_backup_size.rb +++ b/db/migrate/20191212003415_increase_backup_size.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class IncreaseBackupSize < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20191212163405_add_hide_collections_to_accounts.rb b/db/migrate/20191212163405_add_hide_collections_to_accounts.rb index fa99b32e5..d6740f19b 100644 --- a/db/migrate/20191212163405_add_hide_collections_to_accounts.rb +++ b/db/migrate/20191212163405_add_hide_collections_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddHideCollectionsToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :hide_collections, :boolean diff --git a/db/migrate/20191218153258_create_announcements.rb b/db/migrate/20191218153258_create_announcements.rb index 58e143c92..632a912b1 100644 --- a/db/migrate/20191218153258_create_announcements.rb +++ b/db/migrate/20191218153258_create_announcements.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAnnouncements < ActiveRecord::Migration[5.2] def change create_table :announcements do |t| diff --git a/db/migrate/20200113125135_create_announcement_mutes.rb b/db/migrate/20200113125135_create_announcement_mutes.rb index c588e7fcd..42c45d773 100644 --- a/db/migrate/20200113125135_create_announcement_mutes.rb +++ b/db/migrate/20200113125135_create_announcement_mutes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAnnouncementMutes < ActiveRecord::Migration[5.2] def change create_table :announcement_mutes do |t| diff --git a/db/migrate/20200114113335_create_announcement_reactions.rb b/db/migrate/20200114113335_create_announcement_reactions.rb index 226c81a18..f74d05fc0 100644 --- a/db/migrate/20200114113335_create_announcement_reactions.rb +++ b/db/migrate/20200114113335_create_announcement_reactions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAnnouncementReactions < ActiveRecord::Migration[5.2] def change create_table :announcement_reactions do |t| diff --git a/db/migrate/20200119112504_add_public_index_to_statuses.rb b/db/migrate/20200119112504_add_public_index_to_statuses.rb index db007848e..6451b9254 100644 --- a/db/migrate/20200119112504_add_public_index_to_statuses.rb +++ b/db/migrate/20200119112504_add_public_index_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddPublicIndexToStatuses < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20200126203551_add_published_at_to_announcements.rb b/db/migrate/20200126203551_add_published_at_to_announcements.rb index d99f95694..98a3a9592 100644 --- a/db/migrate/20200126203551_add_published_at_to_announcements.rb +++ b/db/migrate/20200126203551_add_published_at_to_announcements.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddPublishedAtToAnnouncements < ActiveRecord::Migration[5.2] def change add_column :announcements, :published_at, :datetime diff --git a/db/migrate/20200306035625_add_processing_to_media_attachments.rb b/db/migrate/20200306035625_add_processing_to_media_attachments.rb index 131ffa52a..4506c0366 100644 --- a/db/migrate/20200306035625_add_processing_to_media_attachments.rb +++ b/db/migrate/20200306035625_add_processing_to_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddProcessingToMediaAttachments < ActiveRecord::Migration[5.2] def change add_column :media_attachments, :processing, :integer diff --git a/db/migrate/20200309150742_add_forwarded_to_reports.rb b/db/migrate/20200309150742_add_forwarded_to_reports.rb index df278240b..60db0167e 100644 --- a/db/migrate/20200309150742_add_forwarded_to_reports.rb +++ b/db/migrate/20200309150742_add_forwarded_to_reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddForwardedToReports < ActiveRecord::Migration[5.2] def change add_column :reports, :forwarded, :boolean diff --git a/db/migrate/20200312144258_add_title_to_account_warning_presets.rb b/db/migrate/20200312144258_add_title_to_account_warning_presets.rb index 46a5350e7..78b854f82 100644 --- a/db/migrate/20200312144258_add_title_to_account_warning_presets.rb +++ b/db/migrate/20200312144258_add_title_to_account_warning_presets.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddTitleToAccountWarningPresets < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20200312162302_add_status_ids_to_announcements.rb b/db/migrate/20200312162302_add_status_ids_to_announcements.rb index 704d3773e..a892b7396 100644 --- a/db/migrate/20200312162302_add_status_ids_to_announcements.rb +++ b/db/migrate/20200312162302_add_status_ids_to_announcements.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddStatusIdsToAnnouncements < ActiveRecord::Migration[5.2] def change add_column :announcements, :status_ids, :bigint, array: true diff --git a/db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb b/db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb index 54ca3b87c..585a097bd 100644 --- a/db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb +++ b/db/migrate/20200312185443_add_parent_id_to_email_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddParentIdToEmailDomainBlocks < ActiveRecord::Migration[5.2] def change safety_assured { add_reference :email_domain_blocks, :parent, null: true, default: nil, foreign_key: { on_delete: :cascade, to_table: :email_domain_blocks }, index: false } diff --git a/db/migrate/20200317021758_add_expires_at_to_mutes.rb b/db/migrate/20200317021758_add_expires_at_to_mutes.rb index eaae8319d..75bf3ed85 100644 --- a/db/migrate/20200317021758_add_expires_at_to_mutes.rb +++ b/db/migrate/20200317021758_add_expires_at_to_mutes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddExpiresAtToMutes < ActiveRecord::Migration[5.2] def change add_column :mutes, :expires_at, :datetime diff --git a/db/migrate/20200407201300_create_unavailable_domains.rb b/db/migrate/20200407201300_create_unavailable_domains.rb index 56b477da5..cbddcab80 100644 --- a/db/migrate/20200407201300_create_unavailable_domains.rb +++ b/db/migrate/20200407201300_create_unavailable_domains.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateUnavailableDomains < ActiveRecord::Migration[5.2] def change create_table :unavailable_domains do |t| diff --git a/db/migrate/20200407202420_migrate_unavailable_inboxes.rb b/db/migrate/20200407202420_migrate_unavailable_inboxes.rb index 05a01be28..a79045839 100644 --- a/db/migrate/20200407202420_migrate_unavailable_inboxes.rb +++ b/db/migrate/20200407202420_migrate_unavailable_inboxes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MigrateUnavailableInboxes < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20200417125749_add_storage_schema_version.rb b/db/migrate/20200417125749_add_storage_schema_version.rb index 7438f97ba..b50453731 100644 --- a/db/migrate/20200417125749_add_storage_schema_version.rb +++ b/db/migrate/20200417125749_add_storage_schema_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddStorageSchemaVersion < ActiveRecord::Migration[5.2] def change add_column :preview_cards, :image_storage_schema_version, :integer diff --git a/db/migrate/20200508212852_reset_unique_jobs_locks.rb b/db/migrate/20200508212852_reset_unique_jobs_locks.rb index d717ffc54..16e5c060b 100644 --- a/db/migrate/20200508212852_reset_unique_jobs_locks.rb +++ b/db/migrate/20200508212852_reset_unique_jobs_locks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ResetUniqueJobsLocks < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20200510110808_reset_web_app_secret.rb b/db/migrate/20200510110808_reset_web_app_secret.rb index 8c0c06a83..9f5a77a19 100644 --- a/db/migrate/20200510110808_reset_web_app_secret.rb +++ b/db/migrate/20200510110808_reset_web_app_secret.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ResetWebAppSecret < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb b/db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb index 59bb1b9e2..ce575d628 100644 --- a/db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb +++ b/db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveDuplicatedIndexesPghero < ActiveRecord::Migration[5.2] def up remove_index :account_conversations, name: :index_account_conversations_on_account_id if index_exists?(:account_conversations, :account_id, name: :index_account_conversations_on_account_id) diff --git a/db/migrate/20200516180352_create_devices.rb b/db/migrate/20200516180352_create_devices.rb index 04a628a89..a3e22c145 100644 --- a/db/migrate/20200516180352_create_devices.rb +++ b/db/migrate/20200516180352_create_devices.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateDevices < ActiveRecord::Migration[5.2] def change create_table :devices do |t| diff --git a/db/migrate/20200516183822_create_one_time_keys.rb b/db/migrate/20200516183822_create_one_time_keys.rb index 642b9e632..4245ceef1 100644 --- a/db/migrate/20200516183822_create_one_time_keys.rb +++ b/db/migrate/20200516183822_create_one_time_keys.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateOneTimeKeys < ActiveRecord::Migration[5.2] def change create_table :one_time_keys do |t| diff --git a/db/migrate/20200518083523_create_encrypted_messages.rb b/db/migrate/20200518083523_create_encrypted_messages.rb index 486726303..a8b2976e6 100644 --- a/db/migrate/20200518083523_create_encrypted_messages.rb +++ b/db/migrate/20200518083523_create_encrypted_messages.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateEncryptedMessages < ActiveRecord::Migration[5.2] def change create_table :encrypted_messages do |t| diff --git a/db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb b/db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb index c5c80b795..422e4f43f 100644 --- a/db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb +++ b/db/migrate/20200521180606_encrypted_message_ids_to_timestamp_ids.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EncryptedMessageIdsToTimestampIds < ActiveRecord::Migration[5.2] def up safety_assured do diff --git a/db/migrate/20200529214050_add_devices_url_to_accounts.rb b/db/migrate/20200529214050_add_devices_url_to_accounts.rb index 1323f8df7..6f868579f 100644 --- a/db/migrate/20200529214050_add_devices_url_to_accounts.rb +++ b/db/migrate/20200529214050_add_devices_url_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDevicesURLToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :devices_url, :string diff --git a/db/migrate/20200601222558_create_system_keys.rb b/db/migrate/20200601222558_create_system_keys.rb index fd9d221aa..38ec147d4 100644 --- a/db/migrate/20200601222558_create_system_keys.rb +++ b/db/migrate/20200601222558_create_system_keys.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateSystemKeys < ActiveRecord::Migration[5.2] def change create_table :system_keys do |t| diff --git a/db/migrate/20200605155027_add_blurhash_to_preview_cards.rb b/db/migrate/20200605155027_add_blurhash_to_preview_cards.rb index dc4b7a984..f89dc7b2b 100644 --- a/db/migrate/20200605155027_add_blurhash_to_preview_cards.rb +++ b/db/migrate/20200605155027_add_blurhash_to_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddBlurhashToPreviewCards < ActiveRecord::Migration[5.2] def change add_column :preview_cards, :blurhash, :string diff --git a/db/migrate/20200608113046_add_sign_in_token_to_users.rb b/db/migrate/20200608113046_add_sign_in_token_to_users.rb index baa63c10f..5b71276a2 100644 --- a/db/migrate/20200608113046_add_sign_in_token_to_users.rb +++ b/db/migrate/20200608113046_add_sign_in_token_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSignInTokenToUsers < ActiveRecord::Migration[5.2] def change add_column :users, :sign_in_token, :string diff --git a/db/migrate/20200614002136_add_sensitized_to_accounts.rb b/db/migrate/20200614002136_add_sensitized_to_accounts.rb index bc2dfcb63..bf5d363c8 100644 --- a/db/migrate/20200614002136_add_sensitized_to_accounts.rb +++ b/db/migrate/20200614002136_add_sensitized_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSensitizedToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :sensitized_at, :datetime diff --git a/db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb b/db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb index b350ee9f2..fa81ac164 100644 --- a/db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb +++ b/db/migrate/20200620164023_add_fixed_lowercase_index_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddFixedLowercaseIndexToAccounts < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb b/db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb index 7c141e7af..4b1caeddb 100644 --- a/db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb +++ b/db/migrate/20200622213645_media_attachment_ids_to_timestamp_ids.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MediaAttachmentIdsToTimestampIds < ActiveRecord::Migration[5.2] def up # Set up the media_attachments.id column to use our timestamp-based IDs. diff --git a/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb b/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb index f9c87a53c..a3c6b55fd 100644 --- a/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb +++ b/db/migrate/20200627125810_add_thumbnail_columns_to_media_attachments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddThumbnailColumnsToMediaAttachments < ActiveRecord::Migration[5.2] def up add_attachment :media_attachments, :thumbnail diff --git a/db/migrate/20200628133322_create_account_notes.rb b/db/migrate/20200628133322_create_account_notes.rb index 022e0ff3a..dd2366198 100644 --- a/db/migrate/20200628133322_create_account_notes.rb +++ b/db/migrate/20200628133322_create_account_notes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountNotes < ActiveRecord::Migration[5.2] def change create_table :account_notes do |t| diff --git a/db/migrate/20200630190240_create_webauthn_credentials.rb b/db/migrate/20200630190240_create_webauthn_credentials.rb index ea924238d..21c60ce00 100644 --- a/db/migrate/20200630190240_create_webauthn_credentials.rb +++ b/db/migrate/20200630190240_create_webauthn_credentials.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateWebauthnCredentials < ActiveRecord::Migration[5.2] def change create_table :webauthn_credentials do |t| diff --git a/db/migrate/20200630190544_add_webauthn_id_to_users.rb b/db/migrate/20200630190544_add_webauthn_id_to_users.rb index 95d3c92a8..e2628b65b 100644 --- a/db/migrate/20200630190544_add_webauthn_id_to_users.rb +++ b/db/migrate/20200630190544_add_webauthn_id_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddWebauthnIdToUsers < ActiveRecord::Migration[5.2] def change add_column :users, :webauthn_id, :string diff --git a/db/migrate/20200908193330_create_account_deletion_requests.rb b/db/migrate/20200908193330_create_account_deletion_requests.rb index e03183ae4..1f543ca33 100644 --- a/db/migrate/20200908193330_create_account_deletion_requests.rb +++ b/db/migrate/20200908193330_create_account_deletion_requests.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountDeletionRequests < ActiveRecord::Migration[5.2] def change create_table :account_deletion_requests do |t| diff --git a/db/migrate/20200917192924_add_notify_to_follows.rb b/db/migrate/20200917192924_add_notify_to_follows.rb index 342eaa38d..a57bb36dc 100644 --- a/db/migrate/20200917192924_add_notify_to_follows.rb +++ b/db/migrate/20200917192924_add_notify_to_follows.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddNotifyToFollows < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20200917193034_add_type_to_notifications.rb b/db/migrate/20200917193034_add_type_to_notifications.rb index 002be3aa0..b0fb3bfe3 100644 --- a/db/migrate/20200917193034_add_type_to_notifications.rb +++ b/db/migrate/20200917193034_add_type_to_notifications.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTypeToNotifications < ActiveRecord::Migration[5.2] def change add_column :notifications, :type, :string diff --git a/db/migrate/20200917222316_add_index_notifications_on_type.rb b/db/migrate/20200917222316_add_index_notifications_on_type.rb index 9bd23c1d3..a819f23ee 100644 --- a/db/migrate/20200917222316_add_index_notifications_on_type.rb +++ b/db/migrate/20200917222316_add_index_notifications_on_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexNotificationsOnType < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20201008202037_create_ip_blocks.rb b/db/migrate/20201008202037_create_ip_blocks.rb index 32acd6ede..76b86d648 100644 --- a/db/migrate/20201008202037_create_ip_blocks.rb +++ b/db/migrate/20201008202037_create_ip_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateIpBlocks < ActiveRecord::Migration[5.2] def change create_table :ip_blocks do |t| diff --git a/db/migrate/20201008220312_add_sign_up_ip_to_users.rb b/db/migrate/20201008220312_add_sign_up_ip_to_users.rb index 66cd624bb..58d1a7aed 100644 --- a/db/migrate/20201008220312_add_sign_up_ip_to_users.rb +++ b/db/migrate/20201008220312_add_sign_up_ip_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSignUpIpToUsers < ActiveRecord::Migration[5.2] def change add_column :users, :sign_up_ip, :inet diff --git a/db/migrate/20201017233919_add_suspension_origin_to_accounts.rb b/db/migrate/20201017233919_add_suspension_origin_to_accounts.rb index f0db02143..1150f1094 100644 --- a/db/migrate/20201017233919_add_suspension_origin_to_accounts.rb +++ b/db/migrate/20201017233919_add_suspension_origin_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSuspensionOriginToAccounts < ActiveRecord::Migration[5.2] def change add_column :accounts, :suspension_origin, :integer diff --git a/db/migrate/20201206004238_create_instances.rb b/db/migrate/20201206004238_create_instances.rb index a4b866894..965ab26e2 100644 --- a/db/migrate/20201206004238_create_instances.rb +++ b/db/migrate/20201206004238_create_instances.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateInstances < ActiveRecord::Migration[5.2] def change create_view :instances, materialized: true diff --git a/db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb b/db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb index 26f4ddb85..91bba38c5 100644 --- a/db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb +++ b/db/migrate/20201218054746_add_obfuscate_to_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddObfuscateToDomainBlocks < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20210221045109_create_rules.rb b/db/migrate/20210221045109_create_rules.rb index abe2fd42a..293a1a6c4 100644 --- a/db/migrate/20210221045109_create_rules.rb +++ b/db/migrate/20210221045109_create_rules.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateRules < ActiveRecord::Migration[5.2] def change create_table :rules do |t| diff --git a/db/migrate/20210306164523_account_ids_to_timestamp_ids.rb b/db/migrate/20210306164523_account_ids_to_timestamp_ids.rb index b287c60dd..0b3f1f638 100644 --- a/db/migrate/20210306164523_account_ids_to_timestamp_ids.rb +++ b/db/migrate/20210306164523_account_ids_to_timestamp_ids.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AccountIdsToTimestampIds < ActiveRecord::Migration[5.2] def up # Set up the accounts.id column to use our timestamp-based IDs. diff --git a/db/migrate/20210322164601_create_account_summaries.rb b/db/migrate/20210322164601_create_account_summaries.rb index bc9011113..8d18e9eeb 100644 --- a/db/migrate/20210322164601_create_account_summaries.rb +++ b/db/migrate/20210322164601_create_account_summaries.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountSummaries < ActiveRecord::Migration[5.2] def change create_view :account_summaries, materialized: { no_data: true } diff --git a/db/migrate/20210323114347_create_follow_recommendations.rb b/db/migrate/20210323114347_create_follow_recommendations.rb index 77e729032..b63564a03 100644 --- a/db/migrate/20210323114347_create_follow_recommendations.rb +++ b/db/migrate/20210323114347_create_follow_recommendations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateFollowRecommendations < ActiveRecord::Migration[5.2] def change create_view :follow_recommendations diff --git a/db/migrate/20210324171613_create_follow_recommendation_suppressions.rb b/db/migrate/20210324171613_create_follow_recommendation_suppressions.rb index c17a0be63..a2040ca98 100644 --- a/db/migrate/20210324171613_create_follow_recommendation_suppressions.rb +++ b/db/migrate/20210324171613_create_follow_recommendation_suppressions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateFollowRecommendationSuppressions < ActiveRecord::Migration[6.1] def change create_table :follow_recommendation_suppressions do |t| diff --git a/db/migrate/20210416200740_create_canonical_email_blocks.rb b/db/migrate/20210416200740_create_canonical_email_blocks.rb index 32c44646c..a18539fa1 100644 --- a/db/migrate/20210416200740_create_canonical_email_blocks.rb +++ b/db/migrate/20210416200740_create_canonical_email_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateCanonicalEmailBlocks < ActiveRecord::Migration[6.1] def change create_table :canonical_email_blocks do |t| diff --git a/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb b/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb index a3cc854d7..43b4e5a6f 100644 --- a/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb +++ b/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddCaseInsensitiveBtreeIndexToTags < ActiveRecord::Migration[5.2] diff --git a/db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb b/db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb index 5ef2d3c39..68fdcd51e 100644 --- a/db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb +++ b/db/migrate/20210425135952_add_index_on_media_attachments_account_id_status_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexOnMediaAttachmentsAccountIdStatusId < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb b/db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb index 56c0b4cb0..22c27a0e7 100644 --- a/db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb +++ b/db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UpdateFollowRecommendationsToVersion2 < ActiveRecord::Migration[6.1] # We're switching from a normal to a materialized view so we need # custom `up` and `down` paths. diff --git a/db/migrate/20210609202149_create_login_activities.rb b/db/migrate/20210609202149_create_login_activities.rb index 38e147c32..f2da33599 100644 --- a/db/migrate/20210609202149_create_login_activities.rb +++ b/db/migrate/20210609202149_create_login_activities.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateLoginActivities < ActiveRecord::Migration[6.1] def change create_table :login_activities do |t| diff --git a/db/migrate/20210616214526_create_user_ips.rb b/db/migrate/20210616214526_create_user_ips.rb index 68e81a9d8..4aaf9a474 100644 --- a/db/migrate/20210616214526_create_user_ips.rb +++ b/db/migrate/20210616214526_create_user_ips.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateUserIps < ActiveRecord::Migration[6.1] def change create_view :user_ips diff --git a/db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb b/db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb index 43ad9b954..8c5d9c368 100644 --- a/db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb +++ b/db/migrate/20210621221010_add_skip_sign_in_token_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSkipSignInTokenToUsers < ActiveRecord::Migration[6.1] def change add_column :users, :skip_sign_in_token, :boolean diff --git a/db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb b/db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb index 64cf84448..9b475966b 100644 --- a/db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb +++ b/db/migrate/20210630000137_fix_canonical_email_blocks_foreign_key.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FixCanonicalEmailBlocksForeignKey < ActiveRecord::Migration[6.1] def up safety_assured do diff --git a/db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb b/db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb index db168676a..334c375a4 100644 --- a/db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb +++ b/db/migrate/20210722120340_create_account_statuses_cleanup_policies.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAccountStatusesCleanupPolicies < ActiveRecord::Migration[6.1] def change create_table :account_statuses_cleanup_policies do |t| diff --git a/db/migrate/20210904215403_add_edited_at_to_statuses.rb b/db/migrate/20210904215403_add_edited_at_to_statuses.rb index 216ad8e13..545c6f79c 100644 --- a/db/migrate/20210904215403_add_edited_at_to_statuses.rb +++ b/db/migrate/20210904215403_add_edited_at_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddEditedAtToStatuses < ActiveRecord::Migration[6.1] def change add_column :statuses, :edited_at, :datetime diff --git a/db/migrate/20210908220918_create_status_edits.rb b/db/migrate/20210908220918_create_status_edits.rb index 6c90149d0..dfc2c5174 100644 --- a/db/migrate/20210908220918_create_status_edits.rb +++ b/db/migrate/20210908220918_create_status_edits.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateStatusEdits < ActiveRecord::Migration[6.1] def change create_table :status_edits do |t| diff --git a/db/migrate/20211031031021_create_preview_card_providers.rb b/db/migrate/20211031031021_create_preview_card_providers.rb index 0bd46198e..83255614b 100644 --- a/db/migrate/20211031031021_create_preview_card_providers.rb +++ b/db/migrate/20211031031021_create_preview_card_providers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreatePreviewCardProviders < ActiveRecord::Migration[6.1] def change create_table :preview_card_providers do |t| diff --git a/db/migrate/20211112011713_add_language_to_preview_cards.rb b/db/migrate/20211112011713_add_language_to_preview_cards.rb index 995934de4..b9049e979 100644 --- a/db/migrate/20211112011713_add_language_to_preview_cards.rb +++ b/db/migrate/20211112011713_add_language_to_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLanguageToPreviewCards < ActiveRecord::Migration[6.1] def change add_column :preview_cards, :language, :string diff --git a/db/migrate/20211115032527_add_trendable_to_preview_cards.rb b/db/migrate/20211115032527_add_trendable_to_preview_cards.rb index 87bf3d7a2..21fc4ecf4 100644 --- a/db/migrate/20211115032527_add_trendable_to_preview_cards.rb +++ b/db/migrate/20211115032527_add_trendable_to_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTrendableToPreviewCards < ActiveRecord::Migration[6.1] def change add_column :preview_cards, :trendable, :boolean diff --git a/db/migrate/20211123212714_add_link_type_to_preview_cards.rb b/db/migrate/20211123212714_add_link_type_to_preview_cards.rb index 9f57e0219..68a2a92cb 100644 --- a/db/migrate/20211123212714_add_link_type_to_preview_cards.rb +++ b/db/migrate/20211123212714_add_link_type_to_preview_cards.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLinkTypeToPreviewCards < ActiveRecord::Migration[6.1] def change add_column :preview_cards, :link_type, :int diff --git a/db/migrate/20211213040746_update_account_summaries_to_version_2.rb b/db/migrate/20211213040746_update_account_summaries_to_version_2.rb index 0d1f092ec..e347a874f 100644 --- a/db/migrate/20211213040746_update_account_summaries_to_version_2.rb +++ b/db/migrate/20211213040746_update_account_summaries_to_version_2.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UpdateAccountSummariesToVersion2 < ActiveRecord::Migration[6.1] def up reapplication_follow_recommendations_v2 do diff --git a/db/migrate/20211231080958_add_category_to_reports.rb b/db/migrate/20211231080958_add_category_to_reports.rb index c2b495c63..97a59f8c2 100644 --- a/db/migrate/20211231080958_add_category_to_reports.rb +++ b/db/migrate/20211231080958_add_category_to_reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require Rails.root.join('lib', 'mastodon', 'migration_helpers') class AddCategoryToReports < ActiveRecord::Migration[6.1] diff --git a/db/migrate/20220105163928_remove_mentions_status_id_index.rb b/db/migrate/20220105163928_remove_mentions_status_id_index.rb index 56e903719..58d665f85 100644 --- a/db/migrate/20220105163928_remove_mentions_status_id_index.rb +++ b/db/migrate/20220105163928_remove_mentions_status_id_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveMentionsStatusIdIndex < ActiveRecord::Migration[6.1] def up remove_index :mentions, name: :mentions_status_id_index if index_exists?(:mentions, :status_id, name: :mentions_status_id_index) diff --git a/db/migrate/20220115125126_add_report_id_to_account_warnings.rb b/db/migrate/20220115125126_add_report_id_to_account_warnings.rb index a1c20c99e..43e5adcfe 100644 --- a/db/migrate/20220115125126_add_report_id_to_account_warnings.rb +++ b/db/migrate/20220115125126_add_report_id_to_account_warnings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddReportIdToAccountWarnings < ActiveRecord::Migration[6.1] def change safety_assured { add_reference :account_warnings, :report, foreign_key: { on_delete: :cascade }, index: false } diff --git a/db/migrate/20220115125341_fix_account_warning_actions.rb b/db/migrate/20220115125341_fix_account_warning_actions.rb index 25cc17fd3..5a580e92c 100644 --- a/db/migrate/20220115125341_fix_account_warning_actions.rb +++ b/db/migrate/20220115125341_fix_account_warning_actions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FixAccountWarningActions < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb b/db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb index dc3362552..761511182 100644 --- a/db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb +++ b/db/migrate/20220116202951_add_deleted_at_index_on_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDeletedAtIndexOnStatuses < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220124141035_create_appeals.rb b/db/migrate/20220124141035_create_appeals.rb index afb3efbd5..03911172a 100644 --- a/db/migrate/20220124141035_create_appeals.rb +++ b/db/migrate/20220124141035_create_appeals.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAppeals < ActiveRecord::Migration[6.1] def change create_table :appeals do |t| diff --git a/db/migrate/20220202200743_add_trendable_to_accounts.rb b/db/migrate/20220202200743_add_trendable_to_accounts.rb index 414df5108..20de235c2 100644 --- a/db/migrate/20220202200743_add_trendable_to_accounts.rb +++ b/db/migrate/20220202200743_add_trendable_to_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTrendableToAccounts < ActiveRecord::Migration[6.1] def change add_column :accounts, :trendable, :boolean diff --git a/db/migrate/20220202200926_add_trendable_to_statuses.rb b/db/migrate/20220202200926_add_trendable_to_statuses.rb index 7f38c8ca7..5d101132b 100644 --- a/db/migrate/20220202200926_add_trendable_to_statuses.rb +++ b/db/migrate/20220202200926_add_trendable_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddTrendableToStatuses < ActiveRecord::Migration[6.1] def change add_column :statuses, :trendable, :boolean diff --git a/db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb b/db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb index a082da774..68ca277e3 100644 --- a/db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb +++ b/db/migrate/20220210153119_add_overruled_at_to_account_warnings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddOverruledAtToAccountWarnings < ActiveRecord::Migration[6.1] def change add_column :account_warnings, :overruled_at, :datetime diff --git a/db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb b/db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb index 1b19a2aa1..f70dbe5e3 100644 --- a/db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb +++ b/db/migrate/20220224010024_add_ips_to_email_domain_blocks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIpsToEmailDomainBlocks < ActiveRecord::Migration[6.1] def change add_column :email_domain_blocks, :ips, :inet, array: true diff --git a/db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb b/db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb index 6b46e60a8..a733fa1c4 100644 --- a/db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb +++ b/db/migrate/20220227041951_add_last_used_at_to_oauth_access_tokens.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLastUsedAtToOauthAccessTokens < ActiveRecord::Migration[6.1] def change add_column :oauth_access_tokens, :last_used_at, :datetime diff --git a/db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb b/db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb index 5443f32a2..3a08963a7 100644 --- a/db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb +++ b/db/migrate/20220302232632_add_ordered_media_attachment_ids_to_statuses.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddOrderedMediaAttachmentIdsToStatuses < ActiveRecord::Migration[6.1] def change add_column :statuses, :ordered_media_attachment_ids, :bigint, array: true diff --git a/db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb b/db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb index b1071f359..b8ebee6f0 100644 --- a/db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb +++ b/db/migrate/20220303000827_add_ordered_media_attachment_ids_to_status_edits.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddOrderedMediaAttachmentIdsToStatusEdits < ActiveRecord::Migration[6.1] def change add_column :status_edits, :ordered_media_attachment_ids, :bigint, array: true diff --git a/db/migrate/20220304195405_migrate_hide_network_preference.rb b/db/migrate/20220304195405_migrate_hide_network_preference.rb index 102ee46d6..0083e0422 100644 --- a/db/migrate/20220304195405_migrate_hide_network_preference.rb +++ b/db/migrate/20220304195405_migrate_hide_network_preference.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MigrateHideNetworkPreference < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220307094650_fix_featured_tags_constraints.rb b/db/migrate/20220307094650_fix_featured_tags_constraints.rb index bad1c90d4..db2e9f4f7 100644 --- a/db/migrate/20220307094650_fix_featured_tags_constraints.rb +++ b/db/migrate/20220307094650_fix_featured_tags_constraints.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FixFeaturedTagsConstraints < ActiveRecord::Migration[6.1] def up safety_assured do diff --git a/db/migrate/20220309213005_fix_reblog_deleted_at.rb b/db/migrate/20220309213005_fix_reblog_deleted_at.rb index 8ec1813d9..e3474beeb 100644 --- a/db/migrate/20220309213005_fix_reblog_deleted_at.rb +++ b/db/migrate/20220309213005_fix_reblog_deleted_at.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FixReblogDeletedAt < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220316233212_update_kurdish_locales.rb b/db/migrate/20220316233212_update_kurdish_locales.rb index 36586622f..fa8ced0fd 100644 --- a/db/migrate/20220316233212_update_kurdish_locales.rb +++ b/db/migrate/20220316233212_update_kurdish_locales.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UpdateKurdishLocales < ActiveRecord::Migration[6.1] class User < ApplicationRecord # Dummy class, to make migration possible across version changes diff --git a/db/migrate/20220428112511_add_index_statuses_on_account_id.rb b/db/migrate/20220428112511_add_index_statuses_on_account_id.rb index 87a601b72..b1ace18df 100644 --- a/db/migrate/20220428112511_add_index_statuses_on_account_id.rb +++ b/db/migrate/20220428112511_add_index_statuses_on_account_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexStatusesOnAccountId < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb b/db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb index 26a543087..0358da9b5 100644 --- a/db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb +++ b/db/migrate/20220428112727_add_index_statuses_pins_on_status_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexStatusesPinsOnStatusId < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb b/db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb index c260c9732..6b3888c42 100644 --- a/db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb +++ b/db/migrate/20220428114454_add_index_reports_on_assigned_account_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexReportsOnAssignedAccountId < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb b/db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb index aed88cd80..3c2d9dac9 100644 --- a/db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb +++ b/db/migrate/20220428114902_add_index_reports_on_action_taken_by_account_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexReportsOnActionTakenByAccountId < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220606044941_create_webhooks.rb b/db/migrate/20220606044941_create_webhooks.rb index cca48fce6..0e70fbead 100644 --- a/db/migrate/20220606044941_create_webhooks.rb +++ b/db/migrate/20220606044941_create_webhooks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateWebhooks < ActiveRecord::Migration[6.1] def change create_table :webhooks do |t| diff --git a/db/migrate/20220611210335_create_user_roles.rb b/db/migrate/20220611210335_create_user_roles.rb index 6b7f2b637..c778b7059 100644 --- a/db/migrate/20220611210335_create_user_roles.rb +++ b/db/migrate/20220611210335_create_user_roles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateUserRoles < ActiveRecord::Migration[6.1] def change create_table :user_roles do |t| diff --git a/db/migrate/20220611212541_add_role_id_to_users.rb b/db/migrate/20220611212541_add_role_id_to_users.rb index 2fda647d4..9c1cb2fad 100644 --- a/db/migrate/20220611212541_add_role_id_to_users.rb +++ b/db/migrate/20220611212541_add_role_id_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddRoleIdToUsers < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20220710102457_add_display_name_to_tags.rb b/db/migrate/20220710102457_add_display_name_to_tags.rb index aa7867645..b74de5085 100644 --- a/db/migrate/20220710102457_add_display_name_to_tags.rb +++ b/db/migrate/20220710102457_add_display_name_to_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDisplayNameToTags < ActiveRecord::Migration[6.1] def change add_column :tags, :display_name, :string diff --git a/db/migrate/20220714171049_create_tag_follows.rb b/db/migrate/20220714171049_create_tag_follows.rb index a393e90f5..9a3f3e093 100644 --- a/db/migrate/20220714171049_create_tag_follows.rb +++ b/db/migrate/20220714171049_create_tag_follows.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateTagFollows < ActiveRecord::Migration[6.1] def change create_table :tag_follows do |t| diff --git a/db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb b/db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb index 2cb8cddf1..90bc76728 100644 --- a/db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb +++ b/db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddHumanIdentifierToAdminActionLogs < ActiveRecord::Migration[6.1] def change add_column :admin_action_logs, :human_identifier, :string diff --git a/db/migrate/20220824233535_create_status_trends.rb b/db/migrate/20220824233535_create_status_trends.rb index cea0abf35..52dcbf8f3 100644 --- a/db/migrate/20220824233535_create_status_trends.rb +++ b/db/migrate/20220824233535_create_status_trends.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateStatusTrends < ActiveRecord::Migration[6.1] def change create_table :status_trends do |t| diff --git a/db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb b/db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb index 5b3ec4727..e794824af 100644 --- a/db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb +++ b/db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeCanonicalEmailBlocksNullable < ActiveRecord::Migration[6.1] def change safety_assured { change_column :canonical_email_blocks, :reference_account_id, :bigint, null: true, default: nil } diff --git a/db/migrate/20220829192633_add_languages_to_follows.rb b/db/migrate/20220829192633_add_languages_to_follows.rb index f6cf48880..ad88396bd 100644 --- a/db/migrate/20220829192633_add_languages_to_follows.rb +++ b/db/migrate/20220829192633_add_languages_to_follows.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLanguagesToFollows < ActiveRecord::Migration[6.1] def change add_column :follows, :languages, :string, array: true diff --git a/db/migrate/20220829192658_add_languages_to_follow_requests.rb b/db/migrate/20220829192658_add_languages_to_follow_requests.rb index f98fabb22..94031fd87 100644 --- a/db/migrate/20220829192658_add_languages_to_follow_requests.rb +++ b/db/migrate/20220829192658_add_languages_to_follow_requests.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLanguagesToFollowRequests < ActiveRecord::Migration[6.1] def change add_column :follow_requests, :languages, :string, array: true diff --git a/db/migrate/20221006061337_create_preview_card_trends.rb b/db/migrate/20221006061337_create_preview_card_trends.rb index baad9c31c..934a06e24 100644 --- a/db/migrate/20221006061337_create_preview_card_trends.rb +++ b/db/migrate/20221006061337_create_preview_card_trends.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreatePreviewCardTrends < ActiveRecord::Migration[6.1] def change create_table :preview_card_trends do |t| diff --git a/db/migrate/20221012181003_add_blurhash_to_site_uploads.rb b/db/migrate/20221012181003_add_blurhash_to_site_uploads.rb index e1c87712b..3ed2eb968 100644 --- a/db/migrate/20221012181003_add_blurhash_to_site_uploads.rb +++ b/db/migrate/20221012181003_add_blurhash_to_site_uploads.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddBlurhashToSiteUploads < ActiveRecord::Migration[6.1] def change add_column :site_uploads, :blurhash, :string diff --git a/db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb b/db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb index 74d7673f7..7925aae93 100644 --- a/db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb +++ b/db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexFeaturedTagsOnAccountIdAndTagId < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb b/db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb index 0221369b7..a1d824c4e 100644 --- a/db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb +++ b/db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddIndexIpBlocksOnIp < ActiveRecord::Migration[6.1] disable_ddl_transaction! diff --git a/db/migrate/20221104133904_add_name_to_featured_tags.rb b/db/migrate/20221104133904_add_name_to_featured_tags.rb index 7c8c8ebfb..44b9e6448 100644 --- a/db/migrate/20221104133904_add_name_to_featured_tags.rb +++ b/db/migrate/20221104133904_add_name_to_featured_tags.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddNameToFeaturedTags < ActiveRecord::Migration[6.1] def change add_column :featured_tags, :name, :string diff --git a/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb b/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb index f1708b2e1..89a95041e 100644 --- a/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb +++ b/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveBoostsWideningAudience < ActiveRecord::Migration[5.2] disable_ddl_transaction! diff --git a/db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb b/db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb index 511104cef..f95e96297 100644 --- a/db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb +++ b/db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveSubscriptionExpiresAtFromAccounts < ActiveRecord::Migration[5.2] def change safety_assured do diff --git a/db/post_migrate/20220118183123_remove_rememberable_from_users.rb b/db/post_migrate/20220118183123_remove_rememberable_from_users.rb index 1e274c6e0..0acd68614 100644 --- a/db/post_migrate/20220118183123_remove_rememberable_from_users.rb +++ b/db/post_migrate/20220118183123_remove_rememberable_from_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveRememberableFromUsers < ActiveRecord::Migration[6.1] def change safety_assured do diff --git a/db/seeds/01_web_app.rb b/db/seeds/01_web_app.rb index a457a883b..a9d8fd3ba 100644 --- a/db/seeds/01_web_app.rb +++ b/db/seeds/01_web_app.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Doorkeeper::Application.create_with(name: 'Web', redirect_uri: Doorkeeper.configuration.native_redirect_uri, scopes: 'read write follow push').find_or_create_by(superapp: true) diff --git a/db/seeds/02_instance_actor.rb b/db/seeds/02_instance_actor.rb index f9aa372f1..55e83e8a0 100644 --- a/db/seeds/02_instance_actor.rb +++ b/db/seeds/02_instance_actor.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Account.create_with(actor_type: 'Application', locked: true, username: 'mastodon.internal').find_or_create_by(id: -99) diff --git a/db/seeds/03_roles.rb b/db/seeds/03_roles.rb index 7fedf0f71..8b359582b 100644 --- a/db/seeds/03_roles.rb +++ b/db/seeds/03_roles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Pre-create base role UserRole.everyone diff --git a/db/seeds/04_admin.rb b/db/seeds/04_admin.rb index a67040e4e..ec0287a45 100644 --- a/db/seeds/04_admin.rb +++ b/db/seeds/04_admin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if Rails.env.development? domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain diff --git a/lib/rails/engine_extensions.rb b/lib/rails/engine_extensions.rb index 1f5c2cd6c..68535570d 100644 --- a/lib/rails/engine_extensions.rb +++ b/lib/rails/engine_extensions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Rails module EngineExtensions # Rewrite task loading code to filter digitalocean.rake task diff --git a/lib/tasks/branding.rake b/lib/tasks/branding.rake index d97c97c99..608fb3af9 100644 --- a/lib/tasks/branding.rake +++ b/lib/tasks/branding.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :branding do desc 'Generate necessary graphic assets for branding from source SVG files' task generate: :environment do diff --git a/spec/fabricators_spec.rb b/spec/fabricators_spec.rb index 3b76c56ce..53193378c 100644 --- a/spec/fabricators_spec.rb +++ b/spec/fabricators_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' Fabrication.manager.load_definitions if Fabrication.manager.empty? From f134a5f9d80672eb086aa29bb8eecc901da6b752 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 12 Jul 2023 03:47:54 -0400 Subject: [PATCH 03/17] Run Rubocop on Rakefile (#23871) --- .rubocop.yml | 1 - Rakefile | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 5c109a7e5..597dfcb9e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -24,7 +24,6 @@ AllCops: Exclude: - db/schema.rb - 'bin/*' - - 'Rakefile' - 'node_modules/**/*' - 'Vagrantfile' - 'vendor/**/*' diff --git a/Rakefile b/Rakefile index ba6b733dd..e51cf0e17 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,8 @@ +# 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. -require File.expand_path('../config/application', __FILE__) +require File.expand_path('config/application', __dir__) Rails.application.load_tasks From c75df62cccd5c1d24e88774ac10803d2903d97a2 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 03:49:33 -0400 Subject: [PATCH 04/17] Fix `RSpec/SubjectDeclaration` cop (#25312) --- .rubocop_todo.yml | 23 ------------------- .../admin/domain_blocks_controller_spec.rb | 5 ++-- spec/models/account_migration_spec.rb | 4 ++-- spec/models/account_spec.rb | 4 +++- spec/models/relationship_filter_spec.rb | 2 +- spec/models/user_role_spec.rb | 4 ++-- .../account_moderation_note_policy_spec.rb | 3 ++- spec/policies/account_policy_spec.rb | 3 ++- spec/policies/backup_policy_spec.rb | 5 ++-- spec/policies/custom_emoji_policy_spec.rb | 3 ++- spec/policies/domain_block_policy_spec.rb | 3 ++- .../email_domain_block_policy_spec.rb | 3 ++- spec/policies/instance_policy_spec.rb | 3 ++- spec/policies/invite_policy_spec.rb | 3 ++- spec/policies/relay_policy_spec.rb | 3 ++- spec/policies/report_note_policy_spec.rb | 3 ++- spec/policies/report_policy_spec.rb | 3 ++- spec/policies/settings_policy_spec.rb | 3 ++- spec/policies/tag_policy_spec.rb | 3 ++- spec/policies/user_policy_spec.rb | 3 ++- .../process_account_service_spec.rb | 10 ++++---- 21 files changed, 45 insertions(+), 51 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9b74778b0..9938916fc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -409,29 +409,6 @@ RSpec/StubbedMock: - 'spec/lib/webfinger_resource_spec.rb' - 'spec/services/activitypub/process_collection_service_spec.rb' -RSpec/SubjectDeclaration: - Exclude: - - 'spec/controllers/admin/domain_blocks_controller_spec.rb' - - 'spec/models/account_migration_spec.rb' - - 'spec/models/account_spec.rb' - - 'spec/models/relationship_filter_spec.rb' - - 'spec/models/user_role_spec.rb' - - 'spec/policies/account_moderation_note_policy_spec.rb' - - 'spec/policies/account_policy_spec.rb' - - 'spec/policies/backup_policy_spec.rb' - - 'spec/policies/custom_emoji_policy_spec.rb' - - 'spec/policies/domain_block_policy_spec.rb' - - 'spec/policies/email_domain_block_policy_spec.rb' - - 'spec/policies/instance_policy_spec.rb' - - 'spec/policies/invite_policy_spec.rb' - - 'spec/policies/relay_policy_spec.rb' - - 'spec/policies/report_note_policy_spec.rb' - - 'spec/policies/report_policy_spec.rb' - - 'spec/policies/settings_policy_spec.rb' - - 'spec/policies/tag_policy_spec.rb' - - 'spec/policies/user_policy_spec.rb' - - 'spec/services/activitypub/process_account_service_spec.rb' - RSpec/SubjectStub: Exclude: - 'spec/services/unallow_domain_service_spec.rb' diff --git a/spec/controllers/admin/domain_blocks_controller_spec.rb b/spec/controllers/admin/domain_blocks_controller_spec.rb index fb7fb2957..9be55906e 100644 --- a/spec/controllers/admin/domain_blocks_controller_spec.rb +++ b/spec/controllers/admin/domain_blocks_controller_spec.rb @@ -166,10 +166,11 @@ RSpec.describe Admin::DomainBlocksController do end describe 'PUT #update' do - let!(:remote_account) { Fabricate(:account, domain: 'example.com') } - let(:subject) do + subject do post :update, params: { :id => domain_block.id, :domain_block => { domain: 'example.com', severity: new_severity }, 'confirm' => '' } end + + let!(:remote_account) { Fabricate(:account, domain: 'example.com') } let(:domain_block) { Fabricate(:domain_block, domain: 'example.com', severity: original_severity) } before do diff --git a/spec/models/account_migration_spec.rb b/spec/models/account_migration_spec.rb index f4544740b..1f32c6082 100644 --- a/spec/models/account_migration_spec.rb +++ b/spec/models/account_migration_spec.rb @@ -4,11 +4,11 @@ require 'rails_helper' RSpec.describe AccountMigration do describe 'validations' do + subject { described_class.new(account: source_account, acct: target_acct) } + let(:source_account) { Fabricate(:account) } let(:target_acct) { target_account.acct } - let(:subject) { described_class.new(account: source_account, acct: target_acct) } - context 'with valid properties' do let(:target_account) { Fabricate(:account, username: 'target', domain: 'remote.org') } diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 7cd914774..d473a819e 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -20,7 +20,9 @@ RSpec.describe Account do end context 'when the account is of a local user' do - let!(:subject) { Fabricate(:user, email: 'foo+bar@domain.org').account } + subject { local_user_account } + + let!(:local_user_account) { Fabricate(:user, email: 'foo+bar@domain.org').account } it 'creates a canonical domain block' do subject.suspend! diff --git a/spec/models/relationship_filter_spec.rb b/spec/models/relationship_filter_spec.rb index b3e855c12..ac3188577 100644 --- a/spec/models/relationship_filter_spec.rb +++ b/spec/models/relationship_filter_spec.rb @@ -7,7 +7,7 @@ describe RelationshipFilter do describe '#results' do context 'when default params are used' do - let(:subject) do + subject do described_class.new(account, 'order' => 'active').results end diff --git a/spec/models/user_role_spec.rb b/spec/models/user_role_spec.rb index 27b967414..f7cfe9bb0 100644 --- a/spec/models/user_role_spec.rb +++ b/spec/models/user_role_spec.rb @@ -93,7 +93,7 @@ RSpec.describe UserRole do describe '#computed_permissions' do context 'when the role is nobody' do - let(:subject) { described_class.nobody } + subject { described_class.nobody } it 'returns none' do expect(subject.computed_permissions).to eq UserRole::Flags::NONE @@ -101,7 +101,7 @@ RSpec.describe UserRole do end context 'when the role is everyone' do - let(:subject) { described_class.everyone } + subject { described_class.everyone } it 'returns permissions' do expect(subject.computed_permissions).to eq subject.permissions diff --git a/spec/policies/account_moderation_note_policy_spec.rb b/spec/policies/account_moderation_note_policy_spec.rb index 90abdfea7..8c37acc39 100644 --- a/spec/policies/account_moderation_note_policy_spec.rb +++ b/spec/policies/account_moderation_note_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe AccountModerationNotePolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/account_policy_spec.rb b/spec/policies/account_policy_spec.rb index 9f4e94a6c..d7a21d8e3 100644 --- a/spec/policies/account_policy_spec.rb +++ b/spec/policies/account_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe AccountPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } let(:alice) { Fabricate(:account) } diff --git a/spec/policies/backup_policy_spec.rb b/spec/policies/backup_policy_spec.rb index 488d48f52..28cb65d78 100644 --- a/spec/policies/backup_policy_spec.rb +++ b/spec/policies/backup_policy_spec.rb @@ -4,8 +4,9 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe BackupPolicy do - let(:subject) { described_class } - let(:john) { Fabricate(:account) } + subject { described_class } + + let(:john) { Fabricate(:account) } permissions :create? do context 'when not user_signed_in?' do diff --git a/spec/policies/custom_emoji_policy_spec.rb b/spec/policies/custom_emoji_policy_spec.rb index cf7e7d924..cb869c7d9 100644 --- a/spec/policies/custom_emoji_policy_spec.rb +++ b/spec/policies/custom_emoji_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe CustomEmojiPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/domain_block_policy_spec.rb b/spec/policies/domain_block_policy_spec.rb index e254e2cf4..4c89f3f37 100644 --- a/spec/policies/domain_block_policy_spec.rb +++ b/spec/policies/domain_block_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe DomainBlockPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/email_domain_block_policy_spec.rb b/spec/policies/email_domain_block_policy_spec.rb index 6e57b1372..7ecff4be4 100644 --- a/spec/policies/email_domain_block_policy_spec.rb +++ b/spec/policies/email_domain_block_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe EmailDomainBlockPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/instance_policy_spec.rb b/spec/policies/instance_policy_spec.rb index 3e047bbe9..a0d9a008b 100644 --- a/spec/policies/instance_policy_spec.rb +++ b/spec/policies/instance_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe InstancePolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/invite_policy_spec.rb b/spec/policies/invite_policy_spec.rb index 50a312f44..cbe3735d8 100644 --- a/spec/policies/invite_policy_spec.rb +++ b/spec/policies/invite_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe InvitePolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:user).account } diff --git a/spec/policies/relay_policy_spec.rb b/spec/policies/relay_policy_spec.rb index 0d479e0ca..29ba02c26 100644 --- a/spec/policies/relay_policy_spec.rb +++ b/spec/policies/relay_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe RelayPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/report_note_policy_spec.rb b/spec/policies/report_note_policy_spec.rb index a657fce4b..b40a87888 100644 --- a/spec/policies/report_note_policy_spec.rb +++ b/spec/policies/report_note_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe ReportNotePolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/report_policy_spec.rb b/spec/policies/report_policy_spec.rb index 8f2533fa6..4fc417807 100644 --- a/spec/policies/report_policy_spec.rb +++ b/spec/policies/report_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe ReportPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/settings_policy_spec.rb b/spec/policies/settings_policy_spec.rb index 576bfa4ab..4a9931490 100644 --- a/spec/policies/settings_policy_spec.rb +++ b/spec/policies/settings_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe SettingsPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/tag_policy_spec.rb b/spec/policies/tag_policy_spec.rb index 7791cde15..35da3cc62 100644 --- a/spec/policies/tag_policy_spec.rb +++ b/spec/policies/tag_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe TagPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/policies/user_policy_spec.rb b/spec/policies/user_policy_spec.rb index 384119f25..fa476a9fc 100644 --- a/spec/policies/user_policy_spec.rb +++ b/spec/policies/user_policy_spec.rb @@ -4,7 +4,8 @@ require 'rails_helper' require 'pundit/rspec' RSpec.describe UserPolicy do - let(:subject) { described_class } + subject { described_class } + let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account } let(:john) { Fabricate(:account) } diff --git a/spec/services/activitypub/process_account_service_spec.rb b/spec/services/activitypub/process_account_service_spec.rb index db454d7ad..c02a0800a 100644 --- a/spec/services/activitypub/process_account_service_spec.rb +++ b/spec/services/activitypub/process_account_service_spec.rb @@ -113,11 +113,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do end context 'when discovering many subdomains in a short timeframe' do - before do - stub_const 'ActivityPub::ProcessAccountService::SUBDOMAINS_RATELIMIT', 5 - end - - let(:subject) do + subject do 8.times do |i| domain = "test#{i}.testdomain.com" json = { @@ -129,6 +125,10 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do end end + before do + stub_const 'ActivityPub::ProcessAccountService::SUBDOMAINS_RATELIMIT', 5 + end + it 'creates at least some accounts' do expect { subject }.to change { Account.remote.count }.by_at_least(2) end From 7824df0ecab80791c2ecdb59f1a6a7381a359c58 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 03:51:59 -0400 Subject: [PATCH 05/17] Exclude `lib/linter` from simplecov report (#25916) --- spec/spec_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ed228abeb..7b3af0f90 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,7 @@ if ENV['DISABLE_SIMPLECOV'] != 'true' require 'simplecov' SimpleCov.start 'rails' do + add_filter 'lib/linter' add_group 'Policies', 'app/policies' add_group 'Presenters', 'app/presenters' add_group 'Serializers', 'app/serializers' From 74806deb2c1d135b3454d4e222ede8fa5a637ed0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:02:19 -0400 Subject: [PATCH 06/17] Fix `RSpec/SubjectStub` cop (#25550) Co-authored-by: Claire --- .rubocop_todo.yml | 5 ----- spec/services/unallow_domain_service_spec.rb | 4 ++-- spec/validators/blacklisted_email_validator_spec.rb | 11 +++++++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9938916fc..7ec4e35f7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -409,11 +409,6 @@ RSpec/StubbedMock: - 'spec/lib/webfinger_resource_spec.rb' - 'spec/services/activitypub/process_collection_service_spec.rb' -RSpec/SubjectStub: - Exclude: - - 'spec/services/unallow_domain_service_spec.rb' - - 'spec/validators/blacklisted_email_validator_spec.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationController: Exclude: diff --git a/spec/services/unallow_domain_service_spec.rb b/spec/services/unallow_domain_service_spec.rb index e583a22de..f27b6fdf3 100644 --- a/spec/services/unallow_domain_service_spec.rb +++ b/spec/services/unallow_domain_service_spec.rb @@ -14,7 +14,7 @@ RSpec.describe UnallowDomainService, type: :service do context 'with limited federation mode' do before do - allow(subject).to receive(:whitelist_mode?).and_return(true) + allow(Rails.configuration.x).to receive(:whitelist_mode).and_return(true) end describe '#call' do @@ -40,7 +40,7 @@ RSpec.describe UnallowDomainService, type: :service do context 'without limited federation mode' do before do - allow(subject).to receive(:whitelist_mode?).and_return(false) + allow(Rails.configuration.x).to receive(:whitelist_mode).and_return(false) end describe '#call' do diff --git a/spec/validators/blacklisted_email_validator_spec.rb b/spec/validators/blacklisted_email_validator_spec.rb index 3d3d50f65..bfe2a11a9 100644 --- a/spec/validators/blacklisted_email_validator_spec.rb +++ b/spec/validators/blacklisted_email_validator_spec.rb @@ -11,14 +11,15 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do before do allow(user).to receive(:valid_invitation?).and_return(false) - allow_any_instance_of(described_class).to receive(:blocked_email_provider?) { blocked_email } + allow(EmailDomainBlock).to receive(:block?) { blocked_email } end context 'when e-mail provider is blocked' do let(:blocked_email) { true } it 'adds error' do - expect(subject).to have_received(:add).with(:email, :blocked) + described_class.new.validate(user) + expect(errors).to have_received(:add).with(:email, :blocked).once end end @@ -26,7 +27,8 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do let(:blocked_email) { false } it 'does not add errors' do - expect(subject).to_not have_received(:add).with(:email, :blocked) + described_class.new.validate(user) + expect(errors).to_not have_received(:add) end context 'when canonical e-mail is blocked' do @@ -37,7 +39,8 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do end it 'adds error' do - expect(subject).to have_received(:add).with(:email, :taken) + described_class.new.validate(user) + expect(errors).to have_received(:add).with(:email, :taken).once end end end From b786911c55423df345bea8e265d7cf9fd64744ed Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:02:32 -0400 Subject: [PATCH 07/17] Fix `Lint/SendWithMixinArgument` cop (#25920) --- .rubocop_todo.yml | 5 ----- config/application.rb | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7ec4e35f7..d950c2f57 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -106,11 +106,6 @@ Lint/OrAssignmentToConstant: Exclude: - 'lib/sanitize_ext/sanitize_config.rb' -# This cop supports safe autocorrection (--autocorrect). -Lint/SendWithMixinArgument: - Exclude: - - 'config/application.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: diff --git a/config/application.rb b/config/application.rb index 26f794203..6821d36b2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -196,10 +196,10 @@ module Mastodon config.to_prepare do Doorkeeper::AuthorizationsController.layout 'modal' Doorkeeper::AuthorizedApplicationsController.layout 'admin' - Doorkeeper::Application.send :include, ApplicationExtension - Doorkeeper::AccessToken.send :include, AccessTokenExtension - Devise::FailureApp.send :include, AbstractController::Callbacks - Devise::FailureApp.send :include, Localized + Doorkeeper::Application.include ApplicationExtension + Doorkeeper::AccessToken.include AccessTokenExtension + Devise::FailureApp.include AbstractController::Callbacks + Devise::FailureApp.include Localized end end end From 658742b3cd69c774277eb6b246801ce43e199d4d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:02:41 -0400 Subject: [PATCH 08/17] Fix `Lint/AmbiguousBlockAssociation` cop (#25921) --- .rubocop_todo.yml | 9 --------- .../confirmations_controller_spec.rb | 2 +- .../otp_authentication_controller_spec.rb | 4 ++-- .../activitypub/process_status_update_service_spec.rb | 4 ++-- spec/services/post_status_service_spec.rb | 2 +- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d950c2f57..0aaae67fb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -48,15 +48,6 @@ Layout/SpaceInLambdaLiteral: - 'config/environments/production.rb' - 'config/initializers/content_security_policy.rb' -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedMethods, AllowedPatterns. -Lint/AmbiguousBlockAssociation: - Exclude: - - 'spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/otp_authentication_controller_spec.rb' - - 'spec/services/activitypub/process_status_update_service_spec.rb' - - 'spec/services/post_status_service_spec.rb' - # Configuration parameters: AllowComments, AllowEmptyLambdas. Lint/EmptyBlock: Exclude: diff --git a/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb b/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb index 84dfd60b3..37381fe1f 100644 --- a/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb +++ b/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb @@ -104,7 +104,7 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do post :create, params: { form_two_factor_confirmation: { otp_attempt: '123456' } }, session: { challenge_passed_at: Time.now.utc, new_otp_secret: 'thisisasecretforthespecofnewview' } - end.to not_change { user.reload.otp_secret } + end.to(not_change { user.reload.otp_secret }) end it 'renders the new view' do diff --git a/spec/controllers/settings/two_factor_authentication/otp_authentication_controller_spec.rb b/spec/controllers/settings/two_factor_authentication/otp_authentication_controller_spec.rb index c8ba6f9a8..007df87d9 100644 --- a/spec/controllers/settings/two_factor_authentication/otp_authentication_controller_spec.rb +++ b/spec/controllers/settings/two_factor_authentication/otp_authentication_controller_spec.rb @@ -63,7 +63,7 @@ describe Settings::TwoFactorAuthentication::OtpAuthenticationController do expect do post :create, session: { challenge_passed_at: Time.now.utc } end.to not_change { user.reload.otp_secret } - .and change { session[:new_otp_secret] } + .and(change { session[:new_otp_secret] }) expect(response).to redirect_to(new_settings_two_factor_authentication_confirmation_path) end @@ -80,7 +80,7 @@ describe Settings::TwoFactorAuthentication::OtpAuthenticationController do expect do post :create, session: { challenge_passed_at: Time.now.utc } end.to not_change { user.reload.otp_secret } - .and change { session[:new_otp_secret] } + .and(change { session[:new_otp_secret] }) expect(response).to redirect_to(new_settings_two_factor_authentication_confirmation_path) end diff --git a/spec/services/activitypub/process_status_update_service_spec.rb b/spec/services/activitypub/process_status_update_service_spec.rb index 9d90e5eb8..f7bcfaf7f 100644 --- a/spec/services/activitypub/process_status_update_service_spec.rb +++ b/spec/services/activitypub/process_status_update_service_spec.rb @@ -214,11 +214,11 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do end it 'does not create any edits' do - expect { subject.call(status, json) }.to_not change { status.reload.edits.pluck(&:id) } + expect { subject.call(status, json) }.to_not(change { status.reload.edits.pluck(&:id) }) end it 'does not update the text, spoiler_text or edited_at' do - expect { subject.call(status, json) }.to_not change { s = status.reload; [s.text, s.spoiler_text, s.edited_at] } + expect { subject.call(status, json) }.to_not(change { s = status.reload; [s.text, s.spoiler_text, s.edited_at] }) end end diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb index d201292e1..7d7679c88 100644 --- a/spec/services/post_status_service_spec.rb +++ b/spec/services/post_status_service_spec.rb @@ -52,7 +52,7 @@ RSpec.describe PostStatusService, type: :service do end it 'does not change statuses count' do - expect { subject.call(account, text: 'Hi future!', scheduled_at: future, thread: previous_status) }.to_not change { [account.statuses_count, previous_status.replies_count] } + expect { subject.call(account, text: 'Hi future!', scheduled_at: future, thread: previous_status) }.to_not(change { [account.statuses_count, previous_status.replies_count] }) end end From b8b2470cf8e2aa77df2ebdcbf9106aeeb7dd6f68 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:03:06 -0400 Subject: [PATCH 09/17] Fix `Style/SlicingWithRange` cop (#25923) --- .rubocop_todo.yml | 15 --------------- app/lib/emoji_formatter.rb | 2 +- app/lib/text_formatter.rb | 6 +++--- app/models/account_alias.rb | 2 +- app/models/domain_block.rb | 2 +- app/models/email_domain_block.rb | 2 +- app/models/preview_card_provider.rb | 2 +- app/validators/status_length_validator.rb | 2 +- ...26175042_add_case_insensitive_index_to_tags.rb | 2 +- lib/active_record/batches.rb | 2 +- lib/mastodon/premailer_webpack_strategy.rb | 2 +- lib/tasks/repo.rake | 2 +- 12 files changed, 13 insertions(+), 28 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0aaae67fb..115d496c2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -908,21 +908,6 @@ Style/SingleArgumentDig: Exclude: - 'lib/webpacker/manifest_extensions.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/SlicingWithRange: - Exclude: - - 'app/lib/emoji_formatter.rb' - - 'app/lib/text_formatter.rb' - - 'app/models/account_alias.rb' - - 'app/models/domain_block.rb' - - 'app/models/email_domain_block.rb' - - 'app/models/preview_card_provider.rb' - - 'app/validators/status_length_validator.rb' - - 'db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb' - - 'lib/active_record/batches.rb' - - 'lib/mastodon/premailer_webpack_strategy.rb' - - 'lib/tasks/repo.rake' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: require_parentheses, require_no_parentheses diff --git a/app/lib/emoji_formatter.rb b/app/lib/emoji_formatter.rb index 8c3856d89..15b98dc57 100644 --- a/app/lib/emoji_formatter.rb +++ b/app/lib/emoji_formatter.rb @@ -53,7 +53,7 @@ class EmojiFormatter end end - result << Nokogiri::XML::Text.new(text[last_index..-1], tree.document) + result << Nokogiri::XML::Text.new(text[last_index..], tree.document) node.replace(result) end diff --git a/app/lib/text_formatter.rb b/app/lib/text_formatter.rb index 04b34cf19..f9205e7d4 100644 --- a/app/lib/text_formatter.rb +++ b/app/lib/text_formatter.rb @@ -57,8 +57,8 @@ class TextFormatter prefix = url.match(URL_PREFIX_REGEX).to_s display_url = url[prefix.length, 30] - suffix = url[prefix.length + 30..-1] - cutoff = url[prefix.length..-1].length > 30 + suffix = url[prefix.length + 30..] + cutoff = url[prefix.length..].length > 30 <<~HTML.squish.html_safe # rubocop:disable Rails/OutputSafety #{h(display_url)} @@ -84,7 +84,7 @@ class TextFormatter indices.last end - result << h(text[last_index..-1]) + result << h(text[last_index..]) result end diff --git a/app/models/account_alias.rb b/app/models/account_alias.rb index b7267d632..f859344fa 100644 --- a/app/models/account_alias.rb +++ b/app/models/account_alias.rb @@ -25,7 +25,7 @@ class AccountAlias < ApplicationRecord def acct=(val) val = val.to_s.strip - super(val.start_with?('@') ? val[1..-1] : val) + super(val.start_with?('@') ? val[1..] : val) end def pretty_acct diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb index 108dfe3d4..a7af2d62e 100644 --- a/app/models/domain_block.rb +++ b/app/models/domain_block.rb @@ -69,7 +69,7 @@ class DomainBlock < ApplicationRecord uri = Addressable::URI.new.tap { |u| u.host = domain.strip.delete('/') } segments = uri.normalized_host.split('.') - variants = segments.map.with_index { |_, i| segments[i..-1].join('.') } + variants = segments.map.with_index { |_, i| segments[i..].join('.') } where(domain: variants).order(Arel.sql('char_length(domain) desc')).first rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError diff --git a/app/models/email_domain_block.rb b/app/models/email_domain_block.rb index 3c9be51ca..60e90208d 100644 --- a/app/models/email_domain_block.rb +++ b/app/models/email_domain_block.rb @@ -64,7 +64,7 @@ class EmailDomainBlock < ApplicationRecord segments = uri.normalized_host.split('.') - segments.map.with_index { |_, i| segments[i..-1].join('.') } + segments.map.with_index { |_, i| segments[i..].join('.') } end end diff --git a/app/models/preview_card_provider.rb b/app/models/preview_card_provider.rb index 9f5f6d3cb..f3e4b4901 100644 --- a/app/models/preview_card_provider.rb +++ b/app/models/preview_card_provider.rb @@ -54,6 +54,6 @@ class PreviewCardProvider < ApplicationRecord def self.matching_domain(domain) segments = domain.split('.') - where(domain: segments.map.with_index { |_, i| segments[i..-1].join('.') }).order(Arel.sql('char_length(domain) desc')).first + where(domain: segments.map.with_index { |_, i| segments[i..].join('.') }).order(Arel.sql('char_length(domain) desc')).first end end diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb index e107912b7..727d24d91 100644 --- a/app/validators/status_length_validator.rb +++ b/app/validators/status_length_validator.rb @@ -53,7 +53,7 @@ class StatusLengthValidator < ActiveModel::Validator entity[:indices].last end - result << str[last_index..-1] + result << str[last_index..] result end end diff --git a/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb b/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb index 12cc40d96..f2d3aa8ee 100644 --- a/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb +++ b/db/migrate/20190726175042_add_case_insensitive_index_to_tags.rb @@ -6,7 +6,7 @@ class AddCaseInsensitiveIndexToTags < ActiveRecord::Migration[5.2] def up Tag.connection.select_all('SELECT string_agg(id::text, \',\') AS ids FROM tags GROUP BY lower(name) HAVING count(*) > 1').to_ary.each do |row| canonical_tag_id = row['ids'].split(',').first - redundant_tag_ids = row['ids'].split(',')[1..-1] + redundant_tag_ids = row['ids'].split(',')[1..] safety_assured do execute "UPDATE accounts_tags AS t0 SET tag_id = #{canonical_tag_id} WHERE tag_id IN (#{redundant_tag_ids.join(', ')}) AND NOT EXISTS (SELECT t1.tag_id FROM accounts_tags AS t1 WHERE t1.tag_id = #{canonical_tag_id} AND t1.account_id = t0.account_id)" diff --git a/lib/active_record/batches.rb b/lib/active_record/batches.rb index 55d29e52e..91e50cc43 100644 --- a/lib/active_record/batches.rb +++ b/lib/active_record/batches.rb @@ -29,7 +29,7 @@ module ActiveRecord if flatten yield record[1] else - yield record[1..-1] + yield record[1..] end end diff --git a/lib/mastodon/premailer_webpack_strategy.rb b/lib/mastodon/premailer_webpack_strategy.rb index 45e87603f..6816d0474 100644 --- a/lib/mastodon/premailer_webpack_strategy.rb +++ b/lib/mastodon/premailer_webpack_strategy.rb @@ -12,7 +12,7 @@ module PremailerWebpackStrategy css = if url.start_with?('http') HTTP.get(url).to_s else - url = url[1..-1] if url.start_with?('/') + url = url[1..] if url.start_with?('/') Rails.public_path.join(url).read end diff --git a/lib/tasks/repo.rake b/lib/tasks/repo.rake index 888337b4f..33c454444 100644 --- a/lib/tasks/repo.rake +++ b/lib/tasks/repo.rake @@ -50,7 +50,7 @@ namespace :repo do file.each_line do |line| if line.start_with?('-') new_line = line.gsub(/#([[:digit:]]+)*/) do |pull_request_reference| - pull_request_number = pull_request_reference[1..-1] + pull_request_number = pull_request_reference[1..] response = nil loop do From 5134fc65e27522f8d8116bc003ae83d54bf6f2be Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:03:19 -0400 Subject: [PATCH 10/17] Fix `Naming/AccessorMethodName` cop (#25924) --- .rubocop_todo.yml | 4 ---- app/controllers/auth/sessions_controller.rb | 2 +- app/controllers/concerns/two_factor_authentication_concern.rb | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 115d496c2..036fa37fa 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -151,10 +151,6 @@ Metrics/CyclomaticComplexity: Metrics/PerceivedComplexity: Max: 27 -Naming/AccessorMethodName: - Exclude: - - 'app/controllers/auth/sessions_controller.rb' - # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. # CheckDefinitionPathHierarchyRoots: lib, spec, test, src # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb index 4f59fd501..1380e6f28 100644 --- a/app/controllers/auth/sessions_controller.rb +++ b/app/controllers/auth/sessions_controller.rb @@ -124,7 +124,7 @@ class Auth::SessionsController < Devise::SessionsController redirect_to new_user_session_path, alert: I18n.t('devise.failure.timeout') end - def set_attempt_session(user) + def register_attempt_in_session(user) session[:attempt_user_id] = user.id session[:attempt_user_updated_at] = user.updated_at.to_s end diff --git a/app/controllers/concerns/two_factor_authentication_concern.rb b/app/controllers/concerns/two_factor_authentication_concern.rb index 94f3ce00f..9eb45b90d 100644 --- a/app/controllers/concerns/two_factor_authentication_concern.rb +++ b/app/controllers/concerns/two_factor_authentication_concern.rb @@ -75,7 +75,7 @@ module TwoFactorAuthenticationConcern end def prompt_for_two_factor(user) - set_attempt_session(user) + register_attempt_in_session(user) @body_classes = 'lighter' @webauthn_enabled = user.webauthn_enabled? From 2e1391fdd25627be0ff569f1f5091f4b1471a1a0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:08:51 -0400 Subject: [PATCH 11/17] Fix `Naming/MemoizedInstanceVariableName` cop (#25928) --- .rubocop_todo.yml | 13 ------------- app/controllers/api/v1/bookmarks_controller.rb | 2 +- app/controllers/api/v1/favourites_controller.rb | 2 +- app/controllers/concerns/rate_limit_headers.rb | 2 +- app/lib/activitypub/activity.rb | 4 ++-- app/services/resolve_url_service.rb | 2 +- app/services/search_service.rb | 2 +- config/initializers/rack_attack.rb | 4 ++-- 8 files changed, 9 insertions(+), 22 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 036fa37fa..9de96aa5b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -158,19 +158,6 @@ Naming/FileName: Exclude: - 'config/locales/sr-Latn.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyleForLeadingUnderscores. -# SupportedStylesForLeadingUnderscores: disallowed, required, optional -Naming/MemoizedInstanceVariableName: - Exclude: - - 'app/controllers/api/v1/bookmarks_controller.rb' - - 'app/controllers/api/v1/favourites_controller.rb' - - 'app/controllers/concerns/rate_limit_headers.rb' - - 'app/lib/activitypub/activity.rb' - - 'app/services/resolve_url_service.rb' - - 'app/services/search_service.rb' - - 'config/initializers/rack_attack.rb' - # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 diff --git a/app/controllers/api/v1/bookmarks_controller.rb b/app/controllers/api/v1/bookmarks_controller.rb index 0cc231840..498eb16f4 100644 --- a/app/controllers/api/v1/bookmarks_controller.rb +++ b/app/controllers/api/v1/bookmarks_controller.rb @@ -21,7 +21,7 @@ class Api::V1::BookmarksController < Api::BaseController end def results - @_results ||= account_bookmarks.joins(:status).eager_load(:status).to_a_paginated_by_id( + @results ||= account_bookmarks.joins(:status).eager_load(:status).to_a_paginated_by_id( limit_param(DEFAULT_STATUSES_LIMIT), params_slice(:max_id, :since_id, :min_id) ) diff --git a/app/controllers/api/v1/favourites_controller.rb b/app/controllers/api/v1/favourites_controller.rb index bd7f3d775..faf1bda96 100644 --- a/app/controllers/api/v1/favourites_controller.rb +++ b/app/controllers/api/v1/favourites_controller.rb @@ -21,7 +21,7 @@ class Api::V1::FavouritesController < Api::BaseController end def results - @_results ||= account_favourites.joins(:status).eager_load(:status).to_a_paginated_by_id( + @results ||= account_favourites.joins(:status).eager_load(:status).to_a_paginated_by_id( limit_param(DEFAULT_STATUSES_LIMIT), params_slice(:max_id, :since_id, :min_id) ) diff --git a/app/controllers/concerns/rate_limit_headers.rb b/app/controllers/concerns/rate_limit_headers.rb index 30702f00e..5b83d8575 100644 --- a/app/controllers/concerns/rate_limit_headers.rb +++ b/app/controllers/concerns/rate_limit_headers.rb @@ -61,7 +61,7 @@ module RateLimitHeaders end def request_time - @_request_time ||= Time.now.utc + @request_time ||= Time.now.utc end def reset_period_offset diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb index 5d9596254..51384ef98 100644 --- a/app/lib/activitypub/activity.rb +++ b/app/lib/activitypub/activity.rb @@ -143,11 +143,11 @@ class ActivityPub::Activity end def follow_request_from_object - @follow_request ||= FollowRequest.find_by(target_account: @account, uri: object_uri) unless object_uri.nil? + @follow_request_from_object ||= FollowRequest.find_by(target_account: @account, uri: object_uri) unless object_uri.nil? end def follow_from_object - @follow ||= ::Follow.find_by(target_account: @account, uri: object_uri) unless object_uri.nil? + @follow_from_object ||= ::Follow.find_by(target_account: @account, uri: object_uri) unless object_uri.nil? end def fetch_remote_original_status diff --git a/app/services/resolve_url_service.rb b/app/services/resolve_url_service.rb index d6e528654..19a94e77a 100644 --- a/app/services/resolve_url_service.rb +++ b/app/services/resolve_url_service.rb @@ -63,7 +63,7 @@ class ResolveURLService < BaseService end def fetch_resource_service - @_fetch_resource_service ||= FetchResourceService.new + @fetch_resource_service ||= FetchResourceService.new end def resource_url diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 778ea85fb..30937471b 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -82,7 +82,7 @@ class SearchService < BaseService end def url_resource - @_url_resource ||= ResolveURLService.new.call(@query, on_behalf_of: @account) + @url_resource ||= ResolveURLService.new.call(@query, on_behalf_of: @account) end def url_resource_symbol diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index da0b04af1..d0af0fe94 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -5,9 +5,9 @@ require 'doorkeeper/grape/authorization_decorator' class Rack::Attack class Request def authenticated_token - return @token if defined?(@token) + return @authenticated_token if defined?(@authenticated_token) - @token = Doorkeeper::OAuth::Token.authenticate( + @authenticated_token = Doorkeeper::OAuth::Token.authenticate( Doorkeeper::Grape::AuthorizationDecorator.new(self), *Doorkeeper.configuration.access_token_methods ) From 6c5a2233a8d0d3add76645313abf7a9f4f30016d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:20:10 -0400 Subject: [PATCH 12/17] Fix `RSpec/StubbedMock` cop (#25552) Co-authored-by: Claire --- .rubocop_todo.yml | 11 ----------- spec/controllers/api/base_controller_spec.rb | 3 ++- spec/controllers/api/v1/media_controller_spec.rb | 4 ++-- .../auth/registrations_controller_spec.rb | 6 ++++-- spec/helpers/application_helper_spec.rb | 13 ++++++------- spec/lib/status_filter_spec.rb | 4 ++-- spec/lib/status_finder_spec.rb | 7 +++++-- spec/lib/webfinger_resource_spec.rb | 3 ++- .../activitypub/process_collection_service_spec.rb | 6 +++--- 9 files changed, 26 insertions(+), 31 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9de96aa5b..83c0ef0f0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -367,17 +367,6 @@ RSpec/PendingWithoutReason: Exclude: - 'spec/models/account_spec.rb' -RSpec/StubbedMock: - Exclude: - - 'spec/controllers/api/base_controller_spec.rb' - - 'spec/controllers/api/v1/media_controller_spec.rb' - - 'spec/controllers/auth/registrations_controller_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/lib/status_filter_spec.rb' - - 'spec/lib/status_finder_spec.rb' - - 'spec/lib/webfinger_resource_spec.rb' - - 'spec/services/activitypub/process_collection_service_spec.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationController: Exclude: diff --git a/spec/controllers/api/base_controller_spec.rb b/spec/controllers/api/base_controller_spec.rb index 9f3ba8147..db1e8777f 100644 --- a/spec/controllers/api/base_controller_spec.rb +++ b/spec/controllers/api/base_controller_spec.rb @@ -88,10 +88,11 @@ describe Api::BaseController do Mastodon::NotPermittedError => 403, }.each do |error, code| it "Handles error class of #{error}" do - expect(FakeService).to receive(:new).and_raise(error) + allow(FakeService).to receive(:new).and_raise(error) get 'error' expect(response).to have_http_status(code) + expect(FakeService).to have_received(:new) end end end diff --git a/spec/controllers/api/v1/media_controller_spec.rb b/spec/controllers/api/v1/media_controller_spec.rb index 79a9d1474..94b2a0a98 100644 --- a/spec/controllers/api/v1/media_controller_spec.rb +++ b/spec/controllers/api/v1/media_controller_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Api::V1::MediaController do describe 'with paperclip errors' do context 'when imagemagick cant identify the file type' do it 'returns http 422' do - expect_any_instance_of(Account).to receive_message_chain(:media_attachments, :create!).and_raise(Paperclip::Errors::NotIdentifiedByImageMagickError) + allow_any_instance_of(Account).to receive_message_chain(:media_attachments, :create!).and_raise(Paperclip::Errors::NotIdentifiedByImageMagickError) post :create, params: { file: fixture_file_upload('attachment.jpg', 'image/jpeg') } expect(response).to have_http_status(422) @@ -25,7 +25,7 @@ RSpec.describe Api::V1::MediaController do context 'when there is a generic error' do it 'returns http 422' do - expect_any_instance_of(Account).to receive_message_chain(:media_attachments, :create!).and_raise(Paperclip::Error) + allow_any_instance_of(Account).to receive_message_chain(:media_attachments, :create!).and_raise(Paperclip::Error) post :create, params: { file: fixture_file_upload('attachment.jpg', 'image/jpeg') } expect(response).to have_http_status(500) diff --git a/spec/controllers/auth/registrations_controller_spec.rb b/spec/controllers/auth/registrations_controller_spec.rb index ec82cd07b..a9b24a100 100644 --- a/spec/controllers/auth/registrations_controller_spec.rb +++ b/spec/controllers/auth/registrations_controller_spec.rb @@ -15,20 +15,22 @@ RSpec.describe Auth::RegistrationsController do it 'redirects if it is in single user mode while it is open for registration' do Fabricate(:account) Setting.registrations_mode = 'open' - expect(Rails.configuration.x).to receive(:single_user_mode).and_return(true) + allow(Rails.configuration.x).to receive(:single_user_mode).and_return(true) get path expect(response).to redirect_to '/' + expect(Rails.configuration.x).to have_received(:single_user_mode) end it 'redirects if it is not open for registration while it is not in single user mode' do Setting.registrations_mode = 'none' - expect(Rails.configuration.x).to receive(:single_user_mode).and_return(false) + allow(Rails.configuration.x).to receive(:single_user_mode).and_return(false) get path expect(response).to redirect_to '/' + expect(Rails.configuration.x).to have_received(:single_user_mode) end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index d191265ca..d0b2900d6 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -77,19 +77,17 @@ describe ApplicationHelper do describe 'open_registrations?' do it 'returns true when open for registrations' do - without_partial_double_verification do - expect(Setting).to receive(:registrations_mode).and_return('open') - end + allow(Setting).to receive(:[]).with('registrations_mode').and_return('open') expect(helper.open_registrations?).to be true + expect(Setting).to have_received(:[]).with('registrations_mode') end it 'returns false when closed for registrations' do - without_partial_double_verification do - expect(Setting).to receive(:registrations_mode).and_return('none') - end + allow(Setting).to receive(:[]).with('registrations_mode').and_return('none') expect(helper.open_registrations?).to be false + expect(Setting).to have_received(:[]).with('registrations_mode') end end @@ -296,8 +294,9 @@ describe ApplicationHelper do it 'returns site title on production environment' do Setting.site_title = 'site title' - expect(Rails.env).to receive(:production?).and_return(true) + allow(Rails.env).to receive(:production?).and_return(true) expect(helper.title).to eq 'site title' + expect(Rails.env).to have_received(:production?) end end end diff --git a/spec/lib/status_filter_spec.rb b/spec/lib/status_filter_spec.rb index 98e2ef913..c994ad419 100644 --- a/spec/lib/status_filter_spec.rb +++ b/spec/lib/status_filter_spec.rb @@ -23,7 +23,7 @@ describe StatusFilter do context 'when status policy does not allow show' do it 'filters the status' do - expect_any_instance_of(StatusPolicy).to receive(:show?).and_return(false) + allow_any_instance_of(StatusPolicy).to receive(:show?).and_return(false) expect(filter).to be_filtered end @@ -74,7 +74,7 @@ describe StatusFilter do context 'when status policy does not allow show' do it 'filters the status' do - expect_any_instance_of(StatusPolicy).to receive(:show?).and_return(false) + allow_any_instance_of(StatusPolicy).to receive(:show?).and_return(false) expect(filter).to be_filtered end diff --git a/spec/lib/status_finder_spec.rb b/spec/lib/status_finder_spec.rb index 61483f4bf..53f5039af 100644 --- a/spec/lib/status_finder_spec.rb +++ b/spec/lib/status_finder_spec.rb @@ -18,10 +18,13 @@ describe StatusFinder do it 'raises an error if action is not :show' do recognized = Rails.application.routes.recognize_path(url) - expect(recognized).to receive(:[]).with(:action).and_return(:create) - expect(Rails.application.routes).to receive(:recognize_path).with(url).and_return(recognized) + allow(recognized).to receive(:[]).with(:action).and_return(:create) + allow(Rails.application.routes).to receive(:recognize_path).with(url).and_return(recognized) expect { subject.status }.to raise_error(ActiveRecord::RecordNotFound) + + expect(Rails.application.routes).to have_received(:recognize_path) + expect(recognized).to have_received(:[]) end end diff --git a/spec/lib/webfinger_resource_spec.rb b/spec/lib/webfinger_resource_spec.rb index 2cad04fcc..558a31892 100644 --- a/spec/lib/webfinger_resource_spec.rb +++ b/spec/lib/webfinger_resource_spec.rb @@ -27,13 +27,14 @@ describe WebfingerResource do recognized = Rails.application.routes.recognize_path(resource) allow(recognized).to receive(:[]).with(:controller).and_return('accounts') allow(recognized).to receive(:[]).with(:username).and_return('alice') - expect(recognized).to receive(:[]).with(:action).and_return('create') + allow(recognized).to receive(:[]).with(:action).and_return('create') expect(Rails.application.routes).to receive(:recognize_path).with(resource).and_return(recognized).at_least(:once) expect do described_class.new(resource).username end.to raise_error(ActiveRecord::RecordNotFound) + expect(recognized).to have_received(:[]).exactly(3).times end it 'raises with a string that doesnt start with URL' do diff --git a/spec/services/activitypub/process_collection_service_spec.rb b/spec/services/activitypub/process_collection_service_spec.rb index 1433d0c50..3cd60a619 100644 --- a/spec/services/activitypub/process_collection_service_spec.rb +++ b/spec/services/activitypub/process_collection_service_spec.rb @@ -70,7 +70,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do let(:forwarder) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/other_account') } it 'does not process payload if no signature exists' do - expect_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil) + allow_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil) expect(ActivityPub::Activity).to_not receive(:factory) subject.call(json, forwarder) @@ -79,7 +79,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do it 'processes payload with actor if valid signature exists' do payload['signature'] = { 'type' => 'RsaSignature2017' } - expect_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(actor) + allow_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(actor) expect(ActivityPub::Activity).to receive(:factory).with(instance_of(Hash), actor, instance_of(Hash)) subject.call(json, forwarder) @@ -88,7 +88,7 @@ RSpec.describe ActivityPub::ProcessCollectionService, type: :service do it 'does not process payload if invalid signature exists' do payload['signature'] = { 'type' => 'RsaSignature2017' } - expect_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil) + allow_any_instance_of(ActivityPub::LinkedDataSignature).to receive(:verify_actor!).and_return(nil) expect(ActivityPub::Activity).to_not receive(:factory) subject.call(json, forwarder) From f831452037401b3bf85b910542a06544111cea60 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 04:44:58 -0400 Subject: [PATCH 13/17] Refactor `Snowflake` to avoid brakeman sql injection warnings (#25879) --- config/brakeman.ignore | 23 ---------- lib/mastodon/snowflake.rb | 92 ++++++++++++++++++++++----------------- 2 files changed, 52 insertions(+), 63 deletions(-) diff --git a/config/brakeman.ignore b/config/brakeman.ignore index d67d6ff0c..4f21944b6 100644 --- a/config/brakeman.ignore +++ b/config/brakeman.ignore @@ -79,29 +79,6 @@ ], "note": "" }, - { - "warning_type": "SQL Injection", - "warning_code": 0, - "fingerprint": "75fcd147b7611763ab6915faf8c5b0709e612b460f27c05c72d8b9bd0a6a77f8", - "check_name": "SQL", - "message": "Possible SQL injection", - "file": "lib/mastodon/snowflake.rb", - "line": 87, - "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/", - "code": "connection.execute(\"CREATE OR REPLACE FUNCTION timestamp_id(table_name text)\\nRETURNS bigint AS\\n$$\\n DECLARE\\n time_part bigint;\\n sequence_base bigint;\\n tail bigint;\\n BEGIN\\n time_part := (\\n -- Get the time in milliseconds\\n ((date_part('epoch', now()) * 1000))::bigint\\n -- And shift it over two bytes\\n << 16);\\n\\n sequence_base := (\\n 'x' ||\\n -- Take the first two bytes (four hex characters)\\n substr(\\n -- Of the MD5 hash of the data we documented\\n md5(table_name || '#{SecureRandom.hex(16)}' || time_part::text),\\n 1, 4\\n )\\n -- And turn it into a bigint\\n )::bit(16)::bigint;\\n\\n -- Finally, add our sequence number to our base, and chop\\n -- it to the last two bytes\\n tail := (\\n (sequence_base + nextval(table_name || '_id_seq'))\\n & 65535);\\n\\n -- Return the time part and the sequence part. OR appears\\n -- faster here than addition, but they're equivalent:\\n -- time_part has no trailing two bytes, and tail is only\\n -- the last two bytes.\\n RETURN time_part | tail;\\n END\\n$$ LANGUAGE plpgsql VOLATILE;\\n\")", - "render_path": null, - "location": { - "type": "method", - "class": "Mastodon::Snowflake", - "method": "define_timestamp_id" - }, - "user_input": "SecureRandom.hex(16)", - "confidence": "Medium", - "cwe_id": [ - 89 - ], - "note": "" - }, { "warning_type": "Denial of Service", "warning_code": 76, diff --git a/lib/mastodon/snowflake.rb b/lib/mastodon/snowflake.rb index 32ed140c3..8b79541da 100644 --- a/lib/mastodon/snowflake.rb +++ b/lib/mastodon/snowflake.rb @@ -64,46 +64,7 @@ module Mastodon::Snowflake def define_timestamp_id return if already_defined? - connection.execute(<<~SQL) - CREATE OR REPLACE FUNCTION timestamp_id(table_name text) - RETURNS bigint AS - $$ - DECLARE - time_part bigint; - sequence_base bigint; - tail bigint; - BEGIN - time_part := ( - -- Get the time in milliseconds - ((date_part('epoch', now()) * 1000))::bigint - -- And shift it over two bytes - << 16); - - sequence_base := ( - 'x' || - -- Take the first two bytes (four hex characters) - substr( - -- Of the MD5 hash of the data we documented - md5(table_name || '#{SecureRandom.hex(16)}' || time_part::text), - 1, 4 - ) - -- And turn it into a bigint - )::bit(16)::bigint; - - -- Finally, add our sequence number to our base, and chop - -- it to the last two bytes - tail := ( - (sequence_base + nextval(table_name || '_id_seq')) - & 65535); - - -- Return the time part and the sequence part. OR appears - -- faster here than addition, but they're equivalent: - -- time_part has no trailing two bytes, and tail is only - -- the last two bytes. - RETURN time_part | tail; - END - $$ LANGUAGE plpgsql VOLATILE; - SQL + connection.execute(sanitized_timestamp_id_sql) end def ensure_id_sequences_exist @@ -153,6 +114,57 @@ module Mastodon::Snowflake SQL end + def sanitized_timestamp_id_sql + ActiveRecord::Base.sanitize_sql_array(timestamp_id_sql_array) + end + + def timestamp_id_sql_array + [timestamp_id_sql_string, { random_string: SecureRandom.hex(16) }] + end + + def timestamp_id_sql_string + <<~SQL + CREATE OR REPLACE FUNCTION timestamp_id(table_name text) + RETURNS bigint AS + $$ + DECLARE + time_part bigint; + sequence_base bigint; + tail bigint; + BEGIN + time_part := ( + -- Get the time in milliseconds + ((date_part('epoch', now()) * 1000))::bigint + -- And shift it over two bytes + << 16); + + sequence_base := ( + 'x' || + -- Take the first two bytes (four hex characters) + substr( + -- Of the MD5 hash of the data we documented + md5(table_name || :random_string || time_part::text), + 1, 4 + ) + -- And turn it into a bigint + )::bit(16)::bigint; + + -- Finally, add our sequence number to our base, and chop + -- it to the last two bytes + tail := ( + (sequence_base + nextval(table_name || '_id_seq')) + & 65535); + + -- Return the time part and the sequence part. OR appears + -- faster here than addition, but they're equivalent: + -- time_part has no trailing two bytes, and tail is only + -- the last two bytes. + RETURN time_part | tail; + END + $$ LANGUAGE plpgsql VOLATILE; + SQL + end + def connection ActiveRecord::Base.connection end From be34b437eda14b7c3f823e39d9ab7b4902e55a25 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Wed, 12 Jul 2023 12:31:10 +0200 Subject: [PATCH 14/17] Update `haml-lint` (#25929) --- .haml-lint_todo.yml | 60 ++++----------------------------------------- Gemfile.lock | 4 +-- 2 files changed, 7 insertions(+), 57 deletions(-) diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index c60168390..31b79f7db 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,73 +1,23 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2023-03-15 00:55:01 -0400 using Haml-Lint version 0.45.0. +# on 2023-07-11 23:58:05 +0200 using Haml-Lint version 0.48.0. # The point is for the user to remove these configuration records # one by one as the lints are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of Haml-Lint, may require this file to be generated again. linters: - # Offense count: 63 + # Offense count: 94 RuboCop: - exclude: - - 'app/views/accounts/_og.html.haml' - - 'app/views/admin/account_warnings/_account_warning.html.haml' - - 'app/views/admin/accounts/index.html.haml' - - 'app/views/admin/accounts/show.html.haml' - - 'app/views/admin/announcements/edit.html.haml' - - 'app/views/admin/announcements/new.html.haml' - - 'app/views/admin/disputes/appeals/_appeal.html.haml' - - 'app/views/admin/domain_blocks/edit.html.haml' - - 'app/views/admin/domain_blocks/new.html.haml' - - 'app/views/admin/ip_blocks/new.html.haml' - - 'app/views/admin/reports/actions/preview.html.haml' - - 'app/views/admin/reports/index.html.haml' - - 'app/views/admin/reports/show.html.haml' - - 'app/views/admin/roles/_form.html.haml' - - 'app/views/admin/settings/about/show.html.haml' - - 'app/views/admin/settings/appearance/show.html.haml' - - 'app/views/admin/settings/registrations/show.html.haml' - - 'app/views/admin/statuses/show.html.haml' - - 'app/views/auth/registrations/new.html.haml' - - 'app/views/disputes/strikes/show.html.haml' - - 'app/views/filters/_filter_fields.html.haml' - - 'app/views/invites/_form.html.haml' - - 'app/views/layouts/application.html.haml' - - 'app/views/layouts/error.html.haml' - - 'app/views/notification_mailer/_status.html.haml' - - 'app/views/settings/applications/_fields.html.haml' - - 'app/views/settings/imports/show.html.haml' - - 'app/views/settings/preferences/appearance/show.html.haml' - - 'app/views/settings/preferences/other/show.html.haml' - - 'app/views/statuses/_detailed_status.html.haml' - - 'app/views/statuses/_poll.html.haml' - - 'app/views/statuses/show.html.haml' - - 'app/views/statuses_cleanup/show.html.haml' - - 'app/views/user_mailer/warning.html.haml' + enabled: false - # Offense count: 913 + # Offense count: 960 LineLength: enabled: false # Offense count: 22 UnnecessaryStringOutput: - exclude: - - 'app/views/accounts/show.html.haml' - - 'app/views/admin/custom_emojis/_custom_emoji.html.haml' - - 'app/views/admin/relays/_relay.html.haml' - - 'app/views/admin/rules/_rule.html.haml' - - 'app/views/admin/statuses/index.html.haml' - - 'app/views/auth/registrations/_sessions.html.haml' - - 'app/views/disputes/strikes/show.html.haml' - - 'app/views/notification_mailer/_status.html.haml' - - 'app/views/settings/two_factor_authentication_methods/index.html.haml' - - 'app/views/statuses/_detailed_status.html.haml' - - 'app/views/statuses/_poll.html.haml' - - 'app/views/statuses/_simple_status.html.haml' - - 'app/views/user_mailer/suspicious_sign_in.html.haml' - - 'app/views/user_mailer/webauthn_credential_added.html.haml' - - 'app/views/user_mailer/webauthn_credential_deleted.html.haml' - - 'app/views/user_mailer/welcome.html.haml' + enabled: false # Offense count: 3 ViewLength: diff --git a/Gemfile.lock b/Gemfile.lock index 29adaf9cf..5e1309622 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -291,11 +291,11 @@ GEM activesupport (>= 5.1) haml (>= 4.0.6) railties (>= 5.1) - haml_lint (0.45.0) + haml_lint (0.48.0) haml (>= 4.0, < 6.2) parallel (~> 1.10) rainbow - rubocop (>= 0.50.0) + rubocop (>= 1.0) sysexits (~> 1.1) hashdiff (1.0.1) hashie (5.0.0) From ecd8e0d6121cfd25a6a50181aaee0318d0d09896 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Wed, 12 Jul 2023 12:31:23 +0200 Subject: [PATCH 15/17] Update Stylelint (#25819) --- app/javascript/styles/mailer.scss | 2 +- package.json | 4 +- yarn.lock | 246 ++++++++++++++++-------------- 3 files changed, 131 insertions(+), 121 deletions(-) diff --git a/app/javascript/styles/mailer.scss b/app/javascript/styles/mailer.scss index a12f74fc0..92d00cae8 100644 --- a/app/javascript/styles/mailer.scss +++ b/app/javascript/styles/mailer.scss @@ -541,7 +541,7 @@ ul.rules-list { padding-top: 0; } -@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) { +@media only screen and (device-width >= 768px) and (device-width <= 1024px) and (orientation: landscape) { body { min-height: 1024px !important; } diff --git a/package.json b/package.json index 49e9c7f74..1dc3f506a 100644 --- a/package.json +++ b/package.json @@ -201,8 +201,8 @@ "lint-staged": "^13.2.2", "prettier": "^2.8.8", "react-test-renderer": "^18.2.0", - "stylelint": "^15.6.2", - "stylelint-config-standard-scss": "^9.0.0", + "stylelint": "^15.10.1", + "stylelint-config-standard-scss": "^10.0.0", "typescript": "^5.0.4", "webpack-dev-server": "^3.11.3", "yargs": "^17.7.2" diff --git a/yarn.lock b/yarn.lock index 41d172d3e..7ca9b5084 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1123,25 +1123,25 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@csstools/css-parser-algorithms@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.2.0.tgz#1268b07196d1118296443aeff41bca27d94b0981" - integrity sha512-9BoQ/jSrPq4vv3b9jjLW+PNNv56KlDH5JMx5yASSNrCtvq70FCNZUjXRvbCeR9hYj9ZyhURtqpU/RFIgg6kiOw== +"@csstools/css-parser-algorithms@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.0.tgz#0cc3a656dc2d638370ecf6f98358973bfbd00141" + integrity sha512-dTKSIHHWc0zPvcS5cqGP+/TPFUJB0ekJ9dGKvMAFoNuBFhDPBt9OMGNZiIA5vTiNdGHHBeScYPXIGBMnVOahsA== "@csstools/css-tokenizer@^2.1.1": version "2.1.1" resolved "https://registry.yarnpkg.com/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz#07ae11a0a06365d7ec686549db7b729bc036528e" integrity sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA== -"@csstools/media-query-list-parser@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.0.tgz#6e1a5e12e0d103cd13b94bddb88b878bd6866103" - integrity sha512-MXkR+TeaS2q9IkpyO6jVCdtA/bfpABJxIrfkLswThFN8EZZgI2RfAHhm6sDNDuYV25d5+b8Lj1fpTccIcSLPsQ== +"@csstools/media-query-list-parser@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.2.tgz#6ef642b728d30c1009bfbba3211c7e4c11302728" + integrity sha512-M8cFGGwl866o6++vIY7j1AKuq9v57cf+dGepScwCcbut9ypJNr4Cj+LLTWligYUZ0uyhEoJDKt5lvyBfh2L3ZQ== -"@csstools/selector-specificity@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-2.2.0.tgz#2cbcf822bf3764c9658c4d2e568bd0c0cb748016" - integrity sha512-+OJ9konv95ClSTOJCmMZqpd5+YGsB2S+x6w3E1oaM8UuR5j8nTNHYSz8c9BEPGDOCMQYIEEGlVPj/VY64iTbGw== +"@csstools/selector-specificity@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz#798622546b63847e82389e473fd67f2707d82247" + integrity sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g== "@discoveryjs/json-ext@0.5.7": version "0.5.7" @@ -2150,7 +2150,7 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/minimist@^1.2.0": +"@types/minimist@^1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== @@ -3701,21 +3701,22 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== +camelcase-keys@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-7.0.2.tgz#d048d8c69448745bb0de6fc4c1c52a30dfbe7252" + integrity sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg== dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" + camelcase "^6.3.0" + map-obj "^4.1.0" + quick-lru "^5.1.1" + type-fest "^1.2.1" camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.2.0: +camelcase@^6.2.0, camelcase@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -4451,6 +4452,11 @@ decamelize@^1.1.0, decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== +decamelize@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-5.0.1.tgz#db11a92e58c741ef339fb0a2868d8a06a9a7b1e9" + integrity sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA== + decimal.js@^10.4.2, decimal.js@^10.4.3: version "10.4.3" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" @@ -5493,6 +5499,17 @@ fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.0.tgz#7c40cb491e1e2ed5664749e87bfb516dbe8727c0" + integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -6170,11 +6187,6 @@ homedir-polyfill@^1.0.1: dependencies: parse-passwd "^1.0.0" -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - hosted-git-info@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" @@ -6409,6 +6421,11 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== +indent-string@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-5.0.0.tgz#4fd2980fccaf8622d14c64d694f4cf33c81951a5" + integrity sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== + infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" @@ -7861,7 +7878,7 @@ map-obj@^1.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== -map-obj@^4.0.0: +map-obj@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== @@ -7933,23 +7950,23 @@ memory-fs@^0.5.0: errno "^0.1.3" readable-stream "^2.0.1" -meow@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" - integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== +meow@^10.1.5: + version "10.1.5" + resolved "https://registry.yarnpkg.com/meow/-/meow-10.1.5.tgz#be52a1d87b5f5698602b0f32875ee5940904aa7f" + integrity sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw== dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize "^1.2.0" + "@types/minimist" "^1.2.2" + camelcase-keys "^7.0.0" + decamelize "^5.0.0" decamelize-keys "^1.1.0" hard-rejection "^2.1.0" minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" + normalize-package-data "^3.0.2" + read-pkg-up "^8.0.0" + redent "^4.0.0" + trim-newlines "^4.0.2" + type-fest "^1.2.2" + yargs-parser "^20.2.9" merge-descriptors@1.0.1: version "1.0.1" @@ -8038,7 +8055,7 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== -min-indent@^1.0.0: +min-indent@^1.0.0, min-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== @@ -8314,17 +8331,7 @@ node-releases@^2.0.12: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^3.0.0: +normalize-package-data@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== @@ -9445,10 +9452,10 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== raf@^3.1.0: version "3.4.1" @@ -9769,24 +9776,24 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== +read-pkg-up@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-8.0.0.tgz#72f595b65e66110f43b052dd9af4de6b10534670" + integrity sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ== dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" + find-up "^5.0.0" + read-pkg "^6.0.0" + type-fest "^1.0.1" -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== +read-pkg@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-6.0.0.tgz#a67a7d6a1c2b0c3cd6aa2ea521f40c458a4a504c" + integrity sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q== dependencies: "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" + normalize-package-data "^3.0.2" + parse-json "^5.2.0" + type-fest "^1.0.1" readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.3.3, readable-stream@^2.3.6: version "2.3.8" @@ -9844,6 +9851,14 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" +redent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-4.0.0.tgz#0c0ba7caabb24257ab3bb7a4fd95dd1d5c5681f9" + integrity sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag== + dependencies: + indent-string "^5.0.0" + strip-indent "^4.0.0" + redis@^4.6.5: version "4.6.7" resolved "https://registry.yarnpkg.com/redis/-/redis-4.6.7.tgz#c73123ad0b572776223f172ec78185adb72a6b57" @@ -10045,7 +10060,7 @@ resolve.exports@^2.0.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== -resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1: +resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1: version "1.22.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== @@ -10275,7 +10290,7 @@ selfsigned@^1.10.8: dependencies: node-forge "^0.10.0" -"semver@2 || 3 || 4 || 5", semver@^5.5.0: +semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -10951,6 +10966,13 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" +strip-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-4.0.0.tgz#b41379433dd06f5eae805e21d631e07ee670d853" + integrity sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA== + dependencies: + min-indent "^1.0.1" + strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -10969,26 +10991,26 @@ stylehacks@^6.0.0: browserslist "^4.21.4" postcss-selector-parser "^6.0.4" -stylelint-config-recommended-scss@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-11.0.0.tgz#7b933ecac99cd3b52d14d1746e3ecd36f421b4b6" - integrity sha512-EDghTDU7aOv2LTsRZvcT1w8mcjUaMhuy+t38iV5I/0Qiu6ixdkRwhLEMul3K/fnB2v9Nwqvb3xpvJfPH+HduDw== +stylelint-config-recommended-scss@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-12.0.0.tgz#9d9e82c46012649f11bfebcbc788f58e61860f33" + integrity sha512-5Bb2mlGy6WLa30oNeKpZvavv2lowJUsUJO25+OA68GFTemlwd1zbFsL7q0bReKipOSU3sG47hKneZ6Nd+ctrFA== dependencies: postcss-scss "^4.0.6" stylelint-config-recommended "^12.0.0" - stylelint-scss "^4.6.0" + stylelint-scss "^5.0.0" stylelint-config-recommended@^12.0.0: version "12.0.0" resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz#d0993232fca017065fd5acfcb52dd8a188784ef4" integrity sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ== -stylelint-config-standard-scss@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-standard-scss/-/stylelint-config-standard-scss-9.0.0.tgz#70c66e1179612519fdf6ca1dbff23c804def1b6b" - integrity sha512-yPKpJsrZn4ybuQZx/DkEHuCjw7pJginErE/47dFhCnrvD48IJ4UYec8tSiCuJWMA3HRjbIa3nh5ZeSauDGuVAg== +stylelint-config-standard-scss@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-standard-scss/-/stylelint-config-standard-scss-10.0.0.tgz#159a54a01b80649bf0143fa7ba086b676a1a749e" + integrity sha512-bChBEo1p3xUVWh/wenJI+josoMk21f2yuLDGzGjmKYcALfl2u3DFltY+n4UHswYiXghqXaA8mRh+bFy/q1hQlg== dependencies: - stylelint-config-recommended-scss "^11.0.0" + stylelint-config-recommended-scss "^12.0.0" stylelint-config-standard "^33.0.0" stylelint-config-standard@^33.0.0: @@ -10998,32 +11020,32 @@ stylelint-config-standard@^33.0.0: dependencies: stylelint-config-recommended "^12.0.0" -stylelint-scss@^4.6.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-4.7.0.tgz#f986bf8c5a4b93eae2b67d3a3562eef822657908" - integrity sha512-TSUgIeS0H3jqDZnby1UO1Qv3poi1N8wUYIJY6D1tuUq2MN3lwp/rITVo0wD+1SWTmRm0tNmGO0b7nKInnqF6Hg== +stylelint-scss@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-5.0.1.tgz#b33a6580b5734eace083cfc2cc3021225e28547f" + integrity sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ== dependencies: postcss-media-query-parser "^0.2.3" postcss-resolve-nested-selector "^0.1.1" - postcss-selector-parser "^6.0.11" + postcss-selector-parser "^6.0.13" postcss-value-parser "^4.2.0" -stylelint@^15.6.2: - version "15.7.0" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-15.7.0.tgz#945939a2ce9516998a198580e69b1ceef8a7c5f3" - integrity sha512-fQRwHwWuZsDn4ENyE9AsKkOkV9WlD2CmYiVDbdZPdS3iZh0ceypOn1EuwTNuZ8xTrHF+jVeIEzLtFFSlD/nJHg== +stylelint@^15.10.1: + version "15.10.1" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-15.10.1.tgz#93f189958687e330c106b010cbec0c41dcae506d" + integrity sha512-CYkzYrCFfA/gnOR+u9kJ1PpzwG10WLVnoxHDuBA/JiwGqdM9+yx9+ou6SE/y9YHtfv1mcLo06fdadHTOx4gBZQ== dependencies: - "@csstools/css-parser-algorithms" "^2.2.0" + "@csstools/css-parser-algorithms" "^2.3.0" "@csstools/css-tokenizer" "^2.1.1" - "@csstools/media-query-list-parser" "^2.1.0" - "@csstools/selector-specificity" "^2.2.0" + "@csstools/media-query-list-parser" "^2.1.2" + "@csstools/selector-specificity" "^3.0.0" balanced-match "^2.0.0" colord "^2.9.3" cosmiconfig "^8.2.0" css-functions-list "^3.1.0" css-tree "^2.3.1" debug "^4.3.4" - fast-glob "^3.2.12" + fast-glob "^3.3.0" fastest-levenshtein "^1.0.16" file-entry-cache "^6.0.1" global-modules "^2.0.0" @@ -11036,12 +11058,11 @@ stylelint@^15.6.2: is-plain-object "^5.0.0" known-css-properties "^0.27.0" mathml-tag-names "^2.1.3" - meow "^9.0.0" + meow "^10.1.5" micromatch "^4.0.5" normalize-path "^3.0.0" picocolors "^1.0.0" postcss "^8.4.24" - postcss-media-query-parser "^0.2.3" postcss-resolve-nested-selector "^0.1.1" postcss-safe-parser "^6.0.0" postcss-selector-parser "^6.0.13" @@ -11053,7 +11074,6 @@ stylelint@^15.6.2: supports-hyperlinks "^3.0.0" svg-tags "^1.0.0" table "^6.8.1" - v8-compile-cache "^2.3.0" write-file-atomic "^5.0.1" stylis@4.2.0: @@ -11378,10 +11398,10 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -trim-newlines@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" - integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== +trim-newlines@^4.0.2: + version "4.1.1" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-4.1.1.tgz#28c88deb50ed10c7ba6dc2474421904a00139125" + integrity sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ== tsconfig-paths@^3.14.1: version "3.14.2" @@ -11459,11 +11479,6 @@ type-fest@^0.16.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860" integrity sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg== -type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" @@ -11474,15 +11489,10 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +type-fest@^1.0.1, type-fest@^1.2.1, type-fest@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" + integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== type-is@~1.6.18: version "1.6.18" @@ -11729,7 +11739,7 @@ uuid@^9.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== -v8-compile-cache@^2.1.1, v8-compile-cache@^2.3.0: +v8-compile-cache@^2.1.1: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== @@ -12415,7 +12425,7 @@ yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.1, yargs-parser@^20.2.3: +yargs-parser@^20.2.1, yargs-parser@^20.2.9: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== From 1ef014802b6ed281100087a7951b26f6f7423418 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 12 Jul 2023 08:19:20 -0400 Subject: [PATCH 16/17] Refactor `Trends::Query` to avoid brakeman sql injection warnings (#25881) --- app/models/trends/query.rb | 24 ++++++++++++++++++------ config/brakeman.ignore | 23 ----------------------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/app/models/trends/query.rb b/app/models/trends/query.rb index cd5571bc6..c4edbba6b 100644 --- a/app/models/trends/query.rb +++ b/app/models/trends/query.rb @@ -68,12 +68,10 @@ class Trends::Query alias to_a to_ary def to_arel - tmp_ids = ids - - if tmp_ids.empty? + if ids_for_key.empty? klass.none else - scope = klass.joins("join unnest(array[#{tmp_ids.join(',')}]) with ordinality as x (id, ordering) on #{klass.table_name}.id = x.id").reorder('x.ordering') + scope = klass.joins(sanitized_join_sql).reorder('x.ordering') scope = scope.offset(@offset) if @offset.present? scope = scope.limit(@limit) if @limit.present? scope @@ -95,8 +93,22 @@ class Trends::Query self end - def ids - redis.zrevrange(key, 0, -1).map(&:to_i) + def ids_for_key + @ids_for_key ||= redis.zrevrange(key, 0, -1).map(&:to_i) + end + + def sanitized_join_sql + ActiveRecord::Base.sanitize_sql_array(join_sql_array) + end + + def join_sql_array + [join_sql_query, ids_for_key] + end + + def join_sql_query + <<~SQL.squish + JOIN unnest(array[?]) WITH ordinality AS x (id, ordering) ON #{klass.table_name}.id = x.id + SQL end def perform_queries diff --git a/config/brakeman.ignore b/config/brakeman.ignore index 4f21944b6..27d8ff8da 100644 --- a/config/brakeman.ignore +++ b/config/brakeman.ignore @@ -23,29 +23,6 @@ ], "note": "" }, - { - "warning_type": "SQL Injection", - "warning_code": 0, - "fingerprint": "30dfe36e87fe1b8f239df9a33d576e44a9863f73b680198d4713be6540ae61d3", - "check_name": "SQL", - "message": "Possible SQL injection", - "file": "app/models/trends/query.rb", - "line": 76, - "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/", - "code": "klass.joins(\"join unnest(array[#{ids.join(\",\")}]) with ordinality as x (id, ordering) on #{klass.table_name}.id = x.id\")", - "render_path": null, - "location": { - "type": "method", - "class": "Trends::Query", - "method": "to_arel" - }, - "user_input": "ids.join(\",\")", - "confidence": "Weak", - "cwe_id": [ - 89 - ], - "note": "" - }, { "warning_type": "Cross-Site Scripting", "warning_code": 2, From 82e477b184b5666fff7fb55933dce22ca2925db8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:19:51 +0200 Subject: [PATCH 17/17] Update dependency capistrano-rails to v1.6.3 (#25934) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5e1309622..9286cd991 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -146,7 +146,7 @@ GEM sshkit (>= 1.9.0) capistrano-bundler (2.1.0) capistrano (~> 3.1) - capistrano-rails (1.6.2) + capistrano-rails (1.6.3) capistrano (~> 3.1) capistrano-bundler (>= 1.1, < 3) capistrano-rbenv (2.2.0) @@ -668,7 +668,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sshkit (1.21.4) + sshkit (1.21.5) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) stackprof (0.2.25)