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
013f7cd2
Commit
013f7cd2
authored
Mar 28, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inherit from ApplicationRecord instead of ActiveRecord::Base
parent
a74c3e6c
Changes
149
Hide whitespace changes
Inline
Side-by-side
Showing
149 changed files
with
150 additions
and
150 deletions
+150
-150
app/models/abuse_report.rb
app/models/abuse_report.rb
+1
-1
app/models/appearance.rb
app/models/appearance.rb
+1
-1
app/models/application_setting.rb
app/models/application_setting.rb
+1
-1
app/models/application_setting/term.rb
app/models/application_setting/term.rb
+1
-1
app/models/audit_event.rb
app/models/audit_event.rb
+1
-1
app/models/award_emoji.rb
app/models/award_emoji.rb
+1
-1
app/models/badge.rb
app/models/badge.rb
+1
-1
app/models/board.rb
app/models/board.rb
+1
-1
app/models/board_group_recent_visit.rb
app/models/board_group_recent_visit.rb
+1
-1
app/models/board_project_recent_visit.rb
app/models/board_project_recent_visit.rb
+1
-1
app/models/broadcast_message.rb
app/models/broadcast_message.rb
+1
-1
app/models/chat_name.rb
app/models/chat_name.rb
+1
-1
app/models/chat_team.rb
app/models/chat_team.rb
+1
-1
app/models/ci/build_metadata.rb
app/models/ci/build_metadata.rb
+1
-1
app/models/ci/build_runner_session.rb
app/models/ci/build_runner_session.rb
+1
-1
app/models/ci/build_trace_chunk.rb
app/models/ci/build_trace_chunk.rb
+1
-1
app/models/ci/build_trace_section.rb
app/models/ci/build_trace_section.rb
+1
-1
app/models/ci/build_trace_section_name.rb
app/models/ci/build_trace_section_name.rb
+1
-1
app/models/ci/group_variable.rb
app/models/ci/group_variable.rb
+1
-1
app/models/ci/job_artifact.rb
app/models/ci/job_artifact.rb
+1
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+2
-2
app/models/ci/pipeline_chat_data.rb
app/models/ci/pipeline_chat_data.rb
+1
-1
app/models/ci/pipeline_schedule.rb
app/models/ci/pipeline_schedule.rb
+1
-1
app/models/ci/pipeline_schedule_variable.rb
app/models/ci/pipeline_schedule_variable.rb
+1
-1
app/models/ci/pipeline_variable.rb
app/models/ci/pipeline_variable.rb
+1
-1
app/models/ci/runner.rb
app/models/ci/runner.rb
+1
-1
app/models/ci/runner_namespace.rb
app/models/ci/runner_namespace.rb
+1
-1
app/models/ci/runner_project.rb
app/models/ci/runner_project.rb
+1
-1
app/models/ci/stage.rb
app/models/ci/stage.rb
+1
-1
app/models/ci/trigger.rb
app/models/ci/trigger.rb
+1
-1
app/models/ci/trigger_request.rb
app/models/ci/trigger_request.rb
+1
-1
app/models/ci/variable.rb
app/models/ci/variable.rb
+1
-1
app/models/clusters/applications/cert_manager.rb
app/models/clusters/applications/cert_manager.rb
+1
-1
app/models/clusters/applications/helm.rb
app/models/clusters/applications/helm.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
+1
-1
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+1
-1
app/models/clusters/applications/runner.rb
app/models/clusters/applications/runner.rb
+1
-1
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+1
-1
app/models/clusters/group.rb
app/models/clusters/group.rb
+1
-1
app/models/clusters/kubernetes_namespace.rb
app/models/clusters/kubernetes_namespace.rb
+1
-1
app/models/clusters/platforms/kubernetes.rb
app/models/clusters/platforms/kubernetes.rb
+1
-1
app/models/clusters/project.rb
app/models/clusters/project.rb
+1
-1
app/models/clusters/providers/gcp.rb
app/models/clusters/providers/gcp.rb
+1
-1
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
app/models/concerns/atomic_internal_id.rb
app/models/concerns/atomic_internal_id.rb
+1
-1
app/models/concerns/ignorable_column.rb
app/models/concerns/ignorable_column.rb
+1
-1
app/models/concerns/participable.rb
app/models/concerns/participable.rb
+1
-1
app/models/concerns/reactive_caching.rb
app/models/concerns/reactive_caching.rb
+1
-1
app/models/concerns/sha_attribute.rb
app/models/concerns/sha_attribute.rb
+1
-1
app/models/concerns/strip_attribute.rb
app/models/concerns/strip_attribute.rb
+1
-1
app/models/container_repository.rb
app/models/container_repository.rb
+1
-1
app/models/conversational_development_index/metric.rb
app/models/conversational_development_index/metric.rb
+1
-1
app/models/deploy_keys_project.rb
app/models/deploy_keys_project.rb
+1
-1
app/models/deploy_token.rb
app/models/deploy_token.rb
+1
-1
app/models/deployment.rb
app/models/deployment.rb
+1
-1
app/models/email.rb
app/models/email.rb
+1
-1
app/models/environment.rb
app/models/environment.rb
+1
-1
app/models/epic.rb
app/models/epic.rb
+1
-1
app/models/error_tracking/project_error_tracking_setting.rb
app/models/error_tracking/project_error_tracking_setting.rb
+1
-1
app/models/event.rb
app/models/event.rb
+1
-1
app/models/fork_network.rb
app/models/fork_network.rb
+1
-1
app/models/fork_network_member.rb
app/models/fork_network_member.rb
+1
-1
app/models/gpg_key.rb
app/models/gpg_key.rb
+1
-1
app/models/gpg_key_subkey.rb
app/models/gpg_key_subkey.rb
+1
-1
app/models/group_custom_attribute.rb
app/models/group_custom_attribute.rb
+1
-1
app/models/hooks/web_hook.rb
app/models/hooks/web_hook.rb
+1
-1
app/models/hooks/web_hook_log.rb
app/models/hooks/web_hook_log.rb
+1
-1
app/models/identity.rb
app/models/identity.rb
+1
-1
app/models/identity/uniqueness_scopes.rb
app/models/identity/uniqueness_scopes.rb
+1
-1
app/models/import_export_upload.rb
app/models/import_export_upload.rb
+1
-1
app/models/internal_id.rb
app/models/internal_id.rb
+1
-1
app/models/issue.rb
app/models/issue.rb
+1
-1
app/models/issue/metrics.rb
app/models/issue/metrics.rb
+1
-1
app/models/issue_assignee.rb
app/models/issue_assignee.rb
+1
-1
app/models/key.rb
app/models/key.rb
+1
-1
app/models/label.rb
app/models/label.rb
+1
-1
app/models/label_link.rb
app/models/label_link.rb
+1
-1
app/models/label_priority.rb
app/models/label_priority.rb
+1
-1
app/models/lfs_file_lock.rb
app/models/lfs_file_lock.rb
+1
-1
app/models/lfs_object.rb
app/models/lfs_object.rb
+1
-1
app/models/lfs_objects_project.rb
app/models/lfs_objects_project.rb
+1
-1
app/models/list.rb
app/models/list.rb
+1
-1
app/models/member.rb
app/models/member.rb
+1
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
app/models/merge_request/metrics.rb
app/models/merge_request/metrics.rb
+1
-1
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+1
-1
app/models/merge_request_diff_commit.rb
app/models/merge_request_diff_commit.rb
+1
-1
app/models/merge_request_diff_file.rb
app/models/merge_request_diff_file.rb
+1
-1
app/models/merge_requests_closing_issues.rb
app/models/merge_requests_closing_issues.rb
+1
-1
app/models/milestone.rb
app/models/milestone.rb
+1
-1
app/models/note.rb
app/models/note.rb
+1
-1
app/models/note_diff_file.rb
app/models/note_diff_file.rb
+1
-1
app/models/notification_setting.rb
app/models/notification_setting.rb
+1
-1
app/models/pages_domain.rb
app/models/pages_domain.rb
+1
-1
app/models/personal_access_token.rb
app/models/personal_access_token.rb
+1
-1
app/models/pool_repository.rb
app/models/pool_repository.rb
+1
-1
app/models/postgresql/replication_slot.rb
app/models/postgresql/replication_slot.rb
+1
-1
app/models/programming_language.rb
app/models/programming_language.rb
+1
-1
app/models/project.rb
app/models/project.rb
+1
-1
app/models/project_authorization.rb
app/models/project_authorization.rb
+1
-1
app/models/project_auto_devops.rb
app/models/project_auto_devops.rb
+1
-1
app/models/project_ci_cd_setting.rb
app/models/project_ci_cd_setting.rb
+1
-1
app/models/project_custom_attribute.rb
app/models/project_custom_attribute.rb
+1
-1
app/models/project_daily_statistic.rb
app/models/project_daily_statistic.rb
+1
-1
app/models/project_deploy_token.rb
app/models/project_deploy_token.rb
+1
-1
app/models/project_feature.rb
app/models/project_feature.rb
+1
-1
app/models/project_group_link.rb
app/models/project_group_link.rb
+1
-1
app/models/project_import_data.rb
app/models/project_import_data.rb
+1
-1
app/models/project_import_state.rb
app/models/project_import_state.rb
+1
-1
app/models/project_repository.rb
app/models/project_repository.rb
+1
-1
app/models/project_statistics.rb
app/models/project_statistics.rb
+1
-1
app/models/prometheus_metric.rb
app/models/prometheus_metric.rb
+1
-1
app/models/protected_branch.rb
app/models/protected_branch.rb
+1
-1
app/models/protected_branch/merge_access_level.rb
app/models/protected_branch/merge_access_level.rb
+1
-1
app/models/protected_branch/push_access_level.rb
app/models/protected_branch/push_access_level.rb
+1
-1
app/models/protected_tag.rb
app/models/protected_tag.rb
+1
-1
app/models/protected_tag/create_access_level.rb
app/models/protected_tag/create_access_level.rb
+1
-1
app/models/push_event_payload.rb
app/models/push_event_payload.rb
+1
-1
app/models/redirect_route.rb
app/models/redirect_route.rb
+1
-1
app/models/release.rb
app/models/release.rb
+1
-1
app/models/releases/link.rb
app/models/releases/link.rb
+1
-1
app/models/remote_mirror.rb
app/models/remote_mirror.rb
+1
-1
app/models/repository_language.rb
app/models/repository_language.rb
+1
-1
app/models/resource_label_event.rb
app/models/resource_label_event.rb
+1
-1
app/models/route.rb
app/models/route.rb
+1
-1
app/models/sent_notification.rb
app/models/sent_notification.rb
+1
-1
app/models/service.rb
app/models/service.rb
+1
-1
app/models/shard.rb
app/models/shard.rb
+1
-1
app/models/snippet.rb
app/models/snippet.rb
+1
-1
app/models/spam_log.rb
app/models/spam_log.rb
+1
-1
app/models/subscription.rb
app/models/subscription.rb
+1
-1
app/models/system_note_metadata.rb
app/models/system_note_metadata.rb
+1
-1
app/models/term_agreement.rb
app/models/term_agreement.rb
+1
-1
app/models/timelog.rb
app/models/timelog.rb
+1
-1
app/models/todo.rb
app/models/todo.rb
+1
-1
app/models/trending_project.rb
app/models/trending_project.rb
+1
-1
app/models/u2f_registration.rb
app/models/u2f_registration.rb
+1
-1
app/models/upload.rb
app/models/upload.rb
+1
-1
app/models/user.rb
app/models/user.rb
+1
-1
app/models/user_agent_detail.rb
app/models/user_agent_detail.rb
+1
-1
app/models/user_callout.rb
app/models/user_callout.rb
+1
-1
app/models/user_custom_attribute.rb
app/models/user_custom_attribute.rb
+1
-1
app/models/user_interacted_project.rb
app/models/user_interacted_project.rb
+1
-1
app/models/user_preference.rb
app/models/user_preference.rb
+1
-1
app/models/user_status.rb
app/models/user_status.rb
+1
-1
app/models/user_synced_attributes_metadata.rb
app/models/user_synced_attributes_metadata.rb
+1
-1
app/models/users_star_project.rb
app/models/users_star_project.rb
+1
-1
No files found.
app/models/abuse_report.rb
View file @
013f7cd2
# frozen_string_literal: true
class
AbuseReport
<
A
ctiveRecord
::
Base
class
AbuseReport
<
A
pplicationRecord
include
CacheMarkdownField
cache_markdown_field
:message
,
pipeline: :single_line
...
...
app/models/appearance.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Appearance
<
A
ctiveRecord
::
Base
class
Appearance
<
A
pplicationRecord
include
CacheableAttributes
include
CacheMarkdownField
include
ObjectStorage
::
BackgroundMove
...
...
app/models/application_setting.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ApplicationSetting
<
A
ctiveRecord
::
Base
class
ApplicationSetting
<
A
pplicationRecord
include
CacheableAttributes
include
CacheMarkdownField
include
TokenAuthenticatable
...
...
app/models/application_setting/term.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ApplicationSetting
class
Term
<
A
ctiveRecord
::
Base
class
Term
<
A
pplicationRecord
include
CacheMarkdownField
has_many
:term_agreements
...
...
app/models/audit_event.rb
View file @
013f7cd2
# frozen_string_literal: true
class
AuditEvent
<
A
ctiveRecord
::
Base
class
AuditEvent
<
A
pplicationRecord
serialize
:details
,
Hash
# rubocop:disable Cop/ActiveRecordSerialize
belongs_to
:user
,
foreign_key: :author_id
...
...
app/models/award_emoji.rb
View file @
013f7cd2
# frozen_string_literal: true
class
AwardEmoji
<
A
ctiveRecord
::
Base
class
AwardEmoji
<
A
pplicationRecord
DOWNVOTE_NAME
=
"thumbsdown"
.
freeze
UPVOTE_NAME
=
"thumbsup"
.
freeze
...
...
app/models/badge.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Badge
<
A
ctiveRecord
::
Base
class
Badge
<
A
pplicationRecord
include
FromUnion
# This structure sets the placeholders that the urls
...
...
app/models/board.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Board
<
A
ctiveRecord
::
Base
class
Board
<
A
pplicationRecord
belongs_to
:group
belongs_to
:project
...
...
app/models/board_group_recent_visit.rb
View file @
013f7cd2
# frozen_string_literal: true
# Tracks which boards in a specific group a user has visited
class
BoardGroupRecentVisit
<
A
ctiveRecord
::
Base
class
BoardGroupRecentVisit
<
A
pplicationRecord
belongs_to
:user
belongs_to
:group
belongs_to
:board
...
...
app/models/board_project_recent_visit.rb
View file @
013f7cd2
# frozen_string_literal: true
# Tracks which boards in a specific project a user has visited
class
BoardProjectRecentVisit
<
A
ctiveRecord
::
Base
class
BoardProjectRecentVisit
<
A
pplicationRecord
belongs_to
:user
belongs_to
:project
belongs_to
:board
...
...
app/models/broadcast_message.rb
View file @
013f7cd2
# frozen_string_literal: true
class
BroadcastMessage
<
A
ctiveRecord
::
Base
class
BroadcastMessage
<
A
pplicationRecord
include
CacheMarkdownField
include
Sortable
...
...
app/models/chat_name.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ChatName
<
A
ctiveRecord
::
Base
class
ChatName
<
A
pplicationRecord
LAST_USED_AT_INTERVAL
=
1
.
hour
belongs_to
:service
...
...
app/models/chat_team.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ChatTeam
<
A
ctiveRecord
::
Base
class
ChatTeam
<
A
pplicationRecord
validates
:team_id
,
presence:
true
validates
:namespace
,
uniqueness:
true
...
...
app/models/ci/build_metadata.rb
View file @
013f7cd2
...
...
@@ -3,7 +3,7 @@
module
Ci
# The purpose of this class is to store Build related data that can be disposed.
# Data that should be persisted forever, should be stored with Ci::Build model.
class
BuildMetadata
<
A
ctiveRecord
::
Base
class
BuildMetadata
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
Presentable
include
ChronicDurationAttribute
...
...
app/models/ci/build_runner_session.rb
View file @
013f7cd2
...
...
@@ -3,7 +3,7 @@
module
Ci
# The purpose of this class is to store Build related runner session.
# Data will be removed after transitioning from running to any state.
class
BuildRunnerSession
<
A
ctiveRecord
::
Base
class
BuildRunnerSession
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
self
.
table_name
=
'ci_builds_runner_session'
...
...
app/models/ci/build_trace_chunk.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
BuildTraceChunk
<
A
ctiveRecord
::
Base
class
BuildTraceChunk
<
A
pplicationRecord
include
FastDestroyAll
include
::
Gitlab
::
ExclusiveLeaseHelpers
extend
Gitlab
::
Ci
::
Model
...
...
app/models/ci/build_trace_section.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
BuildTraceSection
<
A
ctiveRecord
::
Base
class
BuildTraceSection
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
belongs_to
:build
,
class_name:
'Ci::Build'
...
...
app/models/ci/build_trace_section_name.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
BuildTraceSectionName
<
A
ctiveRecord
::
Base
class
BuildTraceSectionName
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
belongs_to
:project
...
...
app/models/ci/group_variable.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
GroupVariable
<
A
ctiveRecord
::
Base
class
GroupVariable
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
HasVariable
include
Presentable
...
...
app/models/ci/job_artifact.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
JobArtifact
<
A
ctiveRecord
::
Base
class
JobArtifact
<
A
pplicationRecord
include
AfterCommitQueue
include
ObjectStorage
::
BackgroundMove
extend
Gitlab
::
Ci
::
Model
...
...
app/models/ci/pipeline.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
Pipeline
<
A
ctiveRecord
::
Base
class
Pipeline
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
HasStatus
include
Importable
...
...
@@ -184,7 +184,7 @@ module Ci
scope
:sort_by_merge_request_pipelines
,
->
do
sql
=
'CASE ci_pipelines.source WHEN (?) THEN 0 ELSE 1 END, ci_pipelines.id DESC'
query
=
A
ctiveRecord
::
Base
.
send
(
:sanitize_sql_array
,
[
sql
,
sources
[
:merge_request_event
]])
# rubocop:disable GitlabSecurity/PublicSend
query
=
A
pplicationRecord
.
send
(
:sanitize_sql_array
,
[
sql
,
sources
[
:merge_request_event
]])
# rubocop:disable GitlabSecurity/PublicSend
order
(
query
)
end
...
...
app/models/ci/pipeline_chat_data.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
PipelineChatData
<
A
ctiveRecord
::
Base
class
PipelineChatData
<
A
pplicationRecord
self
.
table_name
=
'ci_pipeline_chat_data'
belongs_to
:chat_name
...
...
app/models/ci/pipeline_schedule.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
PipelineSchedule
<
A
ctiveRecord
::
Base
class
PipelineSchedule
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
Importable
include
IgnorableColumn
...
...
app/models/ci/pipeline_schedule_variable.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
PipelineScheduleVariable
<
A
ctiveRecord
::
Base
class
PipelineScheduleVariable
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
HasVariable
...
...
app/models/ci/pipeline_variable.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
PipelineVariable
<
A
ctiveRecord
::
Base
class
PipelineVariable
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
HasVariable
...
...
app/models/ci/runner.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
Runner
<
A
ctiveRecord
::
Base
class
Runner
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
Gitlab
::
SQL
::
Pattern
include
IgnorableColumn
...
...
app/models/ci/runner_namespace.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
RunnerNamespace
<
A
ctiveRecord
::
Base
class
RunnerNamespace
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
belongs_to
:runner
,
inverse_of: :runner_namespaces
,
validate:
true
...
...
app/models/ci/runner_project.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
RunnerProject
<
A
ctiveRecord
::
Base
class
RunnerProject
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
belongs_to
:runner
,
inverse_of: :runner_projects
...
...
app/models/ci/stage.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
Stage
<
A
ctiveRecord
::
Base
class
Stage
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
Importable
include
HasStatus
...
...
app/models/ci/trigger.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
Trigger
<
A
ctiveRecord
::
Base
class
Trigger
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
IgnorableColumn
include
Presentable
...
...
app/models/ci/trigger_request.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
TriggerRequest
<
A
ctiveRecord
::
Base
class
TriggerRequest
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
belongs_to
:trigger
...
...
app/models/ci/variable.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Ci
class
Variable
<
A
ctiveRecord
::
Base
class
Variable
<
A
pplicationRecord
extend
Gitlab
::
Ci
::
Model
include
HasVariable
include
Presentable
...
...
app/models/clusters/applications/cert_manager.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Applications
class
CertManager
<
A
ctiveRecord
::
Base
class
CertManager
<
A
pplicationRecord
VERSION
=
'v0.5.2'
.
freeze
self
.
table_name
=
'clusters_applications_cert_managers'
...
...
app/models/clusters/applications/helm.rb
View file @
013f7cd2
...
...
@@ -4,7 +4,7 @@ require 'openssl'
module
Clusters
module
Applications
class
Helm
<
A
ctiveRecord
::
Base
class
Helm
<
A
pplicationRecord
self
.
table_name
=
'clusters_applications_helm'
attr_encrypted
:ca_key
,
...
...
app/models/clusters/applications/ingress.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Applications
class
Ingress
<
A
ctiveRecord
::
Base
class
Ingress
<
A
pplicationRecord
VERSION
=
'1.1.2'
.
freeze
self
.
table_name
=
'clusters_applications_ingress'
...
...
app/models/clusters/applications/jupyter.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Applications
class
Jupyter
<
A
ctiveRecord
::
Base
class
Jupyter
<
A
pplicationRecord
VERSION
=
'0.9-174bbd5'
.
freeze
self
.
table_name
=
'clusters_applications_jupyter'
...
...
app/models/clusters/applications/knative.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Applications
class
Knative
<
A
ctiveRecord
::
Base
class
Knative
<
A
pplicationRecord
VERSION
=
'0.3.0'
.
freeze
REPOSITORY
=
'https://storage.googleapis.com/triggermesh-charts'
.
freeze
METRICS_CONFIG
=
'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'
.
freeze
...
...
app/models/clusters/applications/prometheus.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Applications
class
Prometheus
<
A
ctiveRecord
::
Base
class
Prometheus
<
A
pplicationRecord
include
PrometheusAdapter
VERSION
=
'6.7.3'
...
...
app/models/clusters/applications/runner.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Applications
class
Runner
<
A
ctiveRecord
::
Base
class
Runner
<
A
pplicationRecord
VERSION
=
'0.3.0'
.
freeze
self
.
table_name
=
'clusters_applications_runners'
...
...
app/models/clusters/cluster.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Clusters
class
Cluster
<
A
ctiveRecord
::
Base
class
Cluster
<
A
pplicationRecord
include
Presentable
include
Gitlab
::
Utils
::
StrongMemoize
include
FromUnion
...
...
app/models/clusters/group.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Clusters
class
Group
<
A
ctiveRecord
::
Base
class
Group
<
A
pplicationRecord
self
.
table_name
=
'cluster_groups'
belongs_to
:cluster
,
class_name:
'Clusters::Cluster'
...
...
app/models/clusters/kubernetes_namespace.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Clusters
class
KubernetesNamespace
<
A
ctiveRecord
::
Base
class
KubernetesNamespace
<
A
pplicationRecord
include
Gitlab
::
Kubernetes
self
.
table_name
=
'clusters_kubernetes_namespaces'
...
...
app/models/clusters/platforms/kubernetes.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Platforms
class
Kubernetes
<
A
ctiveRecord
::
Base
class
Kubernetes
<
A
pplicationRecord
include
Gitlab
::
Kubernetes
include
ReactiveCaching
include
EnumWithNil
...
...
app/models/clusters/project.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Clusters
class
Project
<
A
ctiveRecord
::
Base
class
Project
<
A
pplicationRecord
self
.
table_name
=
'cluster_projects'
belongs_to
:cluster
,
class_name:
'Clusters::Cluster'
...
...
app/models/clusters/providers/gcp.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
module
Clusters
module
Providers
class
Gcp
<
A
ctiveRecord
::
Base
class
Gcp
<
A
pplicationRecord
self
.
table_name
=
'cluster_providers_gcp'
belongs_to
:cluster
,
inverse_of: :provider_gcp
,
class_name:
'Clusters::Cluster'
...
...
app/models/commit_status.rb
View file @
013f7cd2
# frozen_string_literal: true
class
CommitStatus
<
A
ctiveRecord
::
Base
class
CommitStatus
<
A
pplicationRecord
include
HasStatus
include
Importable
include
AfterCommitQueue
...
...
app/models/concerns/atomic_internal_id.rb
View file @
013f7cd2
...
...
@@ -7,7 +7,7 @@
#
# For example, let's generate internal ids for Issue per Project:
# ```
# class Issue < A
ctiveRecord::Base
# class Issue < A
pplicationRecord
# has_internal_id :iid, scope: :project, init: ->(s) { s.project.issues.maximum(:iid) }
# end
# ```
...
...
app/models/concerns/ignorable_column.rb
View file @
013f7cd2
...
...
@@ -5,7 +5,7 @@
#
# Example:
#
# class User < A
ctiveRecord::Base
# class User < A
pplicationRecord
# include IgnorableColumn
#
# ignore_column :updated_at
...
...
app/models/concerns/participable.rb
View file @
013f7cd2
...
...
@@ -7,7 +7,7 @@
#
# Usage:
#
# class Issue < A
ctiveRecord::Base
# class Issue < A
pplicationRecord
# include Participable
#
# # ...
...
...
app/models/concerns/reactive_caching.rb
View file @
013f7cd2
...
...
@@ -7,7 +7,7 @@
#
# Example of use:
#
# class Foo < A
ctiveRecord::Base
# class Foo < A
pplicationRecord
# include ReactiveCaching
#
# self.reactive_cache_key = ->(thing) { ["foo", thing.id] }
...
...
app/models/concerns/sha_attribute.rb
View file @
013f7cd2
...
...
@@ -39,7 +39,7 @@ module ShaAttribute
end
def
database_exists?
A
ctiveRecord
::
Base
.
connection
A
pplicationRecord
.
connection
true
rescue
...
...
app/models/concerns/strip_attribute.rb
View file @
013f7cd2
...
...
@@ -6,7 +6,7 @@
#
# Usage:
#
# class Milestone < A
ctiveRecord::Base
# class Milestone < A
pplicationRecord
# strip_attributes :title
# end
#
...
...
app/models/container_repository.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ContainerRepository
<
A
ctiveRecord
::
Base
class
ContainerRepository
<
A
pplicationRecord
include
Gitlab
::
Utils
::
StrongMemoize
belongs_to
:project
...
...
app/models/conversational_development_index/metric.rb
View file @
013f7cd2
# frozen_string_literal: true
module
ConversationalDevelopmentIndex
class
Metric
<
A
ctiveRecord
::
Base
class
Metric
<
A
pplicationRecord
include
Presentable
self
.
table_name
=
'conversational_development_index_metrics'
...
...
app/models/deploy_keys_project.rb
View file @
013f7cd2
# frozen_string_literal: true
class
DeployKeysProject
<
A
ctiveRecord
::
Base
class
DeployKeysProject
<
A
pplicationRecord
belongs_to
:project
belongs_to
:deploy_key
,
inverse_of: :deploy_keys_projects
...
...
app/models/deploy_token.rb
View file @
013f7cd2
# frozen_string_literal: true
class
DeployToken
<
A
ctiveRecord
::
Base
class
DeployToken
<
A
pplicationRecord
include
Expirable
include
TokenAuthenticatable
include
PolicyActor
...
...
app/models/deployment.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Deployment
<
A
ctiveRecord
::
Base
class
Deployment
<
A
pplicationRecord
include
AtomicInternalId
include
IidRoutes
include
AfterCommitQueue
...
...
app/models/email.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Email
<
A
ctiveRecord
::
Base
class
Email
<
A
pplicationRecord
include
Sortable
include
Gitlab
::
SQL
::
Pattern
...
...
app/models/environment.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Environment
<
A
ctiveRecord
::
Base
class
Environment
<
A
pplicationRecord
include
Gitlab
::
Utils
::
StrongMemoize
# Used to generate random suffixes for the slug
LETTERS
=
'a'
..
'z'
...
...
app/models/epic.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
# 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
<
A
ctiveRecord
::
Base
class
Epic
<
A
pplicationRecord
def
self
.
link_reference_pattern
nil
end
...
...
app/models/error_tracking/project_error_tracking_setting.rb
View file @
013f7cd2
# frozen_string_literal: true
module
ErrorTracking
class
ProjectErrorTrackingSetting
<
A
ctiveRecord
::
Base
class
ProjectErrorTrackingSetting
<
A
pplicationRecord
include
Gitlab
::
Utils
::
StrongMemoize
include
ReactiveCaching
...
...
app/models/event.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Event
<
A
ctiveRecord
::
Base
class
Event
<
A
pplicationRecord
include
Sortable
include
IgnorableColumn
include
FromUnion
...
...
app/models/fork_network.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ForkNetwork
<
A
ctiveRecord
::
Base
class
ForkNetwork
<
A
pplicationRecord
belongs_to
:root_project
,
class_name:
'Project'
has_many
:fork_network_members
has_many
:projects
,
through: :fork_network_members
...
...
app/models/fork_network_member.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ForkNetworkMember
<
A
ctiveRecord
::
Base
class
ForkNetworkMember
<
A
pplicationRecord
belongs_to
:fork_network
belongs_to
:project
belongs_to
:forked_from_project
,
class_name:
'Project'
...
...
app/models/gpg_key.rb
View file @
013f7cd2
# frozen_string_literal: true
class
GpgKey
<
A
ctiveRecord
::
Base
class
GpgKey
<
A
pplicationRecord
KEY_PREFIX
=
'-----BEGIN PGP PUBLIC KEY BLOCK-----'
.
freeze
KEY_SUFFIX
=
'-----END PGP PUBLIC KEY BLOCK-----'
.
freeze
...
...
app/models/gpg_key_subkey.rb
View file @
013f7cd2
# frozen_string_literal: true
class
GpgKeySubkey
<
A
ctiveRecord
::
Base
class
GpgKeySubkey
<
A
pplicationRecord
include
ShaAttribute
sha_attribute
:keyid
...
...
app/models/group_custom_attribute.rb
View file @
013f7cd2
# frozen_string_literal: true
class
GroupCustomAttribute
<
A
ctiveRecord
::
Base
class
GroupCustomAttribute
<
A
pplicationRecord
belongs_to
:group
validates
:group
,
:key
,
:value
,
presence:
true
...
...
app/models/hooks/web_hook.rb
View file @
013f7cd2
# frozen_string_literal: true
class
WebHook
<
A
ctiveRecord
::
Base
class
WebHook
<
A
pplicationRecord
include
Sortable
attr_encrypted
:token
,
...
...
app/models/hooks/web_hook_log.rb
View file @
013f7cd2
# frozen_string_literal: true
class
WebHookLog
<
A
ctiveRecord
::
Base
class
WebHookLog
<
A
pplicationRecord
belongs_to
:web_hook
serialize
:request_headers
,
Hash
# rubocop:disable Cop/ActiveRecordSerialize
...
...
app/models/identity.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Identity
<
A
ctiveRecord
::
Base
class
Identity
<
A
pplicationRecord
include
Sortable
include
CaseSensitivity
...
...
app/models/identity/uniqueness_scopes.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Identity
<
A
ctiveRecord
::
Base
class
Identity
<
A
pplicationRecord
# This module and method are defined in a separate file to allow EE to
# redefine the `scopes` method before it is used in the `Identity` model.
module
UniquenessScopes
...
...
app/models/import_export_upload.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ImportExportUpload
<
A
ctiveRecord
::
Base
class
ImportExportUpload
<
A
pplicationRecord
include
WithUploads
include
ObjectStorage
::
BackgroundMove
...
...
app/models/internal_id.rb
View file @
013f7cd2
...
...
@@ -15,7 +15,7 @@
# In order to leverage InternalId for other usages, the idea is to
# * Add `usage` value to enum
# * (Optionally) add columns to `internal_ids` if needed for scope.
class
InternalId
<
A
ctiveRecord
::
Base
class
InternalId
<
A
pplicationRecord
belongs_to
:project
belongs_to
:namespace
...
...
app/models/issue.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
require
'carrierwave/orm/activerecord'
class
Issue
<
A
ctiveRecord
::
Base
class
Issue
<
A
pplicationRecord
include
AtomicInternalId
include
IidRoutes
include
Issuable
...
...
app/models/issue/metrics.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Issue::Metrics
<
A
ctiveRecord
::
Base
class
Issue::Metrics
<
A
pplicationRecord
belongs_to
:issue
def
record!
...
...
app/models/issue_assignee.rb
View file @
013f7cd2
# frozen_string_literal: true
class
IssueAssignee
<
A
ctiveRecord
::
Base
class
IssueAssignee
<
A
pplicationRecord
belongs_to
:issue
belongs_to
:assignee
,
class_name:
"User"
,
foreign_key: :user_id
end
app/models/key.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
require
'digest/md5'
class
Key
<
A
ctiveRecord
::
Base
class
Key
<
A
pplicationRecord
include
AfterCommitQueue
include
Sortable
...
...
app/models/label.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Label
<
A
ctiveRecord
::
Base
class
Label
<
A
pplicationRecord
include
CacheMarkdownField
include
Referable
include
Subscribable
...
...
app/models/label_link.rb
View file @
013f7cd2
# frozen_string_literal: true
class
LabelLink
<
A
ctiveRecord
::
Base
class
LabelLink
<
A
pplicationRecord
include
Importable
belongs_to
:target
,
polymorphic:
true
,
inverse_of: :label_links
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/label_priority.rb
View file @
013f7cd2
# frozen_string_literal: true
class
LabelPriority
<
A
ctiveRecord
::
Base
class
LabelPriority
<
A
pplicationRecord
belongs_to
:project
belongs_to
:label
...
...
app/models/lfs_file_lock.rb
View file @
013f7cd2
# frozen_string_literal: true
class
LfsFileLock
<
A
ctiveRecord
::
Base
class
LfsFileLock
<
A
pplicationRecord
belongs_to
:project
belongs_to
:user
...
...
app/models/lfs_object.rb
View file @
013f7cd2
# frozen_string_literal: true
class
LfsObject
<
A
ctiveRecord
::
Base
class
LfsObject
<
A
pplicationRecord
include
AfterCommitQueue
include
ObjectStorage
::
BackgroundMove
...
...
app/models/lfs_objects_project.rb
View file @
013f7cd2
# frozen_string_literal: true
class
LfsObjectsProject
<
A
ctiveRecord
::
Base
class
LfsObjectsProject
<
A
pplicationRecord
belongs_to
:project
belongs_to
:lfs_object
...
...
app/models/list.rb
View file @
013f7cd2
# frozen_string_literal: true
class
List
<
A
ctiveRecord
::
Base
class
List
<
A
pplicationRecord
belongs_to
:board
belongs_to
:label
...
...
app/models/member.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Member
<
A
ctiveRecord
::
Base
class
Member
<
A
pplicationRecord
include
AfterCommitQueue
include
Sortable
include
Importable
...
...
app/models/merge_request.rb
View file @
013f7cd2
# frozen_string_literal: true
class
MergeRequest
<
A
ctiveRecord
::
Base
class
MergeRequest
<
A
pplicationRecord
include
AtomicInternalId
include
IidRoutes
include
Issuable
...
...
app/models/merge_request/metrics.rb
View file @
013f7cd2
# frozen_string_literal: true
class
MergeRequest::Metrics
<
A
ctiveRecord
::
Base
class
MergeRequest::Metrics
<
A
pplicationRecord
belongs_to
:merge_request
belongs_to
:pipeline
,
class_name:
'Ci::Pipeline'
,
foreign_key: :pipeline_id
belongs_to
:latest_closed_by
,
class_name:
'User'
...
...
app/models/merge_request_diff.rb
View file @
013f7cd2
# frozen_string_literal: true
class
MergeRequestDiff
<
A
ctiveRecord
::
Base
class
MergeRequestDiff
<
A
pplicationRecord
include
Sortable
include
Importable
include
ManualInverseAssociation
...
...
app/models/merge_request_diff_commit.rb
View file @
013f7cd2
# frozen_string_literal: true
class
MergeRequestDiffCommit
<
A
ctiveRecord
::
Base
class
MergeRequestDiffCommit
<
A
pplicationRecord
include
ShaAttribute
belongs_to
:merge_request_diff
...
...
app/models/merge_request_diff_file.rb
View file @
013f7cd2
# frozen_string_literal: true
class
MergeRequestDiffFile
<
A
ctiveRecord
::
Base
class
MergeRequestDiffFile
<
A
pplicationRecord
include
Gitlab
::
EncodingHelper
include
DiffFile
...
...
app/models/merge_requests_closing_issues.rb
View file @
013f7cd2
# frozen_string_literal: true
class
MergeRequestsClosingIssues
<
A
ctiveRecord
::
Base
class
MergeRequestsClosingIssues
<
A
pplicationRecord
belongs_to
:merge_request
belongs_to
:issue
...
...
app/models/milestone.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Milestone
<
A
ctiveRecord
::
Base
class
Milestone
<
A
pplicationRecord
# Represents a "No Milestone" state used for filtering Issues and Merge
# Requests that have no milestone assigned.
MilestoneStruct
=
Struct
.
new
(
:title
,
:name
,
:id
)
...
...
app/models/note.rb
View file @
013f7cd2
...
...
@@ -3,7 +3,7 @@
# A note on the root of an issue, merge request, commit, or snippet.
#
# A note of this type is never resolvable.
class
Note
<
A
ctiveRecord
::
Base
class
Note
<
A
pplicationRecord
extend
ActiveModel
::
Naming
include
Participable
include
Mentionable
...
...
app/models/note_diff_file.rb
View file @
013f7cd2
# frozen_string_literal: true
class
NoteDiffFile
<
A
ctiveRecord
::
Base
class
NoteDiffFile
<
A
pplicationRecord
include
DiffFile
scope
:for_commit_or_unresolved
,
->
do
...
...
app/models/notification_setting.rb
View file @
013f7cd2
# frozen_string_literal: true
class
NotificationSetting
<
A
ctiveRecord
::
Base
class
NotificationSetting
<
A
pplicationRecord
include
IgnorableColumn
ignore_column
:events
...
...
app/models/pages_domain.rb
View file @
013f7cd2
# frozen_string_literal: true
class
PagesDomain
<
A
ctiveRecord
::
Base
class
PagesDomain
<
A
pplicationRecord
VERIFICATION_KEY
=
'gitlab-pages-verification-code'
.
freeze
VERIFICATION_THRESHOLD
=
3
.
days
.
freeze
...
...
app/models/personal_access_token.rb
View file @
013f7cd2
# frozen_string_literal: true
class
PersonalAccessToken
<
A
ctiveRecord
::
Base
class
PersonalAccessToken
<
A
pplicationRecord
include
Expirable
include
IgnorableColumn
include
TokenAuthenticatable
...
...
app/models/pool_repository.rb
View file @
013f7cd2
...
...
@@ -3,7 +3,7 @@
# The PoolRepository model is the database equivalent of an ObjectPool for Gitaly
# That is; PoolRepository is the record in the database, ObjectPool is the
# repository on disk
class
PoolRepository
<
A
ctiveRecord
::
Base
class
PoolRepository
<
A
pplicationRecord
include
Shardable
include
AfterCommitQueue
...
...
app/models/postgresql/replication_slot.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Postgresql
class
ReplicationSlot
<
A
ctiveRecord
::
Base
class
ReplicationSlot
<
A
pplicationRecord
self
.
table_name
=
'pg_replication_slots'
# Returns true if there are any replication slots in use.
...
...
app/models/programming_language.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProgrammingLanguage
<
A
ctiveRecord
::
Base
class
ProgrammingLanguage
<
A
pplicationRecord
validates
:name
,
presence:
true
validates
:color
,
allow_blank:
false
,
color:
true
...
...
app/models/project.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
require
'carrierwave/orm/activerecord'
class
Project
<
A
ctiveRecord
::
Base
class
Project
<
A
pplicationRecord
include
Gitlab
::
ConfigHelper
include
Gitlab
::
ShellAdapter
include
Gitlab
::
VisibilityLevel
...
...
app/models/project_authorization.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectAuthorization
<
A
ctiveRecord
::
Base
class
ProjectAuthorization
<
A
pplicationRecord
include
FromUnion
belongs_to
:user
...
...
app/models/project_auto_devops.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectAutoDevops
<
A
ctiveRecord
::
Base
class
ProjectAutoDevops
<
A
pplicationRecord
belongs_to
:project
enum
deploy_strategy:
{
...
...
app/models/project_ci_cd_setting.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectCiCdSetting
<
A
ctiveRecord
::
Base
class
ProjectCiCdSetting
<
A
pplicationRecord
belongs_to
:project
,
inverse_of: :ci_cd_settings
# The version of the schema that first introduced this model/table.
...
...
app/models/project_custom_attribute.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectCustomAttribute
<
A
ctiveRecord
::
Base
class
ProjectCustomAttribute
<
A
pplicationRecord
belongs_to
:project
validates
:project
,
:key
,
:value
,
presence:
true
...
...
app/models/project_daily_statistic.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectDailyStatistic
<
A
ctiveRecord
::
Base
class
ProjectDailyStatistic
<
A
pplicationRecord
belongs_to
:project
scope
:of_project
,
->
(
project
)
{
where
(
project:
project
)
}
...
...
app/models/project_deploy_token.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectDeployToken
<
A
ctiveRecord
::
Base
class
ProjectDeployToken
<
A
pplicationRecord
belongs_to
:project
belongs_to
:deploy_token
,
inverse_of: :project_deploy_tokens
...
...
app/models/project_feature.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectFeature
<
A
ctiveRecord
::
Base
class
ProjectFeature
<
A
pplicationRecord
# == Project features permissions
#
# Grants access level to project tools
...
...
app/models/project_group_link.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectGroupLink
<
A
ctiveRecord
::
Base
class
ProjectGroupLink
<
A
pplicationRecord
include
Expirable
GUEST
=
10
...
...
app/models/project_import_data.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
require
'carrierwave/orm/activerecord'
class
ProjectImportData
<
A
ctiveRecord
::
Base
class
ProjectImportData
<
A
pplicationRecord
belongs_to
:project
,
inverse_of: :import_data
attr_encrypted
:credentials
,
key:
Settings
.
attr_encrypted_db_key_base
,
...
...
app/models/project_import_state.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectImportState
<
A
ctiveRecord
::
Base
class
ProjectImportState
<
A
pplicationRecord
include
AfterCommitQueue
self
.
table_name
=
"project_mirror_data"
...
...
app/models/project_repository.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectRepository
<
A
ctiveRecord
::
Base
class
ProjectRepository
<
A
pplicationRecord
include
Shardable
belongs_to
:project
,
inverse_of: :project_repository
...
...
app/models/project_statistics.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProjectStatistics
<
A
ctiveRecord
::
Base
class
ProjectStatistics
<
A
pplicationRecord
belongs_to
:project
belongs_to
:namespace
...
...
app/models/prometheus_metric.rb
View file @
013f7cd2
# frozen_string_literal: true
class
PrometheusMetric
<
A
ctiveRecord
::
Base
class
PrometheusMetric
<
A
pplicationRecord
belongs_to
:project
,
validate:
true
,
inverse_of: :prometheus_metrics
enum
group:
{
...
...
app/models/protected_branch.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProtectedBranch
<
A
ctiveRecord
::
Base
class
ProtectedBranch
<
A
pplicationRecord
include
ProtectedRef
protected_ref_access_levels
:merge
,
:push
...
...
app/models/protected_branch/merge_access_level.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProtectedBranch::MergeAccessLevel
<
A
ctiveRecord
::
Base
class
ProtectedBranch::MergeAccessLevel
<
A
pplicationRecord
include
ProtectedBranchAccess
end
app/models/protected_branch/push_access_level.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProtectedBranch::PushAccessLevel
<
A
ctiveRecord
::
Base
class
ProtectedBranch::PushAccessLevel
<
A
pplicationRecord
include
ProtectedBranchAccess
end
app/models/protected_tag.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProtectedTag
<
A
ctiveRecord
::
Base
class
ProtectedTag
<
A
pplicationRecord
include
ProtectedRef
validates
:name
,
uniqueness:
{
scope: :project_id
}
...
...
app/models/protected_tag/create_access_level.rb
View file @
013f7cd2
# frozen_string_literal: true
class
ProtectedTag::CreateAccessLevel
<
A
ctiveRecord
::
Base
class
ProtectedTag::CreateAccessLevel
<
A
pplicationRecord
include
ProtectedTagAccess
def
check_access
(
user
)
...
...
app/models/push_event_payload.rb
View file @
013f7cd2
# frozen_string_literal: true
class
PushEventPayload
<
A
ctiveRecord
::
Base
class
PushEventPayload
<
A
pplicationRecord
include
ShaAttribute
belongs_to
:event
,
inverse_of: :push_event_payload
...
...
app/models/redirect_route.rb
View file @
013f7cd2
# frozen_string_literal: true
class
RedirectRoute
<
A
ctiveRecord
::
Base
class
RedirectRoute
<
A
pplicationRecord
belongs_to
:source
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
validates
:source
,
presence:
true
...
...
app/models/release.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Release
<
A
ctiveRecord
::
Base
class
Release
<
A
pplicationRecord
include
CacheMarkdownField
include
Gitlab
::
Utils
::
StrongMemoize
...
...
app/models/releases/link.rb
View file @
013f7cd2
# frozen_string_literal: true
module
Releases
class
Link
<
A
ctiveRecord
::
Base
class
Link
<
A
pplicationRecord
self
.
table_name
=
'release_links'
belongs_to
:release
...
...
app/models/remote_mirror.rb
View file @
013f7cd2
# frozen_string_literal: true
class
RemoteMirror
<
A
ctiveRecord
::
Base
class
RemoteMirror
<
A
pplicationRecord
include
AfterCommitQueue
include
MirrorAuthentication
...
...
app/models/repository_language.rb
View file @
013f7cd2
# frozen_string_literal: true
class
RepositoryLanguage
<
A
ctiveRecord
::
Base
class
RepositoryLanguage
<
A
pplicationRecord
belongs_to
:project
belongs_to
:programming_language
...
...
app/models/resource_label_event.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
# This model is not used yet, it will be used for:
# https://gitlab.com/gitlab-org/gitlab-ce/issues/48483
class
ResourceLabelEvent
<
A
ctiveRecord
::
Base
class
ResourceLabelEvent
<
A
pplicationRecord
include
Importable
include
Gitlab
::
Utils
::
StrongMemoize
include
CacheMarkdownField
...
...
app/models/route.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Route
<
A
ctiveRecord
::
Base
class
Route
<
A
pplicationRecord
include
CaseSensitivity
belongs_to
:source
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/sent_notification.rb
View file @
013f7cd2
# frozen_string_literal: true
class
SentNotification
<
A
ctiveRecord
::
Base
class
SentNotification
<
A
pplicationRecord
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/ActiveRecordSerialize
belongs_to
:project
...
...
app/models/service.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
# To add new service you should build a class inherited from Service
# and implement a set of methods
class
Service
<
A
ctiveRecord
::
Base
class
Service
<
A
pplicationRecord
include
Sortable
include
Importable
include
ProjectServicesLoggable
...
...
app/models/shard.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Shard
<
A
ctiveRecord
::
Base
class
Shard
<
A
pplicationRecord
# Store shard names from the configuration file in the database. This is not a
# list of active shards - we just want to assign an immutable, unique ID to
# every shard name for easy indexing / referencing.
...
...
app/models/snippet.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Snippet
<
A
ctiveRecord
::
Base
class
Snippet
<
A
pplicationRecord
include
Gitlab
::
VisibilityLevel
include
Redactable
include
CacheMarkdownField
...
...
app/models/spam_log.rb
View file @
013f7cd2
# frozen_string_literal: true
class
SpamLog
<
A
ctiveRecord
::
Base
class
SpamLog
<
A
pplicationRecord
belongs_to
:user
validates
:user
,
presence:
true
...
...
app/models/subscription.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Subscription
<
A
ctiveRecord
::
Base
class
Subscription
<
A
pplicationRecord
belongs_to
:user
belongs_to
:project
belongs_to
:subscribable
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/system_note_metadata.rb
View file @
013f7cd2
# frozen_string_literal: true
class
SystemNoteMetadata
<
A
ctiveRecord
::
Base
class
SystemNoteMetadata
<
A
pplicationRecord
# These notes's action text might contain a reference that is external.
# We should always force a deep validation upon references that are found
# in this note type.
...
...
app/models/term_agreement.rb
View file @
013f7cd2
# frozen_string_literal: true
class
TermAgreement
<
A
ctiveRecord
::
Base
class
TermAgreement
<
A
pplicationRecord
belongs_to
:term
,
class_name:
'ApplicationSetting::Term'
belongs_to
:user
...
...
app/models/timelog.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Timelog
<
A
ctiveRecord
::
Base
class
Timelog
<
A
pplicationRecord
validates
:time_spent
,
:user
,
presence:
true
validate
:issuable_id_is_present
...
...
app/models/todo.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Todo
<
A
ctiveRecord
::
Base
class
Todo
<
A
pplicationRecord
include
Sortable
include
FromUnion
...
...
app/models/trending_project.rb
View file @
013f7cd2
# frozen_string_literal: true
class
TrendingProject
<
A
ctiveRecord
::
Base
class
TrendingProject
<
A
pplicationRecord
belongs_to
:project
# The number of months to include in the trending calculation.
...
...
app/models/u2f_registration.rb
View file @
013f7cd2
...
...
@@ -2,7 +2,7 @@
# Registration information for U2F (universal 2nd factor) devices, like Yubikeys
class
U2fRegistration
<
A
ctiveRecord
::
Base
class
U2fRegistration
<
A
pplicationRecord
belongs_to
:user
def
self
.
register
(
user
,
app_id
,
params
,
challenges
)
...
...
app/models/upload.rb
View file @
013f7cd2
# frozen_string_literal: true
class
Upload
<
A
ctiveRecord
::
Base
class
Upload
<
A
pplicationRecord
# Upper limit for foreground checksum processing
CHECKSUM_THRESHOLD
=
100
.
megabytes
...
...
app/models/user.rb
View file @
013f7cd2
...
...
@@ -432,7 +432,7 @@ class User < ApplicationRecord
fuzzy_arel_match
(
:name
,
query
,
lower_exact_match:
true
)
.
or
(
fuzzy_arel_match
(
:username
,
query
,
lower_exact_match:
true
))
.
or
(
arel_table
[
:email
].
eq
(
query
))
).
reorder
(
order
%
{
query:
A
ctiveRecord
::
Base
.
connection
.
quote
(
query
)
},
:name
)
).
reorder
(
order
%
{
query:
A
pplicationRecord
.
connection
.
quote
(
query
)
},
:name
)
end
# Limits the result set to users _not_ in the given query/list of IDs.
...
...
app/models/user_agent_detail.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UserAgentDetail
<
A
ctiveRecord
::
Base
class
UserAgentDetail
<
A
pplicationRecord
belongs_to
:subject
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
validates
:user_agent
,
:ip_address
,
:subject_id
,
:subject_type
,
presence:
true
...
...
app/models/user_callout.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UserCallout
<
A
ctiveRecord
::
Base
class
UserCallout
<
A
pplicationRecord
belongs_to
:user
# We use `UserCalloutEnums.feature_names` here so that EE can more easily
...
...
app/models/user_custom_attribute.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UserCustomAttribute
<
A
ctiveRecord
::
Base
class
UserCustomAttribute
<
A
pplicationRecord
belongs_to
:user
validates
:user_id
,
:key
,
:value
,
presence:
true
...
...
app/models/user_interacted_project.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UserInteractedProject
<
A
ctiveRecord
::
Base
class
UserInteractedProject
<
A
pplicationRecord
belongs_to
:user
belongs_to
:project
...
...
app/models/user_preference.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UserPreference
<
A
ctiveRecord
::
Base
class
UserPreference
<
A
pplicationRecord
# We could use enums, but Rails 4 doesn't support multiple
# enum options with same name for multiple fields, also it creates
# extra methods that aren't really needed here.
...
...
app/models/user_status.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UserStatus
<
A
ctiveRecord
::
Base
class
UserStatus
<
A
pplicationRecord
include
CacheMarkdownField
self
.
primary_key
=
:user_id
...
...
app/models/user_synced_attributes_metadata.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UserSyncedAttributesMetadata
<
A
ctiveRecord
::
Base
class
UserSyncedAttributesMetadata
<
A
pplicationRecord
belongs_to
:user
validates
:user
,
presence:
true
...
...
app/models/users_star_project.rb
View file @
013f7cd2
# frozen_string_literal: true
class
UsersStarProject
<
A
ctiveRecord
::
Base
class
UsersStarProject
<
A
pplicationRecord
belongs_to
:project
,
counter_cache: :star_count
,
touch:
true
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