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
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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