Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
a3891c50fcef
Commit
a3891c50
authored
Sep 01, 2019
by
dineshpanda
Browse files
Avoid calling freeze on already frozen strings in app/models
parent
2963c1d4eb76
Changes
30
Hide whitespace changes
Inline
Side-by-side
app/models/award_emoji.rb
View file @
a3891c50
# 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
...
...
app/models/blob_viewer/base.rb
View file @
a3891c50
...
...
@@ -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
...
...
app/models/broadcast_message.rb
View file @
a3891c50
...
...
@@ -16,7 +16,7 @@
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
...
...
app/models/ci/build.rb
View file @
a3891c50
...
...
@@ -445,7 +445,7 @@
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
|
...
...
app/models/ci/build_runner_session.rb
View file @
a3891c50
...
...
@@ -6,7 +6,7 @@
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'
...
...
app/models/clusters/applications/ingress.rb
View file @
a3891c50
...
...
@@ -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'
...
...
app/models/clusters/applications/jupyter.rb
View file @
a3891c50
...
...
@@ -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'
...
...
app/models/clusters/applications/knative.rb
View file @
a3891c50
...
...
@@ -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'
...
...
app/models/clusters/applications/runner.rb
View file @
a3891c50
...
...
@@ -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'
...
...
app/models/clusters/cluster.rb
View file @
a3891c50
...
...
@@ -20,8 +20,8 @@
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
...
...
app/models/concerns/cacheable_attributes.rb
View file @
a3891c50
...
...
@@ -11,7 +11,7 @@
class_methods
do
def
cache_key
"
#{
name
}
:
#{
Gitlab
::
VERSION
}
:
#{
Rails
.
version
}
"
.
freeze
"
#{
name
}
:
#{
Gitlab
::
VERSION
}
:
#{
Rails
.
version
}
"
end
# Can be overridden
...
...
app/models/concerns/has_status.rb
View file @
a3891c50
...
...
@@ -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
...
...
app/models/concerns/protected_ref_access.rb
View file @
a3891c50
...
...
@@ -4,9 +4,9 @@
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
...
...
app/models/concerns/taskable.rb
View file @
a3891c50
...
...
@@ -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{
...
...
app/models/deploy_token.rb
View file @
a3891c50
...
...
@@ -8,7 +8,7 @@
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
}
...
...
app/models/diff_viewer/base.rb
View file @
a3891c50
...
...
@@ -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
...
...
app/models/gpg_key.rb
View file @
a3891c50
# 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
...
...
app/models/instance_configuration.rb
View file @
a3891c50
...
...
@@ -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
...
...
app/models/members/group_member.rb
View file @
a3891c50
...
...
@@ -3,7 +3,7 @@
class
GroupMember
<
Member
include
FromUnion
SOURCE_TYPE
=
'Namespace'
.
freeze
SOURCE_TYPE
=
'Namespace'
belongs_to
:group
,
foreign_key:
'source_id'
...
...
app/models/members/project_member.rb
View file @
a3891c50
# frozen_string_literal: true
class
ProjectMember
<
Member
SOURCE_TYPE
=
'Project'
.
freeze
SOURCE_TYPE
=
'Project'
belongs_to
:project
,
foreign_key:
'source_id'
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment