Commit 579e9768 authored by gfyoung's avatar gfyoung

Enable some frozen string in ee/app

Enables frozen string in the following:

* ee/app/helpers/**/*.rb
* ee/app/mailers/**/*.rb
* ee/app/models/**/*.rb

Partially addresses gitlab-org/gitlab-ce/#47424.
parent 9fcaabb8
# frozen_string_literal: true
module AuditEventsHelper module AuditEventsHelper
def human_text(details) def human_text(details)
details.map { |key, value| select_keys(key, value) }.join(" ").humanize details.map { |key, value| select_keys(key, value) }.join(" ").humanize
......
# frozen_string_literal: true
module AuditLogsHelper module AuditLogsHelper
def event_type_options def event_type_options
[ [
......
# frozen_string_literal: true
module AuditorUserHelper module AuditorUserHelper
include ::Gitlab::Utils::StrongMemoize include ::Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
module BatchCommentsHelper module BatchCommentsHelper
def batch_comments_enabled? def batch_comments_enabled?
current_user.present? && @project.feature_available?(:batch_comments, current_user) current_user.present? && @project.feature_available?(:batch_comments, current_user)
......
# frozen_string_literal: true
module BillingPlansHelper module BillingPlansHelper
def subscription_plan_info(plans_data, current_plan_code) def subscription_plan_info(plans_data, current_plan_code)
plans_data.find { |plan| plan.code == current_plan_code } plans_data.find { |plan| plan.code == current_plan_code }
......
# frozen_string_literal: true
module EE module EE
module AppearancesHelper module AppearancesHelper
def header_message def header_message
...@@ -26,10 +28,10 @@ module EE ...@@ -26,10 +28,10 @@ module EE
end end
def message_style def message_style
style = '' style = []
style << "background-color: #{current_appearance.message_background_color};" style << "background-color: #{current_appearance.message_background_color};"
style << "color: #{current_appearance.message_font_color}" style << "color: #{current_appearance.message_font_color}"
style style.join
end end
end end
end end
# frozen_string_literal: true
module EE module EE
module ApplicationHelper module ApplicationHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module ApplicationSettingsHelper module ApplicationSettingsHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module AuthHelper module AuthHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module AwardEmojiHelper module AwardEmojiHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module BoardsHelper module BoardsHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module BranchesHelper module BranchesHelper
# Returns a hash were keys are types of access levels (user, role), and # Returns a hash were keys are types of access levels (user, role), and
......
# frozen_string_literal: true
module EE module EE
module ButtonHelper module ButtonHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module DashboardHelper module DashboardHelper
def controller_action_to_child_dashboards(controller = controller_name, action = action_name) def controller_action_to_child_dashboards(controller = controller_name, action = action_name)
......
# frozen_string_literal: true
module EE module EE
module EmailsHelper module EmailsHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module EnvironmentsHelper module EnvironmentsHelper
def metrics_data(project, environment) def metrics_data(project, environment)
......
# frozen_string_literal: true
module EE module EE
module FormHelper module FormHelper
def issue_assignees_dropdown_options def issue_assignees_dropdown_options
......
# frozen_string_literal: true
module EE module EE
module GitlabRoutingHelper module GitlabRoutingHelper
include ::ProjectsHelper include ::ProjectsHelper
......
# frozen_string_literal: true
module EE module EE
module GroupsHelper module GroupsHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module ImportHelper module ImportHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module IssuablesHelper module IssuablesHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module IssuesHelper module IssuesHelper
def weight_dropdown_tag(issuable, opts = {}, &block) def weight_dropdown_tag(issuable, opts = {}, &block)
......
# frozen_string_literal: true
module EE module EE
module LockHelper module LockHelper
def lock_file_link(project = @project, path = @path, html_options: {}) def lock_file_link(project = @project, path = @path, html_options: {})
......
# frozen_string_literal: true
module EE module EE
module MergeRequestsHelper module MergeRequestsHelper
def render_items_list(items, separator = "and") def render_items_list(items, separator = "and")
......
# frozen_string_literal: true
module EE module EE
module MilestonesHelper module MilestonesHelper
def burndown_chart(milestone) def burndown_chart(milestone)
...@@ -32,9 +34,9 @@ module EE ...@@ -32,9 +34,9 @@ module EE
end end
if message if message
message += link_to "About burndown charts", help_page_path('user/project/milestones/index', anchor: 'burndown-charts'), class: 'burndown-docs-link' link = link_to "About burndown charts", help_page_path('user/project/milestones/index', anchor: 'burndown-charts'), class: 'burndown-docs-link'
content_tag(:div, message.html_safe, id: "data-warning", class: "settings-message prepend-top-20") content_tag(:div, (message + link).html_safe, id: "data-warning", class: "settings-message prepend-top-20")
end end
end end
......
# frozen_string_literal: true
module EE module EE
module NamespacesHelper module NamespacesHelper
def namespace_shared_runner_limits_quota(namespace) def namespace_shared_runner_limits_quota(namespace)
......
# frozen_string_literal: true
module EE module EE
module NavHelper module NavHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module NotesHelper module NotesHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module ProjectsHelper module ProjectsHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module SamlProvidersHelper module SamlProvidersHelper
def group_saml_configured? def group_saml_configured?
......
# frozen_string_literal: true
module EE module EE
module ServicesHelper module ServicesHelper
def add_to_slack_link(project, slack_app_id) def add_to_slack_link(project, slack_app_id)
......
# frozen_string_literal: true
module EE module EE
module SystemNoteHelper module SystemNoteHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module TodosHelper module TodosHelper
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module UserCalloutsHelper module UserCalloutsHelper
GOLD_TRIAL = 'gold_trial'.freeze GOLD_TRIAL = 'gold_trial'.freeze
......
# frozen_string_literal: true
module EpicsHelper module EpicsHelper
def epic_show_app_data(epic, opts) def epic_show_app_data(epic, opts)
group = epic.group group = epic.group
......
# frozen_string_literal: true
module GroupMembersHelper module GroupMembersHelper
def clear_ldap_permission_cache_message def clear_ldap_permission_cache_message
markdown( markdown(
......
# frozen_string_literal: true
module LicenseHelper module LicenseHelper
include ActionView::Helpers::AssetTagHelper include ActionView::Helpers::AssetTagHelper
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
......
# frozen_string_literal: true
module MirrorHelper module MirrorHelper
def render_mirror_failed_message(raw_message:) def render_mirror_failed_message(raw_message:)
mirror_last_update_at = @project.import_state.last_update_at mirror_last_update_at = @project.import_state.last_update_at
...@@ -15,14 +17,14 @@ module MirrorHelper ...@@ -15,14 +17,14 @@ module MirrorHelper
end end
def branch_diverged_tooltip_message def branch_diverged_tooltip_message
message = s_('Branches|The branch could not be updated automatically because it has diverged from its upstream counterpart.') message = [s_('Branches|The branch could not be updated automatically because it has diverged from its upstream counterpart.')]
if can?(current_user, :push_code, @project) if can?(current_user, :push_code, @project)
message << '<br>' message << '<br>'
message << s_("Branches|To discard the local changes and overwrite the branch with the upstream version, delete it here and choose 'Update Now' above.") message << s_("Branches|To discard the local changes and overwrite the branch with the upstream version, delete it here and choose 'Update Now' above.")
end end
message message.join
end end
def options_for_mirror_user def options_for_mirror_user
......
# frozen_string_literal: true
module PathLocksHelper module PathLocksHelper
def can_unlock?(path_lock, current_user = @current_user, project = @project) def can_unlock?(path_lock, current_user = @current_user, project = @project)
can?(current_user, :admin_path_locks, project) || path_lock.user == current_user can?(current_user, :admin_path_locks, project) || path_lock.user == current_user
......
# frozen_string_literal: true
module ProtectedEnvironmentsHelper module ProtectedEnvironmentsHelper
def protected_environments_enabled?(project) def protected_environments_enabled?(project)
project.protected_environments_feature_available? project.protected_environments_feature_available?
......
# frozen_string_literal: true
module PushRulesHelper module PushRulesHelper
def reject_unsigned_commits_description(push_rule) def reject_unsigned_commits_description(push_rule)
message = s_("ProjectSettings|Only signed commits can be pushed to this repository.") message = s_("ProjectSettings|Only signed commits can be pushed to this repository.")
......
# frozen_string_literal: true
module EE module EE
module Notify module Notify
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module Preview module Preview
module NotifyPreview module NotifyPreview
......
# frozen_string_literal: true
module Emails module Emails
module AdminNotification module AdminNotification
def send_admin_notification(user_id, subject, body) def send_admin_notification(user_id, subject, body)
......
# frozen_string_literal: true
module Emails module Emails
module CsvExport module CsvExport
def issues_csv_email(user, project, csv_data, export_status) def issues_csv_email(user, project, csv_data, export_status)
......
# frozen_string_literal: true
module Emails module Emails
module EE module EE
module Notes module Notes
......
# frozen_string_literal: true
module Emails module Emails
module EE module EE
module Projects module Projects
......
# frozen_string_literal: true
module Emails module Emails
module ServiceDesk module ServiceDesk
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
class Approval < ActiveRecord::Base class Approval < ActiveRecord::Base
belongs_to :user belongs_to :user
belongs_to :merge_request belongs_to :merge_request
......
# frozen_string_literal: true
class Approver < ActiveRecord::Base class Approver < ActiveRecord::Base
belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
belongs_to :user belongs_to :user
......
# frozen_string_literal: true
class ApproverGroup < ActiveRecord::Base class ApproverGroup < ActiveRecord::Base
belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
belongs_to :group belongs_to :group
......
# frozen_string_literal: true
class BoardAssignee < ActiveRecord::Base class BoardAssignee < ActiveRecord::Base
belongs_to :board belongs_to :board
belongs_to :assignee, class_name: 'User' belongs_to :assignee, class_name: 'User'
......
# frozen_string_literal: true
class BoardLabel < ActiveRecord::Base class BoardLabel < ActiveRecord::Base
belongs_to :board belongs_to :board
belongs_to :label belongs_to :label
......
# frozen_string_literal: true
class Burndown class Burndown
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
module Ci module Ci
class PipelineChatData < ActiveRecord::Base class PipelineChatData < ActiveRecord::Base
self.table_name = 'ci_pipeline_chat_data' self.table_name = 'ci_pipeline_chat_data'
......
# frozen_string_literal: true
module Ci module Ci
module Sources module Sources
class Pipeline < ActiveRecord::Base class Pipeline < ActiveRecord::Base
......
# frozen_string_literal: true
module Approvable module Approvable
# A method related to approvers that is user facing # A method related to approvers that is user facing
# should be moved to VisibleApprovable because # should be moved to VisibleApprovable because
......
# frozen_string_literal: true
module CustomModelNaming module CustomModelNaming
# Extracted from: https://github.com/stevenbarragan/spree_random_subscriptions/blob/5426ccaf8a2084c495b2cac9dfbd27e30ade0cec/lib/custom_model_naming.rb # Extracted from: https://github.com/stevenbarragan/spree_random_subscriptions/blob/5426ccaf8a2084c495b2cac9dfbd27e30ade0cec/lib/custom_model_naming.rb
......
# frozen_string_literal: true
module EE module EE
module DeploymentPlatform module DeploymentPlatform
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module KubernetesService module KubernetesService
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module Participable module Participable
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module PrometheusAdapter module PrometheusAdapter
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module ProtectedBranch module ProtectedBranch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module ProtectedRef module ProtectedRef
def protected_ref_access_levels(*types) def protected_ref_access_levels(*types)
......
# frozen_string_literal: true
# EE-specific code related to protected branch/tag access levels. # EE-specific code related to protected branch/tag access levels.
# #
# Note: Don't directly include this concern into a model class. # Note: Don't directly include this concern into a model class.
......
# frozen_string_literal: true
module EE module EE
# Issue position on list boards should be relative to all group projects # Issue position on list boards should be relative to all group projects
module RelativePositioning module RelativePositioning
......
# frozen_string_literal: true
module Elastic module Elastic
module IssuesSearch module IssuesSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Elastic module Elastic
module MergeRequestsSearch module MergeRequestsSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Elastic module Elastic
module MilestonesSearch module MilestonesSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Elastic module Elastic
module NotesSearch module NotesSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Elastic module Elastic
module ProjectsSearch module ProjectsSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Elastic module Elastic
module RepositoriesSearch module RepositoriesSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Elastic module Elastic
module SnippetsSearch module SnippetsSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Elastic module Elastic
module WikiRepositoriesSearch module WikiRepositoriesSearch
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Geo module Geo
module Model module Model
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module Geo::Syncable module Geo::Syncable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module HasEnvironmentScope module HasEnvironmentScope
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ObjectStorable module ObjectStorable
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
# This module may only be used by presenters or modules # This module may only be used by presenters or modules
# that include the Approvable concern # that include the Approvable concern
module VisibleApprovable module VisibleApprovable
......
# frozen_string_literal: true
module EE module EE
module Appearance module Appearance
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
# ApplicationSetting EE mixin # ApplicationSetting EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module AuditEvent module AuditEvent
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module Board module Board
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
# BroadcastMessage EE mixin # BroadcastMessage EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module Ci module Ci
# Build EE mixin # Build EE mixin
......
# frozen_string_literal: true
module EE module EE
# CI::JobArtifact EE mixin # CI::JobArtifact EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module Ci module Ci
module Pipeline module Pipeline
......
# frozen_string_literal: true
module EE module EE
module Ci module Ci
module Runner module Runner
......
# frozen_string_literal: true
module EE module EE
module Clusters module Clusters
module Applications module Applications
......
# frozen_string_literal: true
module EE module EE
module Clusters module Clusters
module Cluster module Cluster
......
# frozen_string_literal: true
module EE module EE
module Environment module Environment
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module Epic module Epic
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module GlobalMilestone module GlobalMilestone
def supports_weight? def supports_weight?
......
# frozen_string_literal: true
module EE module EE
# Group EE mixin # Group EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module GroupMilestone module GroupMilestone
def supports_weight? def supports_weight?
......
# frozen_string_literal: true
module EE module EE
module Identity module Identity
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module Issue module Issue
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
# LFS Object EE mixin # LFS Object EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module List module List
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module MergeRequest module MergeRequest
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
# Namespace EE mixin # Namespace EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module Note module Note
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
# Project EE mixin # Project EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module ProjectAuthorization module ProjectAuthorization
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module ProjectImportData module ProjectImportData
# Required for integration with MirrorAuthentication # Required for integration with MirrorAuthentication
......
# frozen_string_literal: true
module EE module EE
module ProjectImportState module ProjectImportState
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module ProjectTeam module ProjectTeam
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module PrometheusMetric module PrometheusMetric
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module RemoteMirror module RemoteMirror
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
# Repository EE mixin # Repository EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
module Service module Service
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE module EE
module SlackSlashCommandsService module SlackSlashCommandsService
def chat_responder def chat_responder
......
# frozen_string_literal: true
module EE module EE
module SystemNoteMetadata module SystemNoteMetadata
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
module Todo module Todo
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
module EE module EE
# Upload EE mixin # Upload EE mixin
# #
......
# frozen_string_literal: true
module EE module EE
# User EE mixin # User EE mixin
# #
......
# frozen_string_literal: true
class Epic::Metrics < ActiveRecord::Base class Epic::Metrics < ActiveRecord::Base
belongs_to :epic belongs_to :epic
......
# frozen_string_literal: true
class EpicIssue < ActiveRecord::Base class EpicIssue < ActiveRecord::Base
include RelativePositioning include RelativePositioning
......
# frozen_string_literal: true
class Geo::BaseFdw < Geo::TrackingBase class Geo::BaseFdw < Geo::TrackingBase
self.abstract_class = true self.abstract_class = true
end end
# frozen_string_literal: true
class Geo::BaseRegistry < Geo::TrackingBase class Geo::BaseRegistry < Geo::TrackingBase
self.abstract_class = true self.abstract_class = true
end end
# frozen_string_literal: true
class Geo::DeletedProject class Geo::DeletedProject
attr_reader :id, :name, :disk_path attr_reader :id, :name, :disk_path
......
# frozen_string_literal: true
module Geo module Geo
class EventLog < ActiveRecord::Base class EventLog < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
class Geo::EventLogState < Geo::BaseRegistry class Geo::EventLogState < Geo::BaseRegistry
self.primary_key = :event_id self.primary_key = :event_id
......
# frozen_string_literal: true
module Geo module Geo
module Fdw module Fdw
module Ci module Ci
......
# frozen_string_literal: true
module Geo module Geo
module Fdw module Fdw
class LfsObject < ::Geo::BaseFdw class LfsObject < ::Geo::BaseFdw
......
# frozen_string_literal: true
module Geo module Geo
module Fdw module Fdw
class ProjectFeature < ::Geo::BaseFdw class ProjectFeature < ::Geo::BaseFdw
......
# frozen_string_literal: true
module Geo module Geo
module Fdw module Fdw
class ProjectRepositoryState < ::Geo::BaseFdw class ProjectRepositoryState < ::Geo::BaseFdw
......
# frozen_string_literal: true
module Geo module Geo
module Fdw module Fdw
class Upload < ::Geo::BaseFdw class Upload < ::Geo::BaseFdw
......
# frozen_string_literal: true
class Geo::FileRegistry < Geo::BaseRegistry class Geo::FileRegistry < Geo::BaseRegistry
include Geo::Syncable include Geo::Syncable
......
# frozen_string_literal: true
module Geo module Geo
class HashedStorageAttachmentsEvent < ActiveRecord::Base class HashedStorageAttachmentsEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
module Geo module Geo
class HashedStorageMigratedEvent < ActiveRecord::Base class HashedStorageMigratedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
module Geo module Geo
class JobArtifactDeletedEvent < ActiveRecord::Base class JobArtifactDeletedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
class Geo::JobArtifactRegistry < Geo::BaseRegistry class Geo::JobArtifactRegistry < Geo::BaseRegistry
include Geo::Syncable include Geo::Syncable
end end
# frozen_string_literal: true
module Geo module Geo
class LfsObjectDeletedEvent < ActiveRecord::Base class LfsObjectDeletedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
module Geo module Geo
class RepositoriesChangedEvent < ActiveRecord::Base class RepositoriesChangedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
module Geo module Geo
class RepositoryCreatedEvent < ActiveRecord::Base class RepositoryCreatedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
module Geo module Geo
class RepositoryDeletedEvent < ActiveRecord::Base class RepositoryDeletedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
module Geo module Geo
class RepositoryRenamedEvent < ActiveRecord::Base class RepositoryRenamedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
module Geo module Geo
class RepositoryUpdatedEvent < ActiveRecord::Base class RepositoryUpdatedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
# This module is intended to centralize all database access to the secondary # This module is intended to centralize all database access to the secondary
# tracking database for Geo. # tracking database for Geo.
module Geo module Geo
...@@ -14,7 +16,7 @@ module Geo ...@@ -14,7 +16,7 @@ module Geo
def self.connection def self.connection
unless ::Gitlab::Geo.geo_database_configured? unless ::Gitlab::Geo.geo_database_configured?
message = NOT_CONFIGURED_MSG message = NOT_CONFIGURED_MSG
message += "\nIn the GDK root, try running `make geo-setup`" if Rails.env.development? message = "#{message}\nIn the GDK root, try running `make geo-setup`" if Rails.env.development?
raise SecondaryNotConfigured.new(message) raise SecondaryNotConfigured.new(message)
end end
......
# frozen_string_literal: true
module Geo module Geo
class UploadDeletedEvent < ActiveRecord::Base class UploadDeletedEvent < ActiveRecord::Base
include Geo::Model include Geo::Model
......
# frozen_string_literal: true
class GeoNode < ActiveRecord::Base class GeoNode < ActiveRecord::Base
include Presentable include Presentable
......
# frozen_string_literal: true
class GeoNodeNamespaceLink < ActiveRecord::Base class GeoNodeNamespaceLink < ActiveRecord::Base
belongs_to :geo_node, inverse_of: :namespaces belongs_to :geo_node, inverse_of: :namespaces
belongs_to :namespace belongs_to :namespace
......
# frozen_string_literal: true
class GeoNodeStatus < ActiveRecord::Base class GeoNodeStatus < ActiveRecord::Base
include ShaAttribute include ShaAttribute
......
# frozen_string_literal: true
class HistoricalData < ActiveRecord::Base class HistoricalData < ActiveRecord::Base
validates :date, presence: true validates :date, presence: true
......
# frozen_string_literal: true
class GroupHook < ProjectHook class GroupHook < ProjectHook
include CustomModelNaming include CustomModelNaming
include TriggerableHooks include TriggerableHooks
......
# frozen_string_literal: true
class IndexStatus < ActiveRecord::Base class IndexStatus < ActiveRecord::Base
belongs_to :project belongs_to :project
......
# frozen_string_literal: true
class IssueLink < ActiveRecord::Base class IssueLink < ActiveRecord::Base
belongs_to :source, class_name: 'Issue' belongs_to :source, class_name: 'Issue'
belongs_to :target, class_name: 'Issue' belongs_to :target, class_name: 'Issue'
......
# frozen_string_literal: true
class LdapGroupLink < ActiveRecord::Base class LdapGroupLink < ActiveRecord::Base
include Gitlab::Access include Gitlab::Access
belongs_to :group belongs_to :group
......
# frozen_string_literal: true
class LDAPKey < Key class LDAPKey < Key
end end
# frozen_string_literal: true
class License < ActiveRecord::Base class License < ActiveRecord::Base
include ActionView::Helpers::NumberHelper include ActionView::Helpers::NumberHelper
...@@ -434,25 +436,25 @@ class License < ActiveRecord::Base ...@@ -434,25 +436,25 @@ class License < ActiveRecord::Base
add_limit_error(user_count: current_active_users_count) add_limit_error(user_count: current_active_users_count)
end end
else else
message = "You have applied a True-up for #{trueup_qty} #{"user".pluralize(trueup_qty)} " message = ["You have applied a True-up for #{trueup_qty} #{"user".pluralize(trueup_qty)}"]
message << "but you need one for #{expected_trueup_qty} #{"user".pluralize(expected_trueup_qty)}. " message << "but you need one for #{expected_trueup_qty} #{"user".pluralize(expected_trueup_qty)}."
message << "Please contact sales at renewals@gitlab.com" message << "Please contact sales at renewals@gitlab.com"
self.errors.add(:base, message) self.errors.add(:base, message.join(' '))
end end
end end
def add_limit_error(current_period: true, user_count:) def add_limit_error(current_period: true, user_count:)
overage = user_count - restricted_user_count overage = user_count - restricted_user_count
message = current_period ? "This GitLab installation currently has " : "During the year before this license started, this GitLab installation had " message = [current_period ? "This GitLab installation currently has" : "During the year before this license started, this GitLab installation had"]
message << "#{number_with_delimiter(user_count)} active #{"user".pluralize(user_count)}, " message << "#{number_with_delimiter(user_count)} active #{"user".pluralize(user_count)},"
message << "exceeding this license's limit of #{number_with_delimiter(restricted_user_count)} by " message << "exceeding this license's limit of #{number_with_delimiter(restricted_user_count)} by"
message << "#{number_with_delimiter(overage)} #{"user".pluralize(overage)}. " message << "#{number_with_delimiter(overage)} #{"user".pluralize(overage)}."
message << "Please upload a license for at least " message << "Please upload a license for at least"
message << "#{number_with_delimiter(user_count)} #{"user".pluralize(user_count)} or contact sales at renewals@gitlab.com" message << "#{number_with_delimiter(user_count)} #{"user".pluralize(user_count)} or contact sales at renewals@gitlab.com"
self.errors.add(:base, message) self.errors.add(:base, message.join(' '))
end end
def not_expired def not_expired
......
# frozen_string_literal: true
class NamespaceStatistics < ActiveRecord::Base class NamespaceStatistics < ActiveRecord::Base
belongs_to :namespace belongs_to :namespace
......
# frozen_string_literal: true
module Operations module Operations
class FeatureFlag < ActiveRecord::Base class FeatureFlag < ActiveRecord::Base
self.table_name = 'operations_feature_flags' self.table_name = 'operations_feature_flags'
......
# frozen_string_literal: true
module Operations module Operations
class FeatureFlagsClient < ActiveRecord::Base class FeatureFlagsClient < ActiveRecord::Base
include TokenAuthenticatable include TokenAuthenticatable
......
# frozen_string_literal: true
class PathLock < ActiveRecord::Base class PathLock < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :user belongs_to :user
......
# frozen_string_literal: true
# `pg_replication_slots` is a PostgreSQL view # `pg_replication_slots` is a PostgreSQL view
class PgReplicationSlot class PgReplicationSlot
def self.count def self.count
......
# frozen_string_literal: true
class Plan < ActiveRecord::Base class Plan < ActiveRecord::Base
has_many :namespaces has_many :namespaces
end end
# frozen_string_literal: true
class ProjectRepositoryState < ActiveRecord::Base class ProjectRepositoryState < ActiveRecord::Base
include IgnorableColumn include IgnorableColumn
include ShaAttribute include ShaAttribute
......
# frozen_string_literal: true
class GithubService < Service class GithubService < Service
include Gitlab::Routing include Gitlab::Routing
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
......
# frozen_string_literal: true
class GithubService class GithubService
class RemoteProject class RemoteProject
def initialize(url) def initialize(url)
......
# frozen_string_literal: true
class GithubService class GithubService
class StatusMessage class StatusMessage
include Gitlab::Routing include Gitlab::Routing
......
# frozen_string_literal: true
class GithubService class GithubService
class StatusNotifier class StatusNotifier
def initialize(access_token, repo_path, api_endpoint: nil) def initialize(access_token, repo_path, api_endpoint: nil)
......
# frozen_string_literal: true
class GitlabSlackApplicationService < Service class GitlabSlackApplicationService < Service
default_value_for :category, 'chat' default_value_for :category, 'chat'
......
# frozen_string_literal: true
require 'uri' require 'uri'
class JenkinsDeprecatedService < CiService class JenkinsDeprecatedService < CiService
......
# frozen_string_literal: true
class JenkinsService < CiService class JenkinsService < CiService
prop_accessor :jenkins_url, :project_name, :username, :password prop_accessor :jenkins_url, :project_name, :username, :password
......
# frozen_string_literal: true
class PrometheusAlert < ActiveRecord::Base class PrometheusAlert < ActiveRecord::Base
OPERATORS_MAP = { OPERATORS_MAP = {
lt: "<", lt: "<",
......
# frozen_string_literal: true
class ProtectedBranch::UnprotectAccessLevel < ActiveRecord::Base class ProtectedBranch::UnprotectAccessLevel < ActiveRecord::Base
include ProtectedBranchAccess include ProtectedBranchAccess
end end
# frozen_string_literal: true
class PushRule < ActiveRecord::Base class PushRule < ActiveRecord::Base
extend Gitlab::Cache::RequestCache extend Gitlab::Cache::RequestCache
......
# frozen_string_literal: true
class SamlProvider < ActiveRecord::Base class SamlProvider < ActiveRecord::Base
belongs_to :group belongs_to :group
has_many :identities has_many :identities
......
# frozen_string_literal: true
class SlackIntegration < ActiveRecord::Base class SlackIntegration < ActiveRecord::Base
belongs_to :service belongs_to :service
......
# frozen_string_literal: true
require 'digest' require 'digest'
# This is an in-memory structure only. The repository storage configuration is # This is an in-memory structure only. The repository storage configuration is
# in gitlab.yml and not in the database. This model makes it easier to work # in gitlab.yml and not in the database. This model makes it easier to work
......
---
title: Enable some frozen string in ee/app
merge_request: 8667
author: gfyoung
type: performance
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment