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
50abbd3e
Commit
50abbd3e
authored
Jul 25, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string in app/models/*.rb
Partially addresses #47424.
parent
caeb4597
Changes
139
Show whitespace changes
Inline
Side-by-side
Showing
139 changed files
with
286 additions
and
7 deletions
+286
-7
app/controllers/admin/services_controller.rb
app/controllers/admin/services_controller.rb
+3
-1
app/models/ability.rb
app/models/ability.rb
+2
-0
app/models/abuse_report.rb
app/models/abuse_report.rb
+2
-0
app/models/active_session.rb
app/models/active_session.rb
+2
-0
app/models/appearance.rb
app/models/appearance.rb
+2
-0
app/models/application_setting.rb
app/models/application_setting.rb
+2
-0
app/models/audit_event.rb
app/models/audit_event.rb
+2
-0
app/models/award_emoji.rb
app/models/award_emoji.rb
+2
-0
app/models/badge.rb
app/models/badge.rb
+2
-0
app/models/blob.rb
app/models/blob.rb
+2
-0
app/models/board.rb
app/models/board.rb
+2
-0
app/models/broadcast_message.rb
app/models/broadcast_message.rb
+2
-0
app/models/chat_name.rb
app/models/chat_name.rb
+2
-0
app/models/chat_team.rb
app/models/chat_team.rb
+2
-0
app/models/commit.rb
app/models/commit.rb
+6
-4
app/models/commit_range.rb
app/models/commit_range.rb
+2
-0
app/models/commit_status.rb
app/models/commit_status.rb
+2
-0
app/models/compare.rb
app/models/compare.rb
+2
-0
app/models/container_repository.rb
app/models/container_repository.rb
+2
-0
app/models/cycle_analytics.rb
app/models/cycle_analytics.rb
+2
-0
app/models/dashboard_milestone.rb
app/models/dashboard_milestone.rb
+2
-0
app/models/deploy_key.rb
app/models/deploy_key.rb
+2
-0
app/models/deploy_keys_project.rb
app/models/deploy_keys_project.rb
+2
-0
app/models/deploy_token.rb
app/models/deploy_token.rb
+2
-0
app/models/deployment.rb
app/models/deployment.rb
+2
-0
app/models/diff_discussion.rb
app/models/diff_discussion.rb
+2
-0
app/models/diff_note.rb
app/models/diff_note.rb
+2
-0
app/models/directly_addressed_user.rb
app/models/directly_addressed_user.rb
+2
-0
app/models/discussion.rb
app/models/discussion.rb
+2
-0
app/models/discussion_note.rb
app/models/discussion_note.rb
+2
-0
app/models/email.rb
app/models/email.rb
+2
-0
app/models/environment.rb
app/models/environment.rb
+3
-1
app/models/epic.rb
app/models/epic.rb
+2
-0
app/models/event.rb
app/models/event.rb
+2
-0
app/models/event_collection.rb
app/models/event_collection.rb
+2
-0
app/models/external_issue.rb
app/models/external_issue.rb
+2
-0
app/models/fork_network.rb
app/models/fork_network.rb
+2
-0
app/models/fork_network_member.rb
app/models/fork_network_member.rb
+2
-0
app/models/forked_project_link.rb
app/models/forked_project_link.rb
+2
-0
app/models/generic_commit_status.rb
app/models/generic_commit_status.rb
+2
-0
app/models/global_label.rb
app/models/global_label.rb
+2
-0
app/models/global_milestone.rb
app/models/global_milestone.rb
+2
-0
app/models/gpg_key.rb
app/models/gpg_key.rb
+2
-0
app/models/gpg_key_subkey.rb
app/models/gpg_key_subkey.rb
+2
-0
app/models/gpg_signature.rb
app/models/gpg_signature.rb
+2
-0
app/models/group.rb
app/models/group.rb
+2
-0
app/models/group_custom_attribute.rb
app/models/group_custom_attribute.rb
+2
-0
app/models/group_label.rb
app/models/group_label.rb
+2
-0
app/models/group_milestone.rb
app/models/group_milestone.rb
+2
-0
app/models/guest.rb
app/models/guest.rb
+2
-0
app/models/identity.rb
app/models/identity.rb
+2
-0
app/models/import_export_upload.rb
app/models/import_export_upload.rb
+2
-0
app/models/individual_note_discussion.rb
app/models/individual_note_discussion.rb
+2
-0
app/models/instance_configuration.rb
app/models/instance_configuration.rb
+2
-0
app/models/internal_id.rb
app/models/internal_id.rb
+2
-0
app/models/issue.rb
app/models/issue.rb
+2
-0
app/models/issue_assignee.rb
app/models/issue_assignee.rb
+2
-0
app/models/issue_collection.rb
app/models/issue_collection.rb
+2
-0
app/models/key.rb
app/models/key.rb
+2
-0
app/models/label.rb
app/models/label.rb
+2
-0
app/models/label_link.rb
app/models/label_link.rb
+2
-0
app/models/label_priority.rb
app/models/label_priority.rb
+2
-0
app/models/legacy_diff_discussion.rb
app/models/legacy_diff_discussion.rb
+2
-0
app/models/legacy_diff_note.rb
app/models/legacy_diff_note.rb
+2
-0
app/models/lfs_file_lock.rb
app/models/lfs_file_lock.rb
+2
-0
app/models/lfs_object.rb
app/models/lfs_object.rb
+2
-0
app/models/lfs_objects_project.rb
app/models/lfs_objects_project.rb
+2
-0
app/models/list.rb
app/models/list.rb
+2
-0
app/models/member.rb
app/models/member.rb
+2
-0
app/models/merge_request.rb
app/models/merge_request.rb
+2
-0
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+2
-0
app/models/merge_request_diff_commit.rb
app/models/merge_request_diff_commit.rb
+2
-0
app/models/merge_request_diff_file.rb
app/models/merge_request_diff_file.rb
+2
-0
app/models/merge_requests_closing_issues.rb
app/models/merge_requests_closing_issues.rb
+2
-0
app/models/milestone.rb
app/models/milestone.rb
+2
-0
app/models/namespace.rb
app/models/namespace.rb
+2
-0
app/models/note.rb
app/models/note.rb
+2
-0
app/models/note_diff_file.rb
app/models/note_diff_file.rb
+2
-0
app/models/notification_reason.rb
app/models/notification_reason.rb
+2
-0
app/models/notification_recipient.rb
app/models/notification_recipient.rb
+2
-0
app/models/notification_setting.rb
app/models/notification_setting.rb
+2
-0
app/models/oauth_access_grant.rb
app/models/oauth_access_grant.rb
+2
-0
app/models/oauth_access_token.rb
app/models/oauth_access_token.rb
+2
-0
app/models/out_of_context_discussion.rb
app/models/out_of_context_discussion.rb
+2
-0
app/models/pages_domain.rb
app/models/pages_domain.rb
+2
-0
app/models/personal_access_token.rb
app/models/personal_access_token.rb
+2
-0
app/models/personal_snippet.rb
app/models/personal_snippet.rb
+2
-0
app/models/project.rb
app/models/project.rb
+2
-0
app/models/project_authorization.rb
app/models/project_authorization.rb
+2
-0
app/models/project_auto_devops.rb
app/models/project_auto_devops.rb
+2
-0
app/models/project_ci_cd_setting.rb
app/models/project_ci_cd_setting.rb
+2
-0
app/models/project_custom_attribute.rb
app/models/project_custom_attribute.rb
+2
-0
app/models/project_deploy_token.rb
app/models/project_deploy_token.rb
+2
-0
app/models/project_feature.rb
app/models/project_feature.rb
+2
-0
app/models/project_group_link.rb
app/models/project_group_link.rb
+2
-0
app/models/project_import_data.rb
app/models/project_import_data.rb
+2
-0
app/models/project_import_state.rb
app/models/project_import_state.rb
+2
-0
app/models/project_label.rb
app/models/project_label.rb
+2
-0
app/models/project_snippet.rb
app/models/project_snippet.rb
+2
-0
app/models/project_statistics.rb
app/models/project_statistics.rb
+2
-0
app/models/project_team.rb
app/models/project_team.rb
+2
-0
app/models/protectable_dropdown.rb
app/models/protectable_dropdown.rb
+2
-0
app/models/protected_branch.rb
app/models/protected_branch.rb
+2
-0
app/models/protected_ref_matcher.rb
app/models/protected_ref_matcher.rb
+2
-0
app/models/protected_tag.rb
app/models/protected_tag.rb
+2
-0
app/models/push_event.rb
app/models/push_event.rb
+2
-0
app/models/push_event_payload.rb
app/models/push_event_payload.rb
+2
-0
app/models/readme_blob.rb
app/models/readme_blob.rb
+2
-0
app/models/redirect_route.rb
app/models/redirect_route.rb
+2
-0
app/models/release.rb
app/models/release.rb
+2
-0
app/models/remote_mirror.rb
app/models/remote_mirror.rb
+2
-0
app/models/repository.rb
app/models/repository.rb
+2
-0
app/models/route.rb
app/models/route.rb
+2
-0
app/models/security_event.rb
app/models/security_event.rb
+2
-0
app/models/sent_notification.rb
app/models/sent_notification.rb
+2
-0
app/models/service.rb
app/models/service.rb
+2
-0
app/models/snippet.rb
app/models/snippet.rb
+2
-0
app/models/snippet_blob.rb
app/models/snippet_blob.rb
+2
-0
app/models/spam_log.rb
app/models/spam_log.rb
+2
-0
app/models/subscription.rb
app/models/subscription.rb
+2
-0
app/models/system_note_metadata.rb
app/models/system_note_metadata.rb
+2
-0
app/models/term_agreement.rb
app/models/term_agreement.rb
+2
-0
app/models/timelog.rb
app/models/timelog.rb
+2
-0
app/models/todo.rb
app/models/todo.rb
+2
-0
app/models/tree.rb
app/models/tree.rb
+2
-0
app/models/trending_project.rb
app/models/trending_project.rb
+2
-0
app/models/u2f_registration.rb
app/models/u2f_registration.rb
+2
-0
app/models/upload.rb
app/models/upload.rb
+2
-0
app/models/user.rb
app/models/user.rb
+2
-0
app/models/user_agent_detail.rb
app/models/user_agent_detail.rb
+2
-0
app/models/user_callout.rb
app/models/user_callout.rb
+2
-0
app/models/user_custom_attribute.rb
app/models/user_custom_attribute.rb
+2
-0
app/models/user_interacted_project.rb
app/models/user_interacted_project.rb
+2
-0
app/models/user_synced_attributes_metadata.rb
app/models/user_synced_attributes_metadata.rb
+2
-0
app/models/users_star_project.rb
app/models/users_star_project.rb
+2
-0
app/models/wiki_directory.rb
app/models/wiki_directory.rb
+2
-0
app/models/wiki_page.rb
app/models/wiki_page.rb
+2
-0
changelogs/unreleased/frozen-string-enable-app-models.yml
changelogs/unreleased/frozen-string-enable-app-models.yml
+5
-0
spec/controllers/admin/services_controller_spec.rb
spec/controllers/admin/services_controller_spec.rb
+1
-1
No files found.
app/controllers/admin/services_controller.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Admin::ServicesController
<
Admin
::
ApplicationController
class
Admin::ServicesController
<
Admin
::
ApplicationController
include
ServiceParams
include
ServiceParams
...
@@ -30,7 +32,7 @@ class Admin::ServicesController < Admin::ApplicationController
...
@@ -30,7 +32,7 @@ class Admin::ServicesController < Admin::ApplicationController
def
services_templates
def
services_templates
Service
.
available_services_names
.
map
do
|
service_name
|
Service
.
available_services_names
.
map
do
|
service_name
|
service_template
=
service_name
.
concat
(
"_service"
)
.
camelize
.
constantize
service_template
=
"
#{
service_name
}
_service"
.
camelize
.
constantize
service_template
.
where
(
template:
true
).
first_or_create
service_template
.
where
(
template:
true
).
first_or_create
end
end
end
end
...
...
app/models/ability.rb
View file @
50abbd3e
# frozen_string_literal: true
require_dependency
'declarative_policy'
require_dependency
'declarative_policy'
class
Ability
class
Ability
...
...
app/models/abuse_report.rb
View file @
50abbd3e
# frozen_string_literal: true
class
AbuseReport
<
ActiveRecord
::
Base
class
AbuseReport
<
ActiveRecord
::
Base
include
CacheMarkdownField
include
CacheMarkdownField
...
...
app/models/active_session.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ActiveSession
class
ActiveSession
include
ActiveModel
::
Model
include
ActiveModel
::
Model
...
...
app/models/appearance.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Appearance
<
ActiveRecord
::
Base
class
Appearance
<
ActiveRecord
::
Base
include
CacheableAttributes
include
CacheableAttributes
include
CacheMarkdownField
include
CacheMarkdownField
...
...
app/models/application_setting.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ApplicationSetting
<
ActiveRecord
::
Base
class
ApplicationSetting
<
ActiveRecord
::
Base
include
CacheableAttributes
include
CacheableAttributes
include
CacheMarkdownField
include
CacheMarkdownField
...
...
app/models/audit_event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
AuditEvent
<
ActiveRecord
::
Base
class
AuditEvent
<
ActiveRecord
::
Base
serialize
:details
,
Hash
# rubocop:disable Cop/ActiveRecordSerialize
serialize
:details
,
Hash
# rubocop:disable Cop/ActiveRecordSerialize
...
...
app/models/award_emoji.rb
View file @
50abbd3e
# frozen_string_literal: true
class
AwardEmoji
<
ActiveRecord
::
Base
class
AwardEmoji
<
ActiveRecord
::
Base
DOWNVOTE_NAME
=
"thumbsdown"
.
freeze
DOWNVOTE_NAME
=
"thumbsdown"
.
freeze
UPVOTE_NAME
=
"thumbsup"
.
freeze
UPVOTE_NAME
=
"thumbsup"
.
freeze
...
...
app/models/badge.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Badge
<
ActiveRecord
::
Base
class
Badge
<
ActiveRecord
::
Base
# This structure sets the placeholders that the urls
# This structure sets the placeholders that the urls
# can have. This hash also sets which action to ask when
# can have. This hash also sets which action to ask when
...
...
app/models/blob.rb
View file @
50abbd3e
# frozen_string_literal: true
# Blob is a Rails-specific wrapper around Gitlab::Git::Blob objects
# Blob is a Rails-specific wrapper around Gitlab::Git::Blob objects
class
Blob
<
SimpleDelegator
class
Blob
<
SimpleDelegator
CACHE_TIME
=
60
# Cache raw blobs referred to by a (mutable) ref for 1 minute
CACHE_TIME
=
60
# Cache raw blobs referred to by a (mutable) ref for 1 minute
...
...
app/models/board.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Board
<
ActiveRecord
::
Base
class
Board
<
ActiveRecord
::
Base
belongs_to
:group
belongs_to
:group
belongs_to
:project
belongs_to
:project
...
...
app/models/broadcast_message.rb
View file @
50abbd3e
# frozen_string_literal: true
class
BroadcastMessage
<
ActiveRecord
::
Base
class
BroadcastMessage
<
ActiveRecord
::
Base
include
CacheMarkdownField
include
CacheMarkdownField
include
Sortable
include
Sortable
...
...
app/models/chat_name.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ChatName
<
ActiveRecord
::
Base
class
ChatName
<
ActiveRecord
::
Base
LAST_USED_AT_INTERVAL
=
1
.
hour
LAST_USED_AT_INTERVAL
=
1
.
hour
...
...
app/models/chat_team.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ChatTeam
<
ActiveRecord
::
Base
class
ChatTeam
<
ActiveRecord
::
Base
validates
:team_id
,
presence:
true
validates
:team_id
,
presence:
true
validates
:namespace
,
uniqueness:
true
validates
:namespace
,
uniqueness:
true
...
...
app/models/commit.rb
View file @
50abbd3e
# coding: utf-8
# coding: utf-8
# frozen_string_literal: true
class
Commit
class
Commit
extend
ActiveModel
::
Naming
extend
ActiveModel
::
Naming
extend
Gitlab
::
Cache
::
RequestCache
extend
Gitlab
::
Cache
::
RequestCache
...
@@ -339,21 +341,21 @@ class Commit
...
@@ -339,21 +341,21 @@ class Commit
end
end
def
cherry_pick_description
(
user
)
def
cherry_pick_description
(
user
)
message_body
=
"(cherry picked from commit
#{
sha
}
)"
message_body
=
[
"(cherry picked from commit
#{
sha
}
)"
]
if
merged_merge_request?
(
user
)
if
merged_merge_request?
(
user
)
commits_in_merge_request
=
merged_merge_request
(
user
).
commits
commits_in_merge_request
=
merged_merge_request
(
user
).
commits
if
commits_in_merge_request
.
present?
if
commits_in_merge_request
.
present?
message_body
<<
"
\n
"
message_body
<<
""
commits_in_merge_request
.
reverse
.
each
do
|
commit_in_merge
|
commits_in_merge_request
.
reverse
.
each
do
|
commit_in_merge
|
message_body
<<
"
\n
#{
commit_in_merge
.
short_id
}
#{
commit_in_merge
.
title
}
"
message_body
<<
"
#{
commit_in_merge
.
short_id
}
#{
commit_in_merge
.
title
}
"
end
end
end
end
end
end
message_body
message_body
.
join
(
"
\n
"
)
end
end
def
cherry_pick_message
(
user
)
def
cherry_pick_message
(
user
)
...
...
app/models/commit_range.rb
View file @
50abbd3e
# frozen_string_literal: true
# CommitRange makes it easier to work with commit ranges
# CommitRange makes it easier to work with commit ranges
#
#
# Examples:
# Examples:
...
...
app/models/commit_status.rb
View file @
50abbd3e
# frozen_string_literal: true
class
CommitStatus
<
ActiveRecord
::
Base
class
CommitStatus
<
ActiveRecord
::
Base
include
HasStatus
include
HasStatus
include
Importable
include
Importable
...
...
app/models/compare.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Compare
class
Compare
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
...
...
app/models/container_repository.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ContainerRepository
<
ActiveRecord
::
Base
class
ContainerRepository
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
...
...
app/models/cycle_analytics.rb
View file @
50abbd3e
# frozen_string_literal: true
class
CycleAnalytics
class
CycleAnalytics
STAGES
=
%i[issue plan code test review staging production]
.
freeze
STAGES
=
%i[issue plan code test review staging production]
.
freeze
...
...
app/models/dashboard_milestone.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DashboardMilestone
<
GlobalMilestone
class
DashboardMilestone
<
GlobalMilestone
def
issues_finder_params
def
issues_finder_params
{
authorized_only:
true
}
{
authorized_only:
true
}
...
...
app/models/deploy_key.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DeployKey
<
Key
class
DeployKey
<
Key
include
IgnorableColumn
include
IgnorableColumn
...
...
app/models/deploy_keys_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DeployKeysProject
<
ActiveRecord
::
Base
class
DeployKeysProject
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
belongs_to
:deploy_key
,
inverse_of: :deploy_keys_projects
belongs_to
:deploy_key
,
inverse_of: :deploy_keys_projects
...
...
app/models/deploy_token.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DeployToken
<
ActiveRecord
::
Base
class
DeployToken
<
ActiveRecord
::
Base
include
Expirable
include
Expirable
include
TokenAuthenticatable
include
TokenAuthenticatable
...
...
app/models/deployment.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Deployment
<
ActiveRecord
::
Base
class
Deployment
<
ActiveRecord
::
Base
include
AtomicInternalId
include
AtomicInternalId
include
IidRoutes
include
IidRoutes
...
...
app/models/diff_discussion.rb
View file @
50abbd3e
# frozen_string_literal: true
# A discussion on merge request or commit diffs consisting of `DiffNote` notes.
# A discussion on merge request or commit diffs consisting of `DiffNote` notes.
#
#
# A discussion of this type can be resolvable.
# A discussion of this type can be resolvable.
...
...
app/models/diff_note.rb
View file @
50abbd3e
# frozen_string_literal: true
# A note on merge request or commit diffs
# A note on merge request or commit diffs
#
#
# A note of this type can be resolvable.
# A note of this type can be resolvable.
...
...
app/models/directly_addressed_user.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DirectlyAddressedUser
class
DirectlyAddressedUser
class
<<
self
class
<<
self
def
reference_pattern
def
reference_pattern
...
...
app/models/discussion.rb
View file @
50abbd3e
# frozen_string_literal: true
# A non-diff discussion on an issue, merge request, commit, or snippet, consisting of `DiscussionNote` notes.
# A non-diff discussion on an issue, merge request, commit, or snippet, consisting of `DiscussionNote` notes.
#
#
# A discussion of this type can be resolvable.
# A discussion of this type can be resolvable.
...
...
app/models/discussion_note.rb
View file @
50abbd3e
# frozen_string_literal: true
# A note in a non-diff discussion on an issue, merge request, commit, or snippet.
# A note in a non-diff discussion on an issue, merge request, commit, or snippet.
#
#
# A note of this type can be resolvable.
# A note of this type can be resolvable.
...
...
app/models/email.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Email
<
ActiveRecord
::
Base
class
Email
<
ActiveRecord
::
Base
include
Sortable
include
Sortable
include
Gitlab
::
SQL
::
Pattern
include
Gitlab
::
SQL
::
Pattern
...
...
app/models/environment.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Environment
<
ActiveRecord
::
Base
class
Environment
<
ActiveRecord
::
Base
# Used to generate random suffixes for the slug
# Used to generate random suffixes for the slug
LETTERS
=
'a'
..
'z'
LETTERS
=
'a'
..
'z'
...
@@ -173,7 +175,7 @@ class Environment < ActiveRecord::Base
...
@@ -173,7 +175,7 @@ class Environment < ActiveRecord::Base
# * cannot end with `-`
# * cannot end with `-`
def
generate_slug
def
generate_slug
# Lowercase letters and numbers only
# Lowercase letters and numbers only
slugified
=
name
.
to_s
.
downcase
.
gsub
(
/[^a-z0-9]/
,
'-'
)
slugified
=
+
name
.
to_s
.
downcase
.
gsub
(
/[^a-z0-9]/
,
'-'
)
# Must start with a letter
# Must start with a letter
slugified
=
'env-'
+
slugified
unless
LETTERS
.
cover?
(
slugified
[
0
])
slugified
=
'env-'
+
slugified
unless
LETTERS
.
cover?
(
slugified
[
0
])
...
...
app/models/epic.rb
View file @
50abbd3e
# frozen_string_literal: true
# Placeholder class for model that is implemented in EE
# Placeholder class for model that is implemented in EE
# It reserves '&' as a reference prefix, but the table does not exists in CE
# It reserves '&' as a reference prefix, but the table does not exists in CE
class
Epic
<
ActiveRecord
::
Base
class
Epic
<
ActiveRecord
::
Base
...
...
app/models/event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Event
<
ActiveRecord
::
Base
class
Event
<
ActiveRecord
::
Base
include
Sortable
include
Sortable
include
IgnorableColumn
include
IgnorableColumn
...
...
app/models/event_collection.rb
View file @
50abbd3e
# frozen_string_literal: true
# A collection of events to display in an event list.
# A collection of events to display in an event list.
#
#
# An EventCollection is meant to be used for displaying events to a user (e.g.
# An EventCollection is meant to be used for displaying events to a user (e.g.
...
...
app/models/external_issue.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ExternalIssue
class
ExternalIssue
include
Referable
include
Referable
...
...
app/models/fork_network.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ForkNetwork
<
ActiveRecord
::
Base
class
ForkNetwork
<
ActiveRecord
::
Base
belongs_to
:root_project
,
class_name:
'Project'
belongs_to
:root_project
,
class_name:
'Project'
has_many
:fork_network_members
has_many
:fork_network_members
...
...
app/models/fork_network_member.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ForkNetworkMember
<
ActiveRecord
::
Base
class
ForkNetworkMember
<
ActiveRecord
::
Base
belongs_to
:fork_network
belongs_to
:fork_network
belongs_to
:project
belongs_to
:project
...
...
app/models/forked_project_link.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ForkedProjectLink
<
ActiveRecord
::
Base
class
ForkedProjectLink
<
ActiveRecord
::
Base
belongs_to
:forked_to_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
belongs_to
:forked_to_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
belongs_to
:forked_from_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
belongs_to
:forked_from_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
...
...
app/models/generic_commit_status.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GenericCommitStatus
<
CommitStatus
class
GenericCommitStatus
<
CommitStatus
before_validation
:set_default_values
before_validation
:set_default_values
...
...
app/models/global_label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GlobalLabel
class
GlobalLabel
attr_accessor
:title
,
:labels
attr_accessor
:title
,
:labels
alias_attribute
:name
,
:title
alias_attribute
:name
,
:title
...
...
app/models/global_milestone.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GlobalMilestone
class
GlobalMilestone
include
Milestoneish
include
Milestoneish
...
...
app/models/gpg_key.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GpgKey
<
ActiveRecord
::
Base
class
GpgKey
<
ActiveRecord
::
Base
KEY_PREFIX
=
'-----BEGIN PGP PUBLIC KEY BLOCK-----'
.
freeze
KEY_PREFIX
=
'-----BEGIN PGP PUBLIC KEY BLOCK-----'
.
freeze
KEY_SUFFIX
=
'-----END PGP PUBLIC KEY BLOCK-----'
.
freeze
KEY_SUFFIX
=
'-----END PGP PUBLIC KEY BLOCK-----'
.
freeze
...
...
app/models/gpg_key_subkey.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GpgKeySubkey
<
ActiveRecord
::
Base
class
GpgKeySubkey
<
ActiveRecord
::
Base
include
ShaAttribute
include
ShaAttribute
...
...
app/models/gpg_signature.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GpgSignature
<
ActiveRecord
::
Base
class
GpgSignature
<
ActiveRecord
::
Base
include
ShaAttribute
include
ShaAttribute
...
...
app/models/group.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
require
'carrierwave/orm/activerecord'
class
Group
<
Namespace
class
Group
<
Namespace
...
...
app/models/group_custom_attribute.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GroupCustomAttribute
<
ActiveRecord
::
Base
class
GroupCustomAttribute
<
ActiveRecord
::
Base
belongs_to
:group
belongs_to
:group
...
...
app/models/group_label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GroupLabel
<
Label
class
GroupLabel
<
Label
belongs_to
:group
belongs_to
:group
...
...
app/models/group_milestone.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GroupMilestone
<
GlobalMilestone
class
GroupMilestone
<
GlobalMilestone
attr_accessor
:group
attr_accessor
:group
...
...
app/models/guest.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Guest
class
Guest
class
<<
self
class
<<
self
def
can?
(
action
,
subject
=
:global
)
def
can?
(
action
,
subject
=
:global
)
...
...
app/models/identity.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Identity
<
ActiveRecord
::
Base
class
Identity
<
ActiveRecord
::
Base
def
self
.
uniqueness_scope
def
self
.
uniqueness_scope
:provider
:provider
...
...
app/models/import_export_upload.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ImportExportUpload
<
ActiveRecord
::
Base
class
ImportExportUpload
<
ActiveRecord
::
Base
include
WithUploads
include
WithUploads
include
ObjectStorage
::
BackgroundMove
include
ObjectStorage
::
BackgroundMove
...
...
app/models/individual_note_discussion.rb
View file @
50abbd3e
# frozen_string_literal: true
# A discussion to wrap a single `Note` note on the root of an issue, merge request,
# A discussion to wrap a single `Note` note on the root of an issue, merge request,
# commit, or snippet, that is not displayed as a discussion.
# commit, or snippet, that is not displayed as a discussion.
#
#
...
...
app/models/instance_configuration.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'resolv'
require
'resolv'
class
InstanceConfiguration
class
InstanceConfiguration
...
...
app/models/internal_id.rb
View file @
50abbd3e
# frozen_string_literal: true
# An InternalId is a strictly monotone sequence of integers
# An InternalId is a strictly monotone sequence of integers
# generated for a given scope and usage.
# generated for a given scope and usage.
#
#
...
...
app/models/issue.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
require
'carrierwave/orm/activerecord'
class
Issue
<
ActiveRecord
::
Base
class
Issue
<
ActiveRecord
::
Base
...
...
app/models/issue_assignee.rb
View file @
50abbd3e
# frozen_string_literal: true
class
IssueAssignee
<
ActiveRecord
::
Base
class
IssueAssignee
<
ActiveRecord
::
Base
belongs_to
:issue
belongs_to
:issue
belongs_to
:assignee
,
class_name:
"User"
,
foreign_key: :user_id
belongs_to
:assignee
,
class_name:
"User"
,
foreign_key: :user_id
...
...
app/models/issue_collection.rb
View file @
50abbd3e
# frozen_string_literal: true
# IssueCollection can be used to reduce a list of issues down to a subset.
# IssueCollection can be used to reduce a list of issues down to a subset.
#
#
# IssueCollection is not meant to be some sort of Enumerable, instead it's meant
# IssueCollection is not meant to be some sort of Enumerable, instead it's meant
...
...
app/models/key.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'digest/md5'
require
'digest/md5'
class
Key
<
ActiveRecord
::
Base
class
Key
<
ActiveRecord
::
Base
...
...
app/models/label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Label
<
ActiveRecord
::
Base
class
Label
<
ActiveRecord
::
Base
include
CacheMarkdownField
include
CacheMarkdownField
include
Referable
include
Referable
...
...
app/models/label_link.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LabelLink
<
ActiveRecord
::
Base
class
LabelLink
<
ActiveRecord
::
Base
include
Importable
include
Importable
...
...
app/models/label_priority.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LabelPriority
<
ActiveRecord
::
Base
class
LabelPriority
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
belongs_to
:label
belongs_to
:label
...
...
app/models/legacy_diff_discussion.rb
View file @
50abbd3e
# frozen_string_literal: true
# A discussion on merge request or commit diffs consisting of `LegacyDiffNote` notes.
# A discussion on merge request or commit diffs consisting of `LegacyDiffNote` notes.
#
#
# All new diff discussions are of the type `DiffDiscussion`, but any diff discussions created
# All new diff discussions are of the type `DiffDiscussion`, but any diff discussions created
...
...
app/models/legacy_diff_note.rb
View file @
50abbd3e
# frozen_string_literal: true
# A note on merge request or commit diffs, using the legacy implementation.
# A note on merge request or commit diffs, using the legacy implementation.
#
#
# All new diff notes are of the type `DiffNote`, but any diff notes created
# All new diff notes are of the type `DiffNote`, but any diff notes created
...
...
app/models/lfs_file_lock.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LfsFileLock
<
ActiveRecord
::
Base
class
LfsFileLock
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
belongs_to
:user
belongs_to
:user
...
...
app/models/lfs_object.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LfsObject
<
ActiveRecord
::
Base
class
LfsObject
<
ActiveRecord
::
Base
include
AfterCommitQueue
include
AfterCommitQueue
include
ObjectStorage
::
BackgroundMove
include
ObjectStorage
::
BackgroundMove
...
...
app/models/lfs_objects_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LfsObjectsProject
<
ActiveRecord
::
Base
class
LfsObjectsProject
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
belongs_to
:lfs_object
belongs_to
:lfs_object
...
...
app/models/list.rb
View file @
50abbd3e
# frozen_string_literal: true
class
List
<
ActiveRecord
::
Base
class
List
<
ActiveRecord
::
Base
belongs_to
:board
belongs_to
:board
belongs_to
:label
belongs_to
:label
...
...
app/models/member.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Member
<
ActiveRecord
::
Base
class
Member
<
ActiveRecord
::
Base
include
AfterCommitQueue
include
AfterCommitQueue
include
Sortable
include
Sortable
...
...
app/models/merge_request.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequest
<
ActiveRecord
::
Base
class
MergeRequest
<
ActiveRecord
::
Base
include
AtomicInternalId
include
AtomicInternalId
include
IidRoutes
include
IidRoutes
...
...
app/models/merge_request_diff.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestDiff
<
ActiveRecord
::
Base
class
MergeRequestDiff
<
ActiveRecord
::
Base
include
Sortable
include
Sortable
include
Importable
include
Importable
...
...
app/models/merge_request_diff_commit.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestDiffCommit
<
ActiveRecord
::
Base
class
MergeRequestDiffCommit
<
ActiveRecord
::
Base
include
ShaAttribute
include
ShaAttribute
...
...
app/models/merge_request_diff_file.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestDiffFile
<
ActiveRecord
::
Base
class
MergeRequestDiffFile
<
ActiveRecord
::
Base
include
Gitlab
::
EncodingHelper
include
Gitlab
::
EncodingHelper
include
DiffFile
include
DiffFile
...
...
app/models/merge_requests_closing_issues.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestsClosingIssues
<
ActiveRecord
::
Base
class
MergeRequestsClosingIssues
<
ActiveRecord
::
Base
belongs_to
:merge_request
belongs_to
:merge_request
belongs_to
:issue
belongs_to
:issue
...
...
app/models/milestone.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Milestone
<
ActiveRecord
::
Base
class
Milestone
<
ActiveRecord
::
Base
# Represents a "No Milestone" state used for filtering Issues and Merge
# Represents a "No Milestone" state used for filtering Issues and Merge
# Requests that have no milestone assigned.
# Requests that have no milestone assigned.
...
...
app/models/namespace.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Namespace
<
ActiveRecord
::
Base
class
Namespace
<
ActiveRecord
::
Base
include
CacheMarkdownField
include
CacheMarkdownField
include
Sortable
include
Sortable
...
...
app/models/note.rb
View file @
50abbd3e
# frozen_string_literal: true
# A note on the root of an issue, merge request, commit, or snippet.
# A note on the root of an issue, merge request, commit, or snippet.
#
#
# A note of this type is never resolvable.
# A note of this type is never resolvable.
...
...
app/models/note_diff_file.rb
View file @
50abbd3e
# frozen_string_literal: true
class
NoteDiffFile
<
ActiveRecord
::
Base
class
NoteDiffFile
<
ActiveRecord
::
Base
include
DiffFile
include
DiffFile
...
...
app/models/notification_reason.rb
View file @
50abbd3e
# frozen_string_literal: true
# Holds reasons for a notification to have been sent as well as a priority list to select which reason to use
# Holds reasons for a notification to have been sent as well as a priority list to select which reason to use
# above the rest
# above the rest
class
NotificationReason
class
NotificationReason
...
...
app/models/notification_recipient.rb
View file @
50abbd3e
# frozen_string_literal: true
class
NotificationRecipient
class
NotificationRecipient
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
...
...
app/models/notification_setting.rb
View file @
50abbd3e
# frozen_string_literal: true
class
NotificationSetting
<
ActiveRecord
::
Base
class
NotificationSetting
<
ActiveRecord
::
Base
include
IgnorableColumn
include
IgnorableColumn
...
...
app/models/oauth_access_grant.rb
View file @
50abbd3e
# frozen_string_literal: true
class
OauthAccessGrant
<
Doorkeeper
::
AccessGrant
class
OauthAccessGrant
<
Doorkeeper
::
AccessGrant
belongs_to
:resource_owner
,
class_name:
'User'
belongs_to
:resource_owner
,
class_name:
'User'
belongs_to
:application
,
class_name:
'Doorkeeper::Application'
belongs_to
:application
,
class_name:
'Doorkeeper::Application'
...
...
app/models/oauth_access_token.rb
View file @
50abbd3e
# frozen_string_literal: true
class
OauthAccessToken
<
Doorkeeper
::
AccessToken
class
OauthAccessToken
<
Doorkeeper
::
AccessToken
belongs_to
:resource_owner
,
class_name:
'User'
belongs_to
:resource_owner
,
class_name:
'User'
belongs_to
:application
,
class_name:
'Doorkeeper::Application'
belongs_to
:application
,
class_name:
'Doorkeeper::Application'
...
...
app/models/out_of_context_discussion.rb
View file @
50abbd3e
# frozen_string_literal: true
# When notes on a commit are displayed in the context of a merge request that
# When notes on a commit are displayed in the context of a merge request that
# contains that commit, they are displayed as if they were a discussion.
# contains that commit, they are displayed as if they were a discussion.
#
#
...
...
app/models/pages_domain.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PagesDomain
<
ActiveRecord
::
Base
class
PagesDomain
<
ActiveRecord
::
Base
VERIFICATION_KEY
=
'gitlab-pages-verification-code'
.
freeze
VERIFICATION_KEY
=
'gitlab-pages-verification-code'
.
freeze
VERIFICATION_THRESHOLD
=
3
.
days
.
freeze
VERIFICATION_THRESHOLD
=
3
.
days
.
freeze
...
...
app/models/personal_access_token.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PersonalAccessToken
<
ActiveRecord
::
Base
class
PersonalAccessToken
<
ActiveRecord
::
Base
include
Expirable
include
Expirable
include
TokenAuthenticatable
include
TokenAuthenticatable
...
...
app/models/personal_snippet.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PersonalSnippet
<
Snippet
class
PersonalSnippet
<
Snippet
include
WithUploads
include
WithUploads
end
end
app/models/project.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
require
'carrierwave/orm/activerecord'
class
Project
<
ActiveRecord
::
Base
class
Project
<
ActiveRecord
::
Base
...
...
app/models/project_authorization.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectAuthorization
<
ActiveRecord
::
Base
class
ProjectAuthorization
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
belongs_to
:project
belongs_to
:project
...
...
app/models/project_auto_devops.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectAutoDevops
<
ActiveRecord
::
Base
class
ProjectAutoDevops
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
...
...
app/models/project_ci_cd_setting.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectCiCdSetting
<
ActiveRecord
::
Base
class
ProjectCiCdSetting
<
ActiveRecord
::
Base
belongs_to
:project
,
inverse_of: :ci_cd_settings
belongs_to
:project
,
inverse_of: :ci_cd_settings
...
...
app/models/project_custom_attribute.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectCustomAttribute
<
ActiveRecord
::
Base
class
ProjectCustomAttribute
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
...
...
app/models/project_deploy_token.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectDeployToken
<
ActiveRecord
::
Base
class
ProjectDeployToken
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
belongs_to
:deploy_token
,
inverse_of: :project_deploy_tokens
belongs_to
:deploy_token
,
inverse_of: :project_deploy_tokens
...
...
app/models/project_feature.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectFeature
<
ActiveRecord
::
Base
class
ProjectFeature
<
ActiveRecord
::
Base
# == Project features permissions
# == Project features permissions
#
#
...
...
app/models/project_group_link.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectGroupLink
<
ActiveRecord
::
Base
class
ProjectGroupLink
<
ActiveRecord
::
Base
include
Expirable
include
Expirable
...
...
app/models/project_import_data.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
require
'carrierwave/orm/activerecord'
class
ProjectImportData
<
ActiveRecord
::
Base
class
ProjectImportData
<
ActiveRecord
::
Base
...
...
app/models/project_import_state.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectImportState
<
ActiveRecord
::
Base
class
ProjectImportState
<
ActiveRecord
::
Base
include
AfterCommitQueue
include
AfterCommitQueue
...
...
app/models/project_label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectLabel
<
Label
class
ProjectLabel
<
Label
MAX_NUMBER_OF_PRIORITIES
=
1
MAX_NUMBER_OF_PRIORITIES
=
1
...
...
app/models/project_snippet.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectSnippet
<
Snippet
class
ProjectSnippet
<
Snippet
belongs_to
:project
belongs_to
:project
belongs_to
:author
,
class_name:
"User"
belongs_to
:author
,
class_name:
"User"
...
...
app/models/project_statistics.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectStatistics
<
ActiveRecord
::
Base
class
ProjectStatistics
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
belongs_to
:namespace
belongs_to
:namespace
...
...
app/models/project_team.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectTeam
class
ProjectTeam
include
BulkMemberAccessLoad
include
BulkMemberAccessLoad
...
...
app/models/protectable_dropdown.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectableDropdown
class
ProtectableDropdown
REF_TYPES
=
%i[branches tags]
.
freeze
REF_TYPES
=
%i[branches tags]
.
freeze
...
...
app/models/protected_branch.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectedBranch
<
ActiveRecord
::
Base
class
ProtectedBranch
<
ActiveRecord
::
Base
include
Gitlab
::
ShellAdapter
include
Gitlab
::
ShellAdapter
include
ProtectedRef
include
ProtectedRef
...
...
app/models/protected_ref_matcher.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectedRefMatcher
class
ProtectedRefMatcher
def
initialize
(
protected_ref
)
def
initialize
(
protected_ref
)
@protected_ref
=
protected_ref
@protected_ref
=
protected_ref
...
...
app/models/protected_tag.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectedTag
<
ActiveRecord
::
Base
class
ProtectedTag
<
ActiveRecord
::
Base
include
Gitlab
::
ShellAdapter
include
Gitlab
::
ShellAdapter
include
ProtectedRef
include
ProtectedRef
...
...
app/models/push_event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PushEvent
<
Event
class
PushEvent
<
Event
# This validation exists so we can't accidentally use PushEvent with a
# This validation exists so we can't accidentally use PushEvent with a
# different "action" value.
# different "action" value.
...
...
app/models/push_event_payload.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PushEventPayload
<
ActiveRecord
::
Base
class
PushEventPayload
<
ActiveRecord
::
Base
include
ShaAttribute
include
ShaAttribute
...
...
app/models/readme_blob.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ReadmeBlob
<
SimpleDelegator
class
ReadmeBlob
<
SimpleDelegator
attr_reader
:repository
attr_reader
:repository
...
...
app/models/redirect_route.rb
View file @
50abbd3e
# frozen_string_literal: true
class
RedirectRoute
<
ActiveRecord
::
Base
class
RedirectRoute
<
ActiveRecord
::
Base
belongs_to
:source
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
belongs_to
:source
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/release.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Release
<
ActiveRecord
::
Base
class
Release
<
ActiveRecord
::
Base
include
CacheMarkdownField
include
CacheMarkdownField
...
...
app/models/remote_mirror.rb
View file @
50abbd3e
# frozen_string_literal: true
class
RemoteMirror
<
ActiveRecord
::
Base
class
RemoteMirror
<
ActiveRecord
::
Base
include
AfterCommitQueue
include
AfterCommitQueue
...
...
app/models/repository.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'securerandom'
require
'securerandom'
class
Repository
class
Repository
...
...
app/models/route.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Route
<
ActiveRecord
::
Base
class
Route
<
ActiveRecord
::
Base
include
CaseSensitivity
include
CaseSensitivity
...
...
app/models/security_event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SecurityEvent
<
AuditEvent
class
SecurityEvent
<
AuditEvent
end
end
app/models/sent_notification.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SentNotification
<
ActiveRecord
::
Base
class
SentNotification
<
ActiveRecord
::
Base
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/ActiveRecordSerialize
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/ActiveRecordSerialize
...
...
app/models/service.rb
View file @
50abbd3e
# frozen_string_literal: true
# To add new service you should build a class inherited from Service
# To add new service you should build a class inherited from Service
# and implement a set of methods
# and implement a set of methods
class
Service
<
ActiveRecord
::
Base
class
Service
<
ActiveRecord
::
Base
...
...
app/models/snippet.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Snippet
<
ActiveRecord
::
Base
class
Snippet
<
ActiveRecord
::
Base
include
Gitlab
::
VisibilityLevel
include
Gitlab
::
VisibilityLevel
include
CacheMarkdownField
include
CacheMarkdownField
...
...
app/models/snippet_blob.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SnippetBlob
class
SnippetBlob
include
BlobLike
include
BlobLike
...
...
app/models/spam_log.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SpamLog
<
ActiveRecord
::
Base
class
SpamLog
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
...
...
app/models/subscription.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Subscription
<
ActiveRecord
::
Base
class
Subscription
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
belongs_to
:project
belongs_to
:project
...
...
app/models/system_note_metadata.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SystemNoteMetadata
<
ActiveRecord
::
Base
class
SystemNoteMetadata
<
ActiveRecord
::
Base
# These notes's action text might contain a reference that is external.
# These notes's action text might contain a reference that is external.
# We should always force a deep validation upon references that are found
# We should always force a deep validation upon references that are found
...
...
app/models/term_agreement.rb
View file @
50abbd3e
# frozen_string_literal: true
class
TermAgreement
<
ActiveRecord
::
Base
class
TermAgreement
<
ActiveRecord
::
Base
belongs_to
:term
,
class_name:
'ApplicationSetting::Term'
belongs_to
:term
,
class_name:
'ApplicationSetting::Term'
belongs_to
:user
belongs_to
:user
...
...
app/models/timelog.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Timelog
<
ActiveRecord
::
Base
class
Timelog
<
ActiveRecord
::
Base
validates
:time_spent
,
:user
,
presence:
true
validates
:time_spent
,
:user
,
presence:
true
validate
:issuable_id_is_present
validate
:issuable_id_is_present
...
...
app/models/todo.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Todo
<
ActiveRecord
::
Base
class
Todo
<
ActiveRecord
::
Base
include
Sortable
include
Sortable
...
...
app/models/tree.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Tree
class
Tree
include
Gitlab
::
MarkupHelper
include
Gitlab
::
MarkupHelper
...
...
app/models/trending_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
TrendingProject
<
ActiveRecord
::
Base
class
TrendingProject
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
...
...
app/models/u2f_registration.rb
View file @
50abbd3e
# frozen_string_literal: true
# Registration information for U2F (universal 2nd factor) devices, like Yubikeys
# Registration information for U2F (universal 2nd factor) devices, like Yubikeys
class
U2fRegistration
<
ActiveRecord
::
Base
class
U2fRegistration
<
ActiveRecord
::
Base
...
...
app/models/upload.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Upload
<
ActiveRecord
::
Base
class
Upload
<
ActiveRecord
::
Base
# Upper limit for foreground checksum processing
# Upper limit for foreground checksum processing
CHECKSUM_THRESHOLD
=
100
.
megabytes
CHECKSUM_THRESHOLD
=
100
.
megabytes
...
...
app/models/user.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
require
'carrierwave/orm/activerecord'
class
User
<
ActiveRecord
::
Base
class
User
<
ActiveRecord
::
Base
...
...
app/models/user_agent_detail.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserAgentDetail
<
ActiveRecord
::
Base
class
UserAgentDetail
<
ActiveRecord
::
Base
belongs_to
:subject
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
belongs_to
:subject
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/user_callout.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserCallout
<
ActiveRecord
::
Base
class
UserCallout
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
...
...
app/models/user_custom_attribute.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserCustomAttribute
<
ActiveRecord
::
Base
class
UserCustomAttribute
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
...
...
app/models/user_interacted_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserInteractedProject
<
ActiveRecord
::
Base
class
UserInteractedProject
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
belongs_to
:project
belongs_to
:project
...
...
app/models/user_synced_attributes_metadata.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserSyncedAttributesMetadata
<
ActiveRecord
::
Base
class
UserSyncedAttributesMetadata
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:user
...
...
app/models/users_star_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UsersStarProject
<
ActiveRecord
::
Base
class
UsersStarProject
<
ActiveRecord
::
Base
belongs_to
:project
,
counter_cache: :star_count
,
touch:
true
belongs_to
:project
,
counter_cache: :star_count
,
touch:
true
belongs_to
:user
belongs_to
:user
...
...
app/models/wiki_directory.rb
View file @
50abbd3e
# frozen_string_literal: true
class
WikiDirectory
class
WikiDirectory
include
ActiveModel
::
Validations
include
ActiveModel
::
Validations
...
...
app/models/wiki_page.rb
View file @
50abbd3e
# frozen_string_literal: true
# rubocop:disable Rails/ActiveRecordAliases
# rubocop:disable Rails/ActiveRecordAliases
class
WikiPage
class
WikiPage
PageChangedError
=
Class
.
new
(
StandardError
)
PageChangedError
=
Class
.
new
(
StandardError
)
...
...
changelogs/unreleased/frozen-string-enable-app-models.yml
0 → 100644
View file @
50abbd3e
---
title
:
Enable frozen string in app/models/*.rb
merge_request
:
20851
author
:
gfyoung
type
:
performance
spec/controllers/admin/services_controller_spec.rb
View file @
50abbd3e
...
@@ -13,7 +13,7 @@ describe Admin::ServicesController do
...
@@ -13,7 +13,7 @@ describe Admin::ServicesController do
Service
.
available_services_names
.
each
do
|
service_name
|
Service
.
available_services_names
.
each
do
|
service_name
|
context
"
#{
service_name
}
"
do
context
"
#{
service_name
}
"
do
let!
(
:service
)
do
let!
(
:service
)
do
service_template
=
service_name
.
concat
(
"_service"
)
.
camelize
.
constantize
service_template
=
"
#{
service_name
}
_service"
.
camelize
.
constantize
service_template
.
where
(
template:
true
).
first_or_create
service_template
.
where
(
template:
true
).
first_or_create
end
end
...
...
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