Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
20111b04
Commit
20111b04
authored
Sep 01, 2019
by
dineshpanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid calling freeze on already frozen strings in app/models
parent
dc864927
Changes
30
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
45 additions
and
45 deletions
+45
-45
app/models/award_emoji.rb
app/models/award_emoji.rb
+2
-2
app/models/blob_viewer/base.rb
app/models/blob_viewer/base.rb
+1
-1
app/models/broadcast_message.rb
app/models/broadcast_message.rb
+1
-1
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
app/models/ci/build_runner_session.rb
app/models/ci/build_runner_session.rb
+1
-1
app/models/clusters/applications/ingress.rb
app/models/clusters/applications/ingress.rb
+1
-1
app/models/clusters/applications/jupyter.rb
app/models/clusters/applications/jupyter.rb
+1
-1
app/models/clusters/applications/knative.rb
app/models/clusters/applications/knative.rb
+3
-3
app/models/clusters/applications/runner.rb
app/models/clusters/applications/runner.rb
+1
-1
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+2
-2
app/models/concerns/cacheable_attributes.rb
app/models/concerns/cacheable_attributes.rb
+1
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-1
app/models/concerns/protected_ref_access.rb
app/models/concerns/protected_ref_access.rb
+3
-3
app/models/concerns/taskable.rb
app/models/concerns/taskable.rb
+2
-2
app/models/deploy_token.rb
app/models/deploy_token.rb
+1
-1
app/models/diff_viewer/base.rb
app/models/diff_viewer/base.rb
+1
-1
app/models/gpg_key.rb
app/models/gpg_key.rb
+2
-2
app/models/instance_configuration.rb
app/models/instance_configuration.rb
+2
-2
app/models/members/group_member.rb
app/models/members/group_member.rb
+1
-1
app/models/members/project_member.rb
app/models/members/project_member.rb
+1
-1
app/models/namespace/aggregation_schedule.rb
app/models/namespace/aggregation_schedule.rb
+1
-1
app/models/notification_reason.rb
app/models/notification_reason.rb
+3
-3
app/models/pages_domain.rb
app/models/pages_domain.rb
+1
-1
app/models/project.rb
app/models/project.rb
+2
-2
app/models/project_services/buildkite_service.rb
app/models/project_services/buildkite_service.rb
+1
-1
app/models/project_services/pivotaltracker_service.rb
app/models/project_services/pivotaltracker_service.rb
+1
-1
app/models/project_services/pushover_service.rb
app/models/project_services/pushover_service.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+3
-3
app/models/user.rb
app/models/user.rb
+2
-2
app/models/user_status.rb
app/models/user_status.rb
+1
-1
No files found.
app/models/award_emoji.rb
View file @
20111b04
# 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 @
20111b04
...
...
@@ -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 @
20111b04
...
...
@@ -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
...
...
app/models/ci/build.rb
View file @
20111b04
...
...
@@ -445,7 +445,7 @@ module Ci
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 @
20111b04
...
...
@@ -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'
...
...
app/models/clusters/applications/ingress.rb
View file @
20111b04
...
...
@@ -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 @
20111b04
...
...
@@ -5,7 +5,7 @@ require 'securerandom'
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 @
20111b04
...
...
@@ -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 @
20111b04
...
...
@@ -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 @
20111b04
...
...
@@ -20,8 +20,8 @@ module Clusters
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 @
20111b04
...
...
@@ -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
...
...
app/models/concerns/has_status.rb
View file @
20111b04
...
...
@@ -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 @
20111b04
...
...
@@ -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
...
...
app/models/concerns/taskable.rb
View file @
20111b04
...
...
@@ -9,8 +9,8 @@ require 'task_list/filter'
#
# 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 @
20111b04
...
...
@@ -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
}
...
...
app/models/diff_viewer/base.rb
View file @
20111b04
...
...
@@ -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 @
20111b04
# 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 @
20111b04
...
...
@@ -4,8 +4,8 @@ require 'resolv'
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 @
20111b04
...
...
@@ -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 @
20111b04
# frozen_string_literal: true
class
ProjectMember
<
Member
SOURCE_TYPE
=
'Project'
.
freeze
SOURCE_TYPE
=
'Project'
belongs_to
:project
,
foreign_key:
'source_id'
...
...
app/models/namespace/aggregation_schedule.rb
View file @
20111b04
...
...
@@ -7,7 +7,7 @@ class Namespace::AggregationSchedule < ApplicationRecord
self
.
primary_key
=
:namespace_id
DEFAULT_LEASE_TIMEOUT
=
1.5
.
hours
.
to_i
REDIS_SHARED_KEY
=
'gitlab:update_namespace_statistics_delay'
.
freeze
REDIS_SHARED_KEY
=
'gitlab:update_namespace_statistics_delay'
belongs_to
:namespace
...
...
app/models/notification_reason.rb
View file @
20111b04
...
...
@@ -3,9 +3,9 @@
# Holds reasons for a notification to have been sent as well as a priority list to select which reason to use
# above the rest
class
NotificationReason
OWN_ACTIVITY
=
'own_activity'
.
freeze
ASSIGNED
=
'assigned'
.
freeze
MENTIONED
=
'mentioned'
.
freeze
OWN_ACTIVITY
=
'own_activity'
ASSIGNED
=
'assigned'
MENTIONED
=
'mentioned'
# Priority list for selecting which reason to return in the notification
REASON_PRIORITY
=
[
...
...
app/models/pages_domain.rb
View file @
20111b04
# frozen_string_literal: true
class
PagesDomain
<
ApplicationRecord
VERIFICATION_KEY
=
'gitlab-pages-verification-code'
.
freeze
VERIFICATION_KEY
=
'gitlab-pages-verification-code'
VERIFICATION_THRESHOLD
=
3
.
days
.
freeze
SSL_RENEWAL_THRESHOLD
=
30
.
days
.
freeze
...
...
app/models/project.rb
View file @
20111b04
...
...
@@ -37,8 +37,8 @@ class Project < ApplicationRecord
BoardLimitExceeded
=
Class
.
new
(
StandardError
)
STATISTICS_ATTRIBUTE
=
'repositories_count'
.
freeze
UNKNOWN_IMPORT_URL
=
'http://unknown.git'
.
freeze
STATISTICS_ATTRIBUTE
=
'repositories_count'
UNKNOWN_IMPORT_URL
=
'http://unknown.git'
# Hashed Storage versions handle rolling out new storage to project and dependents models:
# nil: legacy
# 1: repository
...
...
app/models/project_services/buildkite_service.rb
View file @
20111b04
...
...
@@ -5,7 +5,7 @@ require "addressable/uri"
class
BuildkiteService
<
CiService
include
ReactiveService
ENDPOINT
=
"https://buildkite.com"
.
freeze
ENDPOINT
=
"https://buildkite.com"
prop_accessor
:project_url
,
:token
boolean_accessor
:enable_ssl_verification
...
...
app/models/project_services/pivotaltracker_service.rb
View file @
20111b04
# frozen_string_literal: true
class
PivotaltrackerService
<
Service
API_ENDPOINT
=
'https://www.pivotaltracker.com/services/v5/source_commits'
.
freeze
API_ENDPOINT
=
'https://www.pivotaltracker.com/services/v5/source_commits'
prop_accessor
:token
,
:restrict_to_branch
validates
:token
,
presence:
true
,
if: :activated?
...
...
app/models/project_services/pushover_service.rb
View file @
20111b04
# frozen_string_literal: true
class
PushoverService
<
Service
BASE_URI
=
'https://api.pushover.net/1'
.
freeze
BASE_URI
=
'https://api.pushover.net/1'
prop_accessor
:api_key
,
:user_key
,
:device
,
:priority
,
:sound
validates
:api_key
,
:user_key
,
:priority
,
presence:
true
,
if: :activated?
...
...
app/models/repository.rb
View file @
20111b04
...
...
@@ -3,9 +3,9 @@
require
'securerandom'
class
Repository
REF_MERGE_REQUEST
=
'merge-requests'
.
freeze
REF_KEEP_AROUND
=
'keep-around'
.
freeze
REF_ENVIRONMENTS
=
'environments'
.
freeze
REF_MERGE_REQUEST
=
'merge-requests'
REF_KEEP_AROUND
=
'keep-around'
REF_ENVIRONMENTS
=
'environments'
ARCHIVE_CACHE_TIME
=
60
# Cache archives referred to by a (mutable) ref for 1 minute
ARCHIVE_CACHE_TIME_IMMUTABLE
=
3600
# Cache archives referred to by an immutable reference for 1 hour
...
...
app/models/user.rb
View file @
20111b04
...
...
@@ -59,7 +59,7 @@ class User < ApplicationRecord
:validatable
,
:omniauthable
,
:confirmable
,
:registerable
BLOCKED_MESSAGE
=
"Your account has been blocked. Please contact your GitLab "
\
"administrator if you think this is an error."
.
freeze
"administrator if you think this is an error."
# Override Devise::Models::Trackable#update_tracked_fields!
# to limit database writes to at most once every hour
...
...
@@ -494,7 +494,7 @@ class User < ApplicationRecord
def
by_login
(
login
)
return
unless
login
if
login
.
include?
(
'@'
.
freeze
)
if
login
.
include?
(
'@'
)
unscoped
.
iwhere
(
email:
login
).
take
else
unscoped
.
iwhere
(
username:
login
).
take
...
...
app/models/user_status.rb
View file @
20111b04
...
...
@@ -5,7 +5,7 @@ class UserStatus < ApplicationRecord
self
.
primary_key
=
:user_id
DEFAULT_EMOJI
=
'speech_balloon'
.
freeze
DEFAULT_EMOJI
=
'speech_balloon'
belongs_to
:user
...
...
Write
Preview
Markdown
is supported
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