diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-08-03 10:22:24 -0700 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-08-07 00:37:36 -0700 |
commit | 15b878e27e8188e9d22755fd648f75de313f012f (patch) | |
tree | 0e04417984c141dc4651249176eff41d8455d24c | |
parent | b211f7c25307971f97646b59e56cede47380c9d6 (diff) | |
download | gitlab-ce-15b878e27e8188e9d22755fd648f75de313f012f.tar.gz |
Enable more frozen string in app/models/**/*.rb
Partially addresses #47424.
101 files changed, 205 insertions, 2 deletions
diff --git a/app/models/concerns/access_requestable.rb b/app/models/concerns/access_requestable.rb index d502e7e54c6..31ee3a4da73 100644 --- a/app/models/concerns/access_requestable.rb +++ b/app/models/concerns/access_requestable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == AccessRequestable concern # # Contains functionality related to objects that can receive request for access. diff --git a/app/models/concerns/artifact_migratable.rb b/app/models/concerns/artifact_migratable.rb index ff52ca64459..cbd63ba8876 100644 --- a/app/models/concerns/artifact_migratable.rb +++ b/app/models/concerns/artifact_migratable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Adapter class to unify the interface between mounted uploaders and the # Ci::Artifact model # Meant to be prepended so the interface can stay the same diff --git a/app/models/concerns/atomic_internal_id.rb b/app/models/concerns/atomic_internal_id.rb index 5e39676b24b..7f6d48d972c 100644 --- a/app/models/concerns/atomic_internal_id.rb +++ b/app/models/concerns/atomic_internal_id.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Include atomic internal id generation scheme for a model # # This allows us to atomically generate internal ids that are diff --git a/app/models/concerns/avatarable.rb b/app/models/concerns/avatarable.rb index a6d604a580d..c0233661a9b 100644 --- a/app/models/concerns/avatarable.rb +++ b/app/models/concerns/avatarable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Avatarable extend ActiveSupport::Concern @@ -57,7 +59,8 @@ module Avatarable only_path = false end - url_base = "" + url_base = [] + if use_asset_host url_base << asset_host unless only_path else @@ -65,7 +68,7 @@ module Avatarable url_base << gitlab_config.relative_url_root end - url_base + avatar.local_url + query_params + url_base.join + avatar.local_url + query_params end # Path that is persisted in the tracking Upload model. Used to fetch the diff --git a/app/models/concerns/awardable.rb b/app/models/concerns/awardable.rb index fce37e7f78e..dd07f389fa5 100644 --- a/app/models/concerns/awardable.rb +++ b/app/models/concerns/awardable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Awardable extend ActiveSupport::Concern diff --git a/app/models/concerns/batch_destroy_dependent_associations.rb b/app/models/concerns/batch_destroy_dependent_associations.rb index 353ee2e73d0..45fbc88fbba 100644 --- a/app/models/concerns/batch_destroy_dependent_associations.rb +++ b/app/models/concerns/batch_destroy_dependent_associations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Provides a way to work around Rails issue where dependent objects are all # loaded into memory before destroyed: https://github.com/rails/rails/issues/22510. # diff --git a/app/models/concerns/blob_like.rb b/app/models/concerns/blob_like.rb index adb81561000..e96fefe81c4 100644 --- a/app/models/concerns/blob_like.rb +++ b/app/models/concerns/blob_like.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module BlobLike extend ActiveSupport::Concern include Linguist::BlobHelper diff --git a/app/models/concerns/blocks_json_serialization.rb b/app/models/concerns/blocks_json_serialization.rb index 8019e6adc1c..d346da1ba4b 100644 --- a/app/models/concerns/blocks_json_serialization.rb +++ b/app/models/concerns/blocks_json_serialization.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Overrides `as_json` and `to_json` to raise an exception when called in order # to prevent accidentally exposing attributes # diff --git a/app/models/concerns/bulk_member_access_load.rb b/app/models/concerns/bulk_member_access_load.rb index 984c4f53bf7..c4346d5dd17 100644 --- a/app/models/concerns/bulk_member_access_load.rb +++ b/app/models/concerns/bulk_member_access_load.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Returns and caches in thread max member access for a resource # module BulkMemberAccessLoad diff --git a/app/models/concerns/cache_markdown_field.rb b/app/models/concerns/cache_markdown_field.rb index b05bf909058..6e2adc76ec6 100644 --- a/app/models/concerns/cache_markdown_field.rb +++ b/app/models/concerns/cache_markdown_field.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module takes care of updating cache columns for Markdown-containing # fields. Use like this in the body of your class: # diff --git a/app/models/concerns/cacheable_attributes.rb b/app/models/concerns/cacheable_attributes.rb index 606549b947f..62b78c3611c 100644 --- a/app/models/concerns/cacheable_attributes.rb +++ b/app/models/concerns/cacheable_attributes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CacheableAttributes extend ActiveSupport::Concern diff --git a/app/models/concerns/case_sensitivity.rb b/app/models/concerns/case_sensitivity.rb index 034e9f40ff0..0ba542b75ab 100644 --- a/app/models/concerns/case_sensitivity.rb +++ b/app/models/concerns/case_sensitivity.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Concern for querying columns with specific case sensitivity handling. module CaseSensitivity extend ActiveSupport::Concern diff --git a/app/models/concerns/chronic_duration_attribute.rb b/app/models/concerns/chronic_duration_attribute.rb index 593a9b3d71d..edf6ac96730 100644 --- a/app/models/concerns/chronic_duration_attribute.rb +++ b/app/models/concerns/chronic_duration_attribute.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ChronicDurationAttribute extend ActiveSupport::Concern diff --git a/app/models/concerns/created_at_filterable.rb b/app/models/concerns/created_at_filterable.rb index e8a3e41203d..a1f46478b6f 100644 --- a/app/models/concerns/created_at_filterable.rb +++ b/app/models/concerns/created_at_filterable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CreatedAtFilterable extend ActiveSupport::Concern diff --git a/app/models/concerns/deployment_platform.rb b/app/models/concerns/deployment_platform.rb index 52851b3d0b2..91052013592 100644 --- a/app/models/concerns/deployment_platform.rb +++ b/app/models/concerns/deployment_platform.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DeploymentPlatform # EE would override this and utilize environment argument # rubocop:disable Gitlab/ModuleWithInstanceVariables diff --git a/app/models/concerns/diff_file.rb b/app/models/concerns/diff_file.rb index 72332072012..47ea14163dc 100644 --- a/app/models/concerns/diff_file.rb +++ b/app/models/concerns/diff_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffFile extend ActiveSupport::Concern diff --git a/app/models/concerns/discussion_on_diff.rb b/app/models/concerns/discussion_on_diff.rb index 8b3c55387b3..c180d7b7c9a 100644 --- a/app/models/concerns/discussion_on_diff.rb +++ b/app/models/concerns/discussion_on_diff.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Contains functionality shared between `DiffDiscussion` and `LegacyDiffDiscussion`. module DiscussionOnDiff extend ActiveSupport::Concern diff --git a/app/models/concerns/each_batch.rb b/app/models/concerns/each_batch.rb index 6ddbb8da1a9..a9e14cb55eb 100644 --- a/app/models/concerns/each_batch.rb +++ b/app/models/concerns/each_batch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module EachBatch extend ActiveSupport::Concern diff --git a/app/models/concerns/editable.rb b/app/models/concerns/editable.rb index c0a3099f676..2e49e720ac9 100644 --- a/app/models/concerns/editable.rb +++ b/app/models/concerns/editable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Editable extend ActiveSupport::Concern diff --git a/app/models/concerns/enum_with_nil.rb b/app/models/concerns/enum_with_nil.rb index 6b37903da20..23acfe9a55f 100644 --- a/app/models/concerns/enum_with_nil.rb +++ b/app/models/concerns/enum_with_nil.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module EnumWithNil extend ActiveSupport::Concern diff --git a/app/models/concerns/expirable.rb b/app/models/concerns/expirable.rb index b66ba08dc59..1f274487935 100644 --- a/app/models/concerns/expirable.rb +++ b/app/models/concerns/expirable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Expirable extend ActiveSupport::Concern diff --git a/app/models/concerns/fast_destroy_all.rb b/app/models/concerns/fast_destroy_all.rb index 7ea042c6742..65ed46ea202 100644 --- a/app/models/concerns/fast_destroy_all.rb +++ b/app/models/concerns/fast_destroy_all.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ## # This module is for replacing `dependent: :destroy` and `before_destroy` hooks. # diff --git a/app/models/concerns/faster_cache_keys.rb b/app/models/concerns/faster_cache_keys.rb index 5b14723fa2d..312a9aa9305 100644 --- a/app/models/concerns/faster_cache_keys.rb +++ b/app/models/concerns/faster_cache_keys.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FasterCacheKeys # A faster version of Rails' "cache_key" method. # diff --git a/app/models/concerns/feature_gate.rb b/app/models/concerns/feature_gate.rb index 5db64fe82c4..3f84de54ad5 100644 --- a/app/models/concerns/feature_gate.rb +++ b/app/models/concerns/feature_gate.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module FeatureGate def flipper_id return nil if new_record? diff --git a/app/models/concerns/ghost_user.rb b/app/models/concerns/ghost_user.rb index da696127a80..15278c431fb 100644 --- a/app/models/concerns/ghost_user.rb +++ b/app/models/concerns/ghost_user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module GhostUser extend ActiveSupport::Concern diff --git a/app/models/concerns/group_descendant.rb b/app/models/concerns/group_descendant.rb index 5e9a95c3282..05cd4265133 100644 --- a/app/models/concerns/group_descendant.rb +++ b/app/models/concerns/group_descendant.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module GroupDescendant # Returns the hierarchy of a project or group in the from of a hash upto a # given top. diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb index 72c236a0fc7..b3960cbad1a 100644 --- a/app/models/concerns/has_status.rb +++ b/app/models/concerns/has_status.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module HasStatus extend ActiveSupport::Concern diff --git a/app/models/concerns/has_variable.rb b/app/models/concerns/has_variable.rb index c8e20c0ab81..dfbe413a878 100644 --- a/app/models/concerns/has_variable.rb +++ b/app/models/concerns/has_variable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module HasVariable extend ActiveSupport::Concern diff --git a/app/models/concerns/ignorable_column.rb b/app/models/concerns/ignorable_column.rb index 03793e8bcbb..2b074c1921c 100644 --- a/app/models/concerns/ignorable_column.rb +++ b/app/models/concerns/ignorable_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Module that can be included into a model to make it easier to ignore database # columns. # diff --git a/app/models/concerns/iid_routes.rb b/app/models/concerns/iid_routes.rb index 246748cf52c..b7f99e845ca 100644 --- a/app/models/concerns/iid_routes.rb +++ b/app/models/concerns/iid_routes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module IidRoutes ## # This automagically enforces all related routes to use `iid` instead of `id` diff --git a/app/models/concerns/importable.rb b/app/models/concerns/importable.rb index c9331eaf4cc..4d2707b08ab 100644 --- a/app/models/concerns/importable.rb +++ b/app/models/concerns/importable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Importable extend ActiveSupport::Concern diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index b93c1145f82..7f1ecc2e5d2 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Issuable concern # # Contains common functionality shared between Issues and MergeRequests diff --git a/app/models/concerns/loaded_in_group_list.rb b/app/models/concerns/loaded_in_group_list.rb index 935e9d10133..a2233eb2997 100644 --- a/app/models/concerns/loaded_in_group_list.rb +++ b/app/models/concerns/loaded_in_group_list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LoadedInGroupList extend ActiveSupport::Concern diff --git a/app/models/concerns/manual_inverse_association.rb b/app/models/concerns/manual_inverse_association.rb index 0fca8feaf89..d0d781dc15f 100644 --- a/app/models/concerns/manual_inverse_association.rb +++ b/app/models/concerns/manual_inverse_association.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ManualInverseAssociation extend ActiveSupport::Concern diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb index c013e5a708f..7e7eccb1c27 100644 --- a/app/models/concerns/mentionable.rb +++ b/app/models/concerns/mentionable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Mentionable concern # # Contains functionality related to objects that can mention Users, Issues, MergeRequests, Commits or Snippets by diff --git a/app/models/concerns/mentionable/reference_regexes.rb b/app/models/concerns/mentionable/reference_regexes.rb index 2d86a70c395..f6fd28bac33 100644 --- a/app/models/concerns/mentionable/reference_regexes.rb +++ b/app/models/concerns/mentionable/reference_regexes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Mentionable module ReferenceRegexes def self.reference_pattern(link_patterns, issue_pattern) diff --git a/app/models/concerns/milestoneish.rb b/app/models/concerns/milestoneish.rb index 967fd9c5eea..e44a069b730 100644 --- a/app/models/concerns/milestoneish.rb +++ b/app/models/concerns/milestoneish.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Milestoneish def closed_items_count(user) memoize_per_user(user, :closed_items_count) do diff --git a/app/models/concerns/note_on_diff.rb b/app/models/concerns/note_on_diff.rb index 510b8868462..aad19329be1 100644 --- a/app/models/concerns/note_on_diff.rb +++ b/app/models/concerns/note_on_diff.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Contains functionality shared between `DiffNote` and `LegacyDiffNote`. module NoteOnDiff extend ActiveSupport::Concern diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb index 86f28f30032..ce778eae271 100644 --- a/app/models/concerns/noteable.rb +++ b/app/models/concerns/noteable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Noteable # Names of all implementers of `Noteable` that support resolvable notes. RESOLVABLE_TYPES = %w(MergeRequest).freeze diff --git a/app/models/concerns/participable.rb b/app/models/concerns/participable.rb index 01b1ef9f82c..1f6c42f3b3a 100644 --- a/app/models/concerns/participable.rb +++ b/app/models/concerns/participable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Participable concern # # Contains functionality related to objects that can have participants, such as diff --git a/app/models/concerns/presentable.rb b/app/models/concerns/presentable.rb index bc4fbd19a02..06c300c2e41 100644 --- a/app/models/concerns/presentable.rb +++ b/app/models/concerns/presentable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Presentable extend ActiveSupport::Concern diff --git a/app/models/concerns/project_features_compatibility.rb b/app/models/concerns/project_features_compatibility.rb index 1f7d78a2efe..f268a842db4 100644 --- a/app/models/concerns/project_features_compatibility.rb +++ b/app/models/concerns/project_features_compatibility.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Makes api V4 compatible with old project features permissions methods # # After migrating issues_enabled merge_requests_enabled builds_enabled snippets_enabled and wiki_enabled diff --git a/app/models/concerns/prometheus_adapter.rb b/app/models/concerns/prometheus_adapter.rb index 9c36f633395..a29e80fe0c1 100644 --- a/app/models/concerns/prometheus_adapter.rb +++ b/app/models/concerns/prometheus_adapter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PrometheusAdapter extend ActiveSupport::Concern diff --git a/app/models/concerns/protected_branch_access.rb b/app/models/concerns/protected_branch_access.rb index e62f42e8e70..744f7f48dc8 100644 --- a/app/models/concerns/protected_branch_access.rb +++ b/app/models/concerns/protected_branch_access.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProtectedBranchAccess extend ActiveSupport::Concern diff --git a/app/models/concerns/protected_ref.rb b/app/models/concerns/protected_ref.rb index dbe8d31de37..e62e680af6e 100644 --- a/app/models/concerns/protected_ref.rb +++ b/app/models/concerns/protected_ref.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProtectedRef extend ActiveSupport::Concern diff --git a/app/models/concerns/protected_ref_access.rb b/app/models/concerns/protected_ref_access.rb index 5ff7b41b82b..efa666fb3f2 100644 --- a/app/models/concerns/protected_ref_access.rb +++ b/app/models/concerns/protected_ref_access.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProtectedRefAccess extend ActiveSupport::Concern diff --git a/app/models/concerns/protected_tag_access.rb b/app/models/concerns/protected_tag_access.rb index ee65de24dd8..04bd54d6b1c 100644 --- a/app/models/concerns/protected_tag_access.rb +++ b/app/models/concerns/protected_tag_access.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProtectedTagAccess extend ActiveSupport::Concern diff --git a/app/models/concerns/reactive_caching.rb b/app/models/concerns/reactive_caching.rb index 9155d82d567..b24c597ec3d 100644 --- a/app/models/concerns/reactive_caching.rb +++ b/app/models/concerns/reactive_caching.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # The ReactiveCaching concern is used to fetch some data in the background and # store it in the Rails cache, keeping it up-to-date for as long as it is being # requested. If the data hasn't been requested for +reactive_cache_lifetime+, diff --git a/app/models/concerns/reactive_service.rb b/app/models/concerns/reactive_service.rb index 713246039c1..af69da24994 100644 --- a/app/models/concerns/reactive_service.rb +++ b/app/models/concerns/reactive_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ReactiveService extend ActiveSupport::Concern diff --git a/app/models/concerns/redis_cacheable.rb b/app/models/concerns/redis_cacheable.rb index 3bdc1330d23..69554f18ea2 100644 --- a/app/models/concerns/redis_cacheable.rb +++ b/app/models/concerns/redis_cacheable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RedisCacheable extend ActiveSupport::Concern include Gitlab::Utils::StrongMemoize diff --git a/app/models/concerns/referable.rb b/app/models/concerns/referable.rb index b782e85717e..468eaf68883 100644 --- a/app/models/concerns/referable.rb +++ b/app/models/concerns/referable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Referable concern # # Contains functionality related to making a model referable in Markdown, such diff --git a/app/models/concerns/relative_positioning.rb b/app/models/concerns/relative_positioning.rb index afacdb8cb12..85229cded5d 100644 --- a/app/models/concerns/relative_positioning.rb +++ b/app/models/concerns/relative_positioning.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RelativePositioning extend ActiveSupport::Concern diff --git a/app/models/concerns/resolvable_discussion.rb b/app/models/concerns/resolvable_discussion.rb index 7c236369793..c0490af2453 100644 --- a/app/models/concerns/resolvable_discussion.rb +++ b/app/models/concerns/resolvable_discussion.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ResolvableDiscussion extend ActiveSupport::Concern include ::Gitlab::Utils::StrongMemoize diff --git a/app/models/concerns/resolvable_note.rb b/app/models/concerns/resolvable_note.rb index 4a0f8b92b3a..f47e20229f1 100644 --- a/app/models/concerns/resolvable_note.rb +++ b/app/models/concerns/resolvable_note.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ResolvableNote extend ActiveSupport::Concern diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb index cb91f8fbac8..b9ffc64e4a9 100644 --- a/app/models/concerns/routable.rb +++ b/app/models/concerns/routable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Store object full path in separate table for easy lookup and uniq validation # Object must have name and path db fields and respond to parent and parent_changed? methods. module Routable diff --git a/app/models/concerns/select_for_project_authorization.rb b/app/models/concerns/select_for_project_authorization.rb index 7af0fdbd618..39306179eb8 100644 --- a/app/models/concerns/select_for_project_authorization.rb +++ b/app/models/concerns/select_for_project_authorization.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SelectForProjectAuthorization extend ActiveSupport::Concern diff --git a/app/models/concerns/sha_attribute.rb b/app/models/concerns/sha_attribute.rb index 3796737427a..c322c356db2 100644 --- a/app/models/concerns/sha_attribute.rb +++ b/app/models/concerns/sha_attribute.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ShaAttribute extend ActiveSupport::Concern diff --git a/app/models/concerns/sortable.rb b/app/models/concerns/sortable.rb index cb76ae971d4..92877e32491 100644 --- a/app/models/concerns/sortable.rb +++ b/app/models/concerns/sortable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Sortable concern # # Set default scope for ordering objects diff --git a/app/models/concerns/spammable.rb b/app/models/concerns/spammable.rb index 5e4274619c4..c6e3dc385fe 100644 --- a/app/models/concerns/spammable.rb +++ b/app/models/concerns/spammable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spammable extend ActiveSupport::Concern diff --git a/app/models/concerns/storage/legacy_namespace.rb b/app/models/concerns/storage/legacy_namespace.rb index f5225cd81ed..3b745657a9e 100644 --- a/app/models/concerns/storage/legacy_namespace.rb +++ b/app/models/concerns/storage/legacy_namespace.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Storage module LegacyNamespace extend ActiveSupport::Concern diff --git a/app/models/concerns/storage/legacy_project_wiki.rb b/app/models/concerns/storage/legacy_project_wiki.rb index ff82cb0ffa9..a377fa1e5de 100644 --- a/app/models/concerns/storage/legacy_project_wiki.rb +++ b/app/models/concerns/storage/legacy_project_wiki.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Storage module LegacyProjectWiki extend ActiveSupport::Concern diff --git a/app/models/concerns/storage/legacy_repository.rb b/app/models/concerns/storage/legacy_repository.rb index 593749bf019..eb93d0fc7f1 100644 --- a/app/models/concerns/storage/legacy_repository.rb +++ b/app/models/concerns/storage/legacy_repository.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Storage module LegacyRepository extend ActiveSupport::Concern diff --git a/app/models/concerns/strip_attribute.rb b/app/models/concerns/strip_attribute.rb index 8806ebe897a..344f677a3f3 100644 --- a/app/models/concerns/strip_attribute.rb +++ b/app/models/concerns/strip_attribute.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Strip Attribute module # # Contains functionality to clean attributes before validation diff --git a/app/models/concerns/subscribable.rb b/app/models/concerns/subscribable.rb index f478c8ede18..1d0a61364b0 100644 --- a/app/models/concerns/subscribable.rb +++ b/app/models/concerns/subscribable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == Subscribable concern # # Users can subscribe to these models. diff --git a/app/models/concerns/taskable.rb b/app/models/concerns/taskable.rb index ccd6f0e0a7d..603d4d62578 100644 --- a/app/models/concerns/taskable.rb +++ b/app/models/concerns/taskable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'task_list' require 'task_list/filter' diff --git a/app/models/concerns/throttled_touch.rb b/app/models/concerns/throttled_touch.rb index ad0ff0f20d4..797c46f6cc5 100644 --- a/app/models/concerns/throttled_touch.rb +++ b/app/models/concerns/throttled_touch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # ThrottledTouch can be used to throttle the number of updates triggered by # calling "touch" on an ActiveRecord model. module ThrottledTouch diff --git a/app/models/concerns/time_trackable.rb b/app/models/concerns/time_trackable.rb index 0fc321c52bc..f61a0bbc65b 100644 --- a/app/models/concerns/time_trackable.rb +++ b/app/models/concerns/time_trackable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # == TimeTrackable concern # # Contains functionality related to objects that support time tracking. diff --git a/app/models/concerns/token_authenticatable.rb b/app/models/concerns/token_authenticatable.rb index ec3543f7053..522b65e4205 100644 --- a/app/models/concerns/token_authenticatable.rb +++ b/app/models/concerns/token_authenticatable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module TokenAuthenticatable extend ActiveSupport::Concern diff --git a/app/models/concerns/triggerable_hooks.rb b/app/models/concerns/triggerable_hooks.rb index ec0ed3b795a..f55ab2fcaf3 100644 --- a/app/models/concerns/triggerable_hooks.rb +++ b/app/models/concerns/triggerable_hooks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module TriggerableHooks AVAILABLE_TRIGGERS = { repository_update_hooks: :repository_update_events, diff --git a/app/models/concerns/uniquify.rb b/app/models/concerns/uniquify.rb index 549a76da20e..382e826ec58 100644 --- a/app/models/concerns/uniquify.rb +++ b/app/models/concerns/uniquify.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Uniquify # # Return a version of the given 'base' string that is unique diff --git a/app/models/concerns/updated_at_filterable.rb b/app/models/concerns/updated_at_filterable.rb index edb423b7828..1ab5ee9fbb9 100644 --- a/app/models/concerns/updated_at_filterable.rb +++ b/app/models/concerns/updated_at_filterable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UpdatedAtFilterable extend ActiveSupport::Concern diff --git a/app/models/concerns/valid_attribute.rb b/app/models/concerns/valid_attribute.rb index 8c35cea8d58..251db9ce30b 100644 --- a/app/models/concerns/valid_attribute.rb +++ b/app/models/concerns/valid_attribute.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ValidAttribute extend ActiveSupport::Concern diff --git a/app/models/concerns/with_uploads.rb b/app/models/concerns/with_uploads.rb index 4245d083a49..e231af5368d 100644 --- a/app/models/concerns/with_uploads.rb +++ b/app/models/concerns/with_uploads.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Mounted uploaders are destroyed by carrierwave's after_commit # hook. This hook fetches upload location (local vs remote) from # Upload model. So it's neccessary to make sure that during that diff --git a/app/models/conversational_development_index/card.rb b/app/models/conversational_development_index/card.rb index e8f09dc9161..f9180bdd97b 100644 --- a/app/models/conversational_development_index/card.rb +++ b/app/models/conversational_development_index/card.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ConversationalDevelopmentIndex class Card attr_accessor :metric, :title, :description, :feature, :blog, :docs diff --git a/app/models/conversational_development_index/idea_to_production_step.rb b/app/models/conversational_development_index/idea_to_production_step.rb index 6e1753c9f30..e78a734693c 100644 --- a/app/models/conversational_development_index/idea_to_production_step.rb +++ b/app/models/conversational_development_index/idea_to_production_step.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ConversationalDevelopmentIndex class IdeaToProductionStep attr_accessor :metric, :title, :features diff --git a/app/models/conversational_development_index/metric.rb b/app/models/conversational_development_index/metric.rb index 0bee62f954f..c54537572d6 100644 --- a/app/models/conversational_development_index/metric.rb +++ b/app/models/conversational_development_index/metric.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ConversationalDevelopmentIndex class Metric < ActiveRecord::Base include Presentable diff --git a/app/models/diff_viewer/added.rb b/app/models/diff_viewer/added.rb index 1909e6ef9d8..70d13e3478c 100644 --- a/app/models/diff_viewer/added.rb +++ b/app/models/diff_viewer/added.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class Added < Base include Simple diff --git a/app/models/diff_viewer/base.rb b/app/models/diff_viewer/base.rb index 0cbe714288d..1176861a827 100644 --- a/app/models/diff_viewer/base.rb +++ b/app/models/diff_viewer/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class Base PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'.freeze diff --git a/app/models/diff_viewer/client_side.rb b/app/models/diff_viewer/client_side.rb index cf41d07f8eb..cc049e1ca49 100644 --- a/app/models/diff_viewer/client_side.rb +++ b/app/models/diff_viewer/client_side.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer module ClientSide extend ActiveSupport::Concern diff --git a/app/models/diff_viewer/deleted.rb b/app/models/diff_viewer/deleted.rb index 9c129bac694..78671084eeb 100644 --- a/app/models/diff_viewer/deleted.rb +++ b/app/models/diff_viewer/deleted.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class Deleted < Base include Simple diff --git a/app/models/diff_viewer/image.rb b/app/models/diff_viewer/image.rb index 759d9a36ebb..c356c2ca50e 100644 --- a/app/models/diff_viewer/image.rb +++ b/app/models/diff_viewer/image.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class Image < Base include Rich diff --git a/app/models/diff_viewer/mode_changed.rb b/app/models/diff_viewer/mode_changed.rb index d487d996f8d..bd07d1e21b9 100644 --- a/app/models/diff_viewer/mode_changed.rb +++ b/app/models/diff_viewer/mode_changed.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class ModeChanged < Base include Simple diff --git a/app/models/diff_viewer/no_preview.rb b/app/models/diff_viewer/no_preview.rb index 5455fee4490..b0dd5fd151d 100644 --- a/app/models/diff_viewer/no_preview.rb +++ b/app/models/diff_viewer/no_preview.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class NoPreview < Base include Simple diff --git a/app/models/diff_viewer/not_diffable.rb b/app/models/diff_viewer/not_diffable.rb index 4f9638626ea..dc86599e722 100644 --- a/app/models/diff_viewer/not_diffable.rb +++ b/app/models/diff_viewer/not_diffable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class NotDiffable < Base include Simple diff --git a/app/models/diff_viewer/renamed.rb b/app/models/diff_viewer/renamed.rb index f1fbfd8c6d5..70ab9d4ca2c 100644 --- a/app/models/diff_viewer/renamed.rb +++ b/app/models/diff_viewer/renamed.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class Renamed < Base include Simple diff --git a/app/models/diff_viewer/rich.rb b/app/models/diff_viewer/rich.rb index 3b0ca6e4cff..2faa1be6567 100644 --- a/app/models/diff_viewer/rich.rb +++ b/app/models/diff_viewer/rich.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer module Rich extend ActiveSupport::Concern diff --git a/app/models/diff_viewer/server_side.rb b/app/models/diff_viewer/server_side.rb index aed1a0791b1..977204e6c97 100644 --- a/app/models/diff_viewer/server_side.rb +++ b/app/models/diff_viewer/server_side.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer module ServerSide extend ActiveSupport::Concern diff --git a/app/models/diff_viewer/simple.rb b/app/models/diff_viewer/simple.rb index 65750996ee4..8d28ca5239a 100644 --- a/app/models/diff_viewer/simple.rb +++ b/app/models/diff_viewer/simple.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer module Simple extend ActiveSupport::Concern diff --git a/app/models/diff_viewer/static.rb b/app/models/diff_viewer/static.rb index d761328b3f6..1278c22185c 100644 --- a/app/models/diff_viewer/static.rb +++ b/app/models/diff_viewer/static.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer module Static extend ActiveSupport::Concern diff --git a/app/models/diff_viewer/text.rb b/app/models/diff_viewer/text.rb index 98f4b2aea2a..d3d5055c402 100644 --- a/app/models/diff_viewer/text.rb +++ b/app/models/diff_viewer/text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiffViewer class Text < Base include Simple diff --git a/app/models/hooks/project_hook.rb b/app/models/hooks/project_hook.rb index ec072882cc9..18c387f0d34 100644 --- a/app/models/hooks/project_hook.rb +++ b/app/models/hooks/project_hook.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ProjectHook < WebHook include TriggerableHooks diff --git a/app/models/hooks/service_hook.rb b/app/models/hooks/service_hook.rb index aef11514945..bda82a116a1 100644 --- a/app/models/hooks/service_hook.rb +++ b/app/models/hooks/service_hook.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ServiceHook < WebHook belongs_to :service validates :service, presence: true diff --git a/app/models/hooks/system_hook.rb b/app/models/hooks/system_hook.rb index 6bef00f26ea..90b4588a325 100644 --- a/app/models/hooks/system_hook.rb +++ b/app/models/hooks/system_hook.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SystemHook < WebHook include TriggerableHooks diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb index e353abdda9c..f18aadefa5c 100644 --- a/app/models/hooks/web_hook.rb +++ b/app/models/hooks/web_hook.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class WebHook < ActiveRecord::Base include Sortable diff --git a/app/models/hooks/web_hook_log.rb b/app/models/hooks/web_hook_log.rb index 59a1f2aed69..2d9f7594e8c 100644 --- a/app/models/hooks/web_hook_log.rb +++ b/app/models/hooks/web_hook_log.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class WebHookLog < ActiveRecord::Base belongs_to :web_hook diff --git a/app/models/issue/metrics.rb b/app/models/issue/metrics.rb index 012d545c440..0f5ee957ec9 100644 --- a/app/models/issue/metrics.rb +++ b/app/models/issue/metrics.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Issue::Metrics < ActiveRecord::Base belongs_to :issue diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb index 5da739f9618..fc49ee7ac8c 100644 --- a/app/models/members/group_member.rb +++ b/app/models/members/group_member.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class GroupMember < Member SOURCE_TYPE = 'Namespace'.freeze diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index 4f27d0aeaf8..0154fe5aeba 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ProjectMember < Member SOURCE_TYPE = 'Project'.freeze diff --git a/app/models/merge_request/metrics.rb b/app/models/merge_request/metrics.rb index 9e660eccd86..65e94a97b0a 100644 --- a/app/models/merge_request/metrics.rb +++ b/app/models/merge_request/metrics.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MergeRequest::Metrics < ActiveRecord::Base belongs_to :merge_request belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id diff --git a/app/models/network/commit.rb b/app/models/network/commit.rb index d667948deae..6c5a4c56377 100644 --- a/app/models/network/commit.rb +++ b/app/models/network/commit.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Network class Commit include ActionView::Helpers::TagHelper diff --git a/app/models/network/graph.rb b/app/models/network/graph.rb index 1e0d1f9edcb..1431dfefc55 100644 --- a/app/models/network/graph.rb +++ b/app/models/network/graph.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Network class Graph attr_reader :days, :commits, :map, :notes, :repo |