Commit 3f83771e authored by dineshpanda's avatar dineshpanda
Browse files

Avoid calling freeze on already frozen strings in app/models

parent 2963c1d4eb76
# frozen_string_literal: true
class AwardEmoji < ApplicationRecord
DOWNVOTE_NAME = "thumbsdown".freeze
UPVOTE_NAME = "thumbsup".freeze
DOWNVOTE_NAME = "thumbsdown"
UPVOTE_NAME = "thumbsup"
include Participable
include GhostUser
......
......@@ -2,7 +2,7 @@
module BlobViewer
class Base
PARTIAL_PATH_PREFIX = 'projects/blob/viewers'.freeze
PARTIAL_PATH_PREFIX = 'projects/blob/viewers'
class_attribute :partial_name, :loading_partial_name, :type, :extensions, :file_types, :load_async, :binary, :switcher_icon, :switcher_title, :collapse_limit, :size_limit
......
......@@ -16,7 +16,7 @@ class BroadcastMessage < ApplicationRecord
default_value_for :color, '#E75E40'
default_value_for :font, '#FFFFFF'
CACHE_KEY = 'broadcast_message_current_json'.freeze
CACHE_KEY = 'broadcast_message_current_json'
after_commit :flush_redis_cache
......
......@@ -445,7 +445,7 @@ def variables
end
end
CI_REGISTRY_USER = 'gitlab-ci-token'.freeze
CI_REGISTRY_USER = 'gitlab-ci-token'
def persisted_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
......
......@@ -6,7 +6,7 @@ module Ci
class BuildRunnerSession < ApplicationRecord
extend Gitlab::Ci::Model
TERMINAL_SUBPROTOCOL = 'terminal.gitlab.com'.freeze
TERMINAL_SUBPROTOCOL = 'terminal.gitlab.com'
self.table_name = 'ci_builds_runner_session'
......
......@@ -3,7 +3,7 @@
module Clusters
module Applications
class Ingress < ApplicationRecord
VERSION = '1.1.2'.freeze
VERSION = '1.1.2'
self.table_name = 'clusters_applications_ingress'
......
......@@ -5,7 +5,7 @@
module Clusters
module Applications
class Jupyter < ApplicationRecord
VERSION = '0.9-174bbd5'.freeze
VERSION = '0.9-174bbd5'
self.table_name = 'clusters_applications_jupyter'
......
......@@ -3,9 +3,9 @@
module Clusters
module Applications
class Knative < ApplicationRecord
VERSION = '0.6.0'.freeze
REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts'.freeze
METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'.freeze
VERSION = '0.6.0'
REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts'
METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'
FETCH_IP_ADDRESS_DELAY = 30.seconds
API_RESOURCES_PATH = 'config/knative/api_resources.yml'
......
......@@ -3,7 +3,7 @@
module Clusters
module Applications
class Runner < ApplicationRecord
VERSION = '0.8.0'.freeze
VERSION = '0.8.0'
self.table_name = 'clusters_applications_runners'
......
......@@ -20,8 +20,8 @@ class Cluster < ApplicationRecord
Applications::Runner.application_name => Applications::Runner,
Applications::Prometheus.application_name => Applications::Prometheus
}.merge(PROJECT_ONLY_APPLICATIONS).freeze
DEFAULT_ENVIRONMENT = '*'.freeze
KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'.freeze
DEFAULT_ENVIRONMENT = '*'
KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'
belongs_to :user
......
......@@ -11,7 +11,7 @@ module CacheableAttributes
class_methods do
def cache_key
"#{name}:#{Gitlab::VERSION}:#{Rails.version}".freeze
"#{name}:#{Gitlab::VERSION}:#{Rails.version}"
end
# Can be overridden
......
......@@ -3,7 +3,7 @@
module HasStatus
extend ActiveSupport::Concern
DEFAULT_STATUS = 'created'.freeze
DEFAULT_STATUS = 'created'
BLOCKED_STATUS = %w[manual scheduled].freeze
AVAILABLE_STATUSES = %w[created preparing pending running success failed canceled skipped manual scheduled].freeze
STARTED_STATUSES = %w[running success failed skipped manual scheduled].freeze
......
......@@ -4,9 +4,9 @@ module ProtectedRefAccess
extend ActiveSupport::Concern
HUMAN_ACCESS_LEVELS = {
Gitlab::Access::MAINTAINER => "Maintainers".freeze,
Gitlab::Access::DEVELOPER => "Developers + Maintainers".freeze,
Gitlab::Access::NO_ACCESS => "No one".freeze
Gitlab::Access::MAINTAINER => "Maintainers",
Gitlab::Access::DEVELOPER => "Developers + Maintainers",
Gitlab::Access::NO_ACCESS => "No one"
}.freeze
class_methods do
......
......@@ -9,8 +9,8 @@
#
# Used by MergeRequest and Issue
module Taskable
COMPLETED = 'completed'.freeze
INCOMPLETE = 'incomplete'.freeze
COMPLETED = 'completed'
INCOMPLETE = 'incomplete'
COMPLETE_PATTERN = /(\[[xX]\])/.freeze
INCOMPLETE_PATTERN = /(\[[\s]\])/.freeze
ITEM_PATTERN = %r{
......
......@@ -8,7 +8,7 @@ class DeployToken < ApplicationRecord
add_authentication_token_field :token, encrypted: :optional
AVAILABLE_SCOPES = %i(read_repository read_registry).freeze
GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'.freeze
GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'
default_value_for(:expires_at) { Forever.date }
......
......@@ -2,7 +2,7 @@
module DiffViewer
class Base
PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'.freeze
PARTIAL_PATH_PREFIX = 'projects/diffs/viewers'
class_attribute :partial_name, :type, :extensions, :file_types, :binary, :switcher_icon, :switcher_title
......
# frozen_string_literal: true
class GpgKey < ApplicationRecord
KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze
KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'.freeze
KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'
KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'
include ShaAttribute
......
......@@ -4,8 +4,8 @@
class InstanceConfiguration
SSH_ALGORITHMS = %w(DSA ECDSA ED25519 RSA).freeze
SSH_ALGORITHMS_PATH = '/etc/ssh/'.freeze
CACHE_KEY = 'instance_configuration'.freeze
SSH_ALGORITHMS_PATH = '/etc/ssh/'
CACHE_KEY = 'instance_configuration'
EXPIRATION_TIME = 24.hours
def settings
......
......@@ -3,7 +3,7 @@
class GroupMember < Member
include FromUnion
SOURCE_TYPE = 'Namespace'.freeze
SOURCE_TYPE = 'Namespace'
belongs_to :group, foreign_key: 'source_id'
......
# frozen_string_literal: true
class ProjectMember < Member
SOURCE_TYPE = 'Project'.freeze
SOURCE_TYPE = 'Project'
belongs_to :project, foreign_key: 'source_id'
......
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