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