Merge branch 'frozen-string-enable-app-models-even-more' into 'master'
Enable more frozen string in app/models/**/*.rb See merge request gitlab-org/gitlab-ce!21019
This commit is contained in:
commit
27f5efcfa5
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == AccessRequestable concern
|
||||
#
|
||||
# Contains functionality related to objects that can receive request for access.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Awardable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -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.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module BlobLike
|
||||
extend ActiveSupport::Concern
|
||||
include Linguist::BlobHelper
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Returns and caches in thread max member access for a resource
|
||||
#
|
||||
module BulkMemberAccessLoad
|
||||
|
|
|
@ -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:
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module CacheableAttributes
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Concern for querying columns with specific case sensitivity handling.
|
||||
module CaseSensitivity
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ChronicDurationAttribute
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module CreatedAtFilterable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DeploymentPlatform
|
||||
# EE would override this and utilize environment argument
|
||||
# rubocop:disable Gitlab/ModuleWithInstanceVariables
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffFile
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Contains functionality shared between `DiffDiscussion` and `LegacyDiffDiscussion`.
|
||||
module DiscussionOnDiff
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module EachBatch
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Editable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module EnumWithNil
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Expirable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
##
|
||||
# This module is for replacing `dependent: :destroy` and `before_destroy` hooks.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module FasterCacheKeys
|
||||
# A faster version of Rails' "cache_key" method.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module FeatureGate
|
||||
def flipper_id
|
||||
return nil if new_record?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module GhostUser
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module HasStatus
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module HasVariable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Module that can be included into a model to make it easier to ignore database
|
||||
# columns.
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module IidRoutes
|
||||
##
|
||||
# This automagically enforces all related routes to use `iid` instead of `id`
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Importable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == Issuable concern
|
||||
#
|
||||
# Contains common functionality shared between Issues and MergeRequests
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module LoadedInGroupList
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ManualInverseAssociation
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Mentionable
|
||||
module ReferenceRegexes
|
||||
def self.reference_pattern(link_patterns, issue_pattern)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Milestoneish
|
||||
def closed_items_count(user)
|
||||
memoize_per_user(user, :closed_items_count) do
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Contains functionality shared between `DiffNote` and `LegacyDiffNote`.
|
||||
module NoteOnDiff
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == Participable concern
|
||||
#
|
||||
# Contains functionality related to objects that can have participants, such as
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Presentable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PrometheusAdapter
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ProtectedBranchAccess
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ProtectedRef
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ProtectedRefAccess
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ProtectedTagAccess
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -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+,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ReactiveService
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module RedisCacheable
|
||||
extend ActiveSupport::Concern
|
||||
include Gitlab::Utils::StrongMemoize
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == Referable concern
|
||||
#
|
||||
# Contains functionality related to making a model referable in Markdown, such
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module RelativePositioning
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ResolvableDiscussion
|
||||
extend ActiveSupport::Concern
|
||||
include ::Gitlab::Utils::StrongMemoize
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ResolvableNote
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module SelectForProjectAuthorization
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ShaAttribute
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == Sortable concern
|
||||
#
|
||||
# Set default scope for ordering objects
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Spammable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Storage
|
||||
module LegacyNamespace
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Storage
|
||||
module LegacyProjectWiki
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Storage
|
||||
module LegacyRepository
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == Strip Attribute module
|
||||
#
|
||||
# Contains functionality to clean attributes before validation
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == Subscribable concern
|
||||
#
|
||||
# Users can subscribe to these models.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'task_list'
|
||||
require 'task_list/filter'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# == TimeTrackable concern
|
||||
#
|
||||
# Contains functionality related to objects that support time tracking.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module TokenAuthenticatable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module TriggerableHooks
|
||||
AVAILABLE_TRIGGERS = {
|
||||
repository_update_hooks: :repository_update_events,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Uniquify
|
||||
#
|
||||
# Return a version of the given 'base' string that is unique
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module UpdatedAtFilterable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ValidAttribute
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ConversationalDevelopmentIndex
|
||||
class Card
|
||||
attr_accessor :metric, :title, :description, :feature, :blog, :docs
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ConversationalDevelopmentIndex
|
||||
class IdeaToProductionStep
|
||||
attr_accessor :metric, :title, :features
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ConversationalDevelopmentIndex
|
||||
class Metric < ActiveRecord::Base
|
||||
include Presentable
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class Added < Base
|
||||
include Simple
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class Base
|
||||
PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'.freeze
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
module ClientSide
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class Deleted < Base
|
||||
include Simple
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class Image < Base
|
||||
include Rich
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class ModeChanged < Base
|
||||
include Simple
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class NoPreview < Base
|
||||
include Simple
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class NotDiffable < Base
|
||||
include Simple
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class Renamed < Base
|
||||
include Simple
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
module Rich
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
module ServerSide
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
module Simple
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
module Static
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiffViewer
|
||||
class Text < Base
|
||||
include Simple
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ProjectHook < WebHook
|
||||
include TriggerableHooks
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ServiceHook < WebHook
|
||||
belongs_to :service
|
||||
validates :service, presence: true
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SystemHook < WebHook
|
||||
include TriggerableHooks
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class WebHook < ActiveRecord::Base
|
||||
include Sortable
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class WebHookLog < ActiveRecord::Base
|
||||
belongs_to :web_hook
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Issue::Metrics < ActiveRecord::Base
|
||||
belongs_to :issue
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupMember < Member
|
||||
SOURCE_TYPE = 'Namespace'.freeze
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ProjectMember < Member
|
||||
SOURCE_TYPE = 'Project'.freeze
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Network
|
||||
class Commit
|
||||
include ActionView::Helpers::TagHelper
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue