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
0
Merge Requests
0
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
Boxiang Sun
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
Hide 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
include
ServiceParams
...
...
@@ -30,7 +32,7 @@ class Admin::ServicesController < Admin::ApplicationController
def
services_templates
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
end
end
...
...
app/models/ability.rb
View file @
50abbd3e
# frozen_string_literal: true
require_dependency
'declarative_policy'
class
Ability
...
...
app/models/abuse_report.rb
View file @
50abbd3e
# frozen_string_literal: true
class
AbuseReport
<
ActiveRecord
::
Base
include
CacheMarkdownField
...
...
app/models/active_session.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ActiveSession
include
ActiveModel
::
Model
...
...
app/models/appearance.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Appearance
<
ActiveRecord
::
Base
include
CacheableAttributes
include
CacheMarkdownField
...
...
app/models/application_setting.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ApplicationSetting
<
ActiveRecord
::
Base
include
CacheableAttributes
include
CacheMarkdownField
...
...
app/models/audit_event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
AuditEvent
<
ActiveRecord
::
Base
serialize
:details
,
Hash
# rubocop:disable Cop/ActiveRecordSerialize
...
...
app/models/award_emoji.rb
View file @
50abbd3e
# frozen_string_literal: true
class
AwardEmoji
<
ActiveRecord
::
Base
DOWNVOTE_NAME
=
"thumbsdown"
.
freeze
UPVOTE_NAME
=
"thumbsup"
.
freeze
...
...
app/models/badge.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Badge
<
ActiveRecord
::
Base
# This structure sets the placeholders that the urls
# 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
class
Blob
<
SimpleDelegator
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
belongs_to
:group
belongs_to
:project
...
...
app/models/broadcast_message.rb
View file @
50abbd3e
# frozen_string_literal: true
class
BroadcastMessage
<
ActiveRecord
::
Base
include
CacheMarkdownField
include
Sortable
...
...
app/models/chat_name.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ChatName
<
ActiveRecord
::
Base
LAST_USED_AT_INTERVAL
=
1
.
hour
...
...
app/models/chat_team.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ChatTeam
<
ActiveRecord
::
Base
validates
:team_id
,
presence:
true
validates
:namespace
,
uniqueness:
true
...
...
app/models/commit.rb
View file @
50abbd3e
# coding: utf-8
# frozen_string_literal: true
class
Commit
extend
ActiveModel
::
Naming
extend
Gitlab
::
Cache
::
RequestCache
...
...
@@ -339,21 +341,21 @@ class Commit
end
def
cherry_pick_description
(
user
)
message_body
=
"(cherry picked from commit
#{
sha
}
)"
message_body
=
[
"(cherry picked from commit
#{
sha
}
)"
]
if
merged_merge_request?
(
user
)
commits_in_merge_request
=
merged_merge_request
(
user
).
commits
if
commits_in_merge_request
.
present?
message_body
<<
"
\n
"
message_body
<<
""
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
message_body
message_body
.
join
(
"
\n
"
)
end
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
#
# Examples:
...
...
app/models/commit_status.rb
View file @
50abbd3e
# frozen_string_literal: true
class
CommitStatus
<
ActiveRecord
::
Base
include
HasStatus
include
Importable
...
...
app/models/compare.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Compare
include
Gitlab
::
Utils
::
StrongMemoize
...
...
app/models/container_repository.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ContainerRepository
<
ActiveRecord
::
Base
belongs_to
:project
...
...
app/models/cycle_analytics.rb
View file @
50abbd3e
# frozen_string_literal: true
class
CycleAnalytics
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
def
issues_finder_params
{
authorized_only:
true
}
...
...
app/models/deploy_key.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DeployKey
<
Key
include
IgnorableColumn
...
...
app/models/deploy_keys_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DeployKeysProject
<
ActiveRecord
::
Base
belongs_to
:project
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
include
Expirable
include
TokenAuthenticatable
...
...
app/models/deployment.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Deployment
<
ActiveRecord
::
Base
include
AtomicInternalId
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 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 of this type can be resolvable.
...
...
app/models/directly_addressed_user.rb
View file @
50abbd3e
# frozen_string_literal: true
class
DirectlyAddressedUser
class
<<
self
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 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 of this type can be resolvable.
...
...
app/models/email.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Email
<
ActiveRecord
::
Base
include
Sortable
include
Gitlab
::
SQL
::
Pattern
...
...
app/models/environment.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Environment
<
ActiveRecord
::
Base
# Used to generate random suffixes for the slug
LETTERS
=
'a'
..
'z'
...
...
@@ -173,7 +175,7 @@ class Environment < ActiveRecord::Base
# * cannot end with `-`
def
generate_slug
# 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
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
# It reserves '&' as a reference prefix, but the table does not exists in CE
class
Epic
<
ActiveRecord
::
Base
...
...
app/models/event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Event
<
ActiveRecord
::
Base
include
Sortable
include
IgnorableColumn
...
...
app/models/event_collection.rb
View file @
50abbd3e
# frozen_string_literal: true
# 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.
...
...
app/models/external_issue.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ExternalIssue
include
Referable
...
...
app/models/fork_network.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ForkNetwork
<
ActiveRecord
::
Base
belongs_to
:root_project
,
class_name:
'Project'
has_many
:fork_network_members
...
...
app/models/fork_network_member.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ForkNetworkMember
<
ActiveRecord
::
Base
belongs_to
:fork_network
belongs_to
:project
...
...
app/models/forked_project_link.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ForkedProjectLink
<
ActiveRecord
::
Base
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'
...
...
app/models/generic_commit_status.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GenericCommitStatus
<
CommitStatus
before_validation
:set_default_values
...
...
app/models/global_label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GlobalLabel
attr_accessor
:title
,
:labels
alias_attribute
:name
,
:title
...
...
app/models/global_milestone.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GlobalMilestone
include
Milestoneish
...
...
app/models/gpg_key.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GpgKey
<
ActiveRecord
::
Base
KEY_PREFIX
=
'-----BEGIN 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
include
ShaAttribute
...
...
app/models/gpg_signature.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GpgSignature
<
ActiveRecord
::
Base
include
ShaAttribute
...
...
app/models/group.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
class
Group
<
Namespace
...
...
app/models/group_custom_attribute.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GroupCustomAttribute
<
ActiveRecord
::
Base
belongs_to
:group
...
...
app/models/group_label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GroupLabel
<
Label
belongs_to
:group
...
...
app/models/group_milestone.rb
View file @
50abbd3e
# frozen_string_literal: true
class
GroupMilestone
<
GlobalMilestone
attr_accessor
:group
...
...
app/models/guest.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Guest
class
<<
self
def
can?
(
action
,
subject
=
:global
)
...
...
app/models/identity.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Identity
<
ActiveRecord
::
Base
def
self
.
uniqueness_scope
:provider
...
...
app/models/import_export_upload.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ImportExportUpload
<
ActiveRecord
::
Base
include
WithUploads
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,
# commit, or snippet, that is not displayed as a discussion.
#
...
...
app/models/instance_configuration.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'resolv'
class
InstanceConfiguration
...
...
app/models/internal_id.rb
View file @
50abbd3e
# frozen_string_literal: true
# An InternalId is a strictly monotone sequence of integers
# generated for a given scope and usage.
#
...
...
app/models/issue.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
class
Issue
<
ActiveRecord
::
Base
...
...
app/models/issue_assignee.rb
View file @
50abbd3e
# frozen_string_literal: true
class
IssueAssignee
<
ActiveRecord
::
Base
belongs_to
:issue
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 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'
class
Key
<
ActiveRecord
::
Base
...
...
app/models/label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Label
<
ActiveRecord
::
Base
include
CacheMarkdownField
include
Referable
...
...
app/models/label_link.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LabelLink
<
ActiveRecord
::
Base
include
Importable
...
...
app/models/label_priority.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LabelPriority
<
ActiveRecord
::
Base
belongs_to
:project
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.
#
# 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.
#
# 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
belongs_to
:project
belongs_to
:user
...
...
app/models/lfs_object.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LfsObject
<
ActiveRecord
::
Base
include
AfterCommitQueue
include
ObjectStorage
::
BackgroundMove
...
...
app/models/lfs_objects_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
LfsObjectsProject
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:lfs_object
...
...
app/models/list.rb
View file @
50abbd3e
# frozen_string_literal: true
class
List
<
ActiveRecord
::
Base
belongs_to
:board
belongs_to
:label
...
...
app/models/member.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Member
<
ActiveRecord
::
Base
include
AfterCommitQueue
include
Sortable
...
...
app/models/merge_request.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequest
<
ActiveRecord
::
Base
include
AtomicInternalId
include
IidRoutes
...
...
app/models/merge_request_diff.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestDiff
<
ActiveRecord
::
Base
include
Sortable
include
Importable
...
...
app/models/merge_request_diff_commit.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestDiffCommit
<
ActiveRecord
::
Base
include
ShaAttribute
...
...
app/models/merge_request_diff_file.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestDiffFile
<
ActiveRecord
::
Base
include
Gitlab
::
EncodingHelper
include
DiffFile
...
...
app/models/merge_requests_closing_issues.rb
View file @
50abbd3e
# frozen_string_literal: true
class
MergeRequestsClosingIssues
<
ActiveRecord
::
Base
belongs_to
:merge_request
belongs_to
:issue
...
...
app/models/milestone.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Milestone
<
ActiveRecord
::
Base
# Represents a "No Milestone" state used for filtering Issues and Merge
# Requests that have no milestone assigned.
...
...
app/models/namespace.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Namespace
<
ActiveRecord
::
Base
include
CacheMarkdownField
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 of this type is never resolvable.
...
...
app/models/note_diff_file.rb
View file @
50abbd3e
# frozen_string_literal: true
class
NoteDiffFile
<
ActiveRecord
::
Base
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
# above the rest
class
NotificationReason
...
...
app/models/notification_recipient.rb
View file @
50abbd3e
# frozen_string_literal: true
class
NotificationRecipient
include
Gitlab
::
Utils
::
StrongMemoize
...
...
app/models/notification_setting.rb
View file @
50abbd3e
# frozen_string_literal: true
class
NotificationSetting
<
ActiveRecord
::
Base
include
IgnorableColumn
...
...
app/models/oauth_access_grant.rb
View file @
50abbd3e
# frozen_string_literal: true
class
OauthAccessGrant
<
Doorkeeper
::
AccessGrant
belongs_to
:resource_owner
,
class_name:
'User'
belongs_to
:application
,
class_name:
'Doorkeeper::Application'
...
...
app/models/oauth_access_token.rb
View file @
50abbd3e
# frozen_string_literal: true
class
OauthAccessToken
<
Doorkeeper
::
AccessToken
belongs_to
:resource_owner
,
class_name:
'User'
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
# 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
VERIFICATION_KEY
=
'gitlab-pages-verification-code'
.
freeze
VERIFICATION_THRESHOLD
=
3
.
days
.
freeze
...
...
app/models/personal_access_token.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PersonalAccessToken
<
ActiveRecord
::
Base
include
Expirable
include
TokenAuthenticatable
...
...
app/models/personal_snippet.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PersonalSnippet
<
Snippet
include
WithUploads
end
app/models/project.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
class
Project
<
ActiveRecord
::
Base
...
...
app/models/project_authorization.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectAuthorization
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:project
...
...
app/models/project_auto_devops.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectAutoDevops
<
ActiveRecord
::
Base
belongs_to
:project
...
...
app/models/project_ci_cd_setting.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectCiCdSetting
<
ActiveRecord
::
Base
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
belongs_to
:project
...
...
app/models/project_deploy_token.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectDeployToken
<
ActiveRecord
::
Base
belongs_to
:project
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
# == Project features permissions
#
...
...
app/models/project_group_link.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectGroupLink
<
ActiveRecord
::
Base
include
Expirable
...
...
app/models/project_import_data.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
class
ProjectImportData
<
ActiveRecord
::
Base
...
...
app/models/project_import_state.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectImportState
<
ActiveRecord
::
Base
include
AfterCommitQueue
...
...
app/models/project_label.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectLabel
<
Label
MAX_NUMBER_OF_PRIORITIES
=
1
...
...
app/models/project_snippet.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectSnippet
<
Snippet
belongs_to
:project
belongs_to
:author
,
class_name:
"User"
...
...
app/models/project_statistics.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectStatistics
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:namespace
...
...
app/models/project_team.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProjectTeam
include
BulkMemberAccessLoad
...
...
app/models/protectable_dropdown.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectableDropdown
REF_TYPES
=
%i[branches tags]
.
freeze
...
...
app/models/protected_branch.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectedBranch
<
ActiveRecord
::
Base
include
Gitlab
::
ShellAdapter
include
ProtectedRef
...
...
app/models/protected_ref_matcher.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectedRefMatcher
def
initialize
(
protected_ref
)
@protected_ref
=
protected_ref
...
...
app/models/protected_tag.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ProtectedTag
<
ActiveRecord
::
Base
include
Gitlab
::
ShellAdapter
include
ProtectedRef
...
...
app/models/push_event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PushEvent
<
Event
# This validation exists so we can't accidentally use PushEvent with a
# different "action" value.
...
...
app/models/push_event_payload.rb
View file @
50abbd3e
# frozen_string_literal: true
class
PushEventPayload
<
ActiveRecord
::
Base
include
ShaAttribute
...
...
app/models/readme_blob.rb
View file @
50abbd3e
# frozen_string_literal: true
class
ReadmeBlob
<
SimpleDelegator
attr_reader
:repository
...
...
app/models/redirect_route.rb
View file @
50abbd3e
# frozen_string_literal: true
class
RedirectRoute
<
ActiveRecord
::
Base
belongs_to
:source
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/release.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Release
<
ActiveRecord
::
Base
include
CacheMarkdownField
...
...
app/models/remote_mirror.rb
View file @
50abbd3e
# frozen_string_literal: true
class
RemoteMirror
<
ActiveRecord
::
Base
include
AfterCommitQueue
...
...
app/models/repository.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'securerandom'
class
Repository
...
...
app/models/route.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Route
<
ActiveRecord
::
Base
include
CaseSensitivity
...
...
app/models/security_event.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SecurityEvent
<
AuditEvent
end
app/models/sent_notification.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SentNotification
<
ActiveRecord
::
Base
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
# and implement a set of methods
class
Service
<
ActiveRecord
::
Base
...
...
app/models/snippet.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Snippet
<
ActiveRecord
::
Base
include
Gitlab
::
VisibilityLevel
include
CacheMarkdownField
...
...
app/models/snippet_blob.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SnippetBlob
include
BlobLike
...
...
app/models/spam_log.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SpamLog
<
ActiveRecord
::
Base
belongs_to
:user
...
...
app/models/subscription.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Subscription
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:project
...
...
app/models/system_note_metadata.rb
View file @
50abbd3e
# frozen_string_literal: true
class
SystemNoteMetadata
<
ActiveRecord
::
Base
# These notes's action text might contain a reference that is external.
# 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
belongs_to
:term
,
class_name:
'ApplicationSetting::Term'
belongs_to
:user
...
...
app/models/timelog.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Timelog
<
ActiveRecord
::
Base
validates
:time_spent
,
:user
,
presence:
true
validate
:issuable_id_is_present
...
...
app/models/todo.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Todo
<
ActiveRecord
::
Base
include
Sortable
...
...
app/models/tree.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Tree
include
Gitlab
::
MarkupHelper
...
...
app/models/trending_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
TrendingProject
<
ActiveRecord
::
Base
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
class
U2fRegistration
<
ActiveRecord
::
Base
...
...
app/models/upload.rb
View file @
50abbd3e
# frozen_string_literal: true
class
Upload
<
ActiveRecord
::
Base
# Upper limit for foreground checksum processing
CHECKSUM_THRESHOLD
=
100
.
megabytes
...
...
app/models/user.rb
View file @
50abbd3e
# frozen_string_literal: true
require
'carrierwave/orm/activerecord'
class
User
<
ActiveRecord
::
Base
...
...
app/models/user_agent_detail.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserAgentDetail
<
ActiveRecord
::
Base
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
belongs_to
:user
...
...
app/models/user_custom_attribute.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserCustomAttribute
<
ActiveRecord
::
Base
belongs_to
:user
...
...
app/models/user_interacted_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserInteractedProject
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:project
...
...
app/models/user_synced_attributes_metadata.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UserSyncedAttributesMetadata
<
ActiveRecord
::
Base
belongs_to
:user
...
...
app/models/users_star_project.rb
View file @
50abbd3e
# frozen_string_literal: true
class
UsersStarProject
<
ActiveRecord
::
Base
belongs_to
:project
,
counter_cache: :star_count
,
touch:
true
belongs_to
:user
...
...
app/models/wiki_directory.rb
View file @
50abbd3e
# frozen_string_literal: true
class
WikiDirectory
include
ActiveModel
::
Validations
...
...
app/models/wiki_page.rb
View file @
50abbd3e
# frozen_string_literal: true
# rubocop:disable Rails/ActiveRecordAliases
class
WikiPage
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
Service
.
available_services_names
.
each
do
|
service_name
|
context
"
#{
service_name
}
"
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
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