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
0f897538
Commit
0f897538
authored
Mar 28, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EE: Inherit from ApplicationRecord instead of ActiveRecord::Base
parent
7116c4ec
Changes
67
Hide whitespace changes
Inline
Side-by-side
Showing
67 changed files
with
72 additions
and
72 deletions
+72
-72
ee/app/models/approval.rb
ee/app/models/approval.rb
+1
-1
ee/app/models/approver.rb
ee/app/models/approver.rb
+1
-1
ee/app/models/approver_group.rb
ee/app/models/approver_group.rb
+1
-1
ee/app/models/board_assignee.rb
ee/app/models/board_assignee.rb
+1
-1
ee/app/models/board_label.rb
ee/app/models/board_label.rb
+1
-1
ee/app/models/ci/sources/pipeline.rb
ee/app/models/ci/sources/pipeline.rb
+1
-1
ee/app/models/concerns/has_environment_scope.rb
ee/app/models/concerns/has_environment_scope.rb
+1
-1
ee/app/models/draft_note.rb
ee/app/models/draft_note.rb
+1
-1
ee/app/models/ee/epic.rb
ee/app/models/ee/epic.rb
+1
-1
ee/app/models/ee/merge_request.rb
ee/app/models/ee/merge_request.rb
+1
-1
ee/app/models/epic/metrics.rb
ee/app/models/epic/metrics.rb
+1
-1
ee/app/models/epic_issue.rb
ee/app/models/epic_issue.rb
+1
-1
ee/app/models/geo/cache_invalidation_event.rb
ee/app/models/geo/cache_invalidation_event.rb
+1
-1
ee/app/models/geo/event_log.rb
ee/app/models/geo/event_log.rb
+1
-1
ee/app/models/geo/hashed_storage_attachments_event.rb
ee/app/models/geo/hashed_storage_attachments_event.rb
+1
-1
ee/app/models/geo/hashed_storage_migrated_event.rb
ee/app/models/geo/hashed_storage_migrated_event.rb
+1
-1
ee/app/models/geo/job_artifact_deleted_event.rb
ee/app/models/geo/job_artifact_deleted_event.rb
+1
-1
ee/app/models/geo/lfs_object_deleted_event.rb
ee/app/models/geo/lfs_object_deleted_event.rb
+1
-1
ee/app/models/geo/repositories_changed_event.rb
ee/app/models/geo/repositories_changed_event.rb
+1
-1
ee/app/models/geo/repository_created_event.rb
ee/app/models/geo/repository_created_event.rb
+1
-1
ee/app/models/geo/repository_deleted_event.rb
ee/app/models/geo/repository_deleted_event.rb
+1
-1
ee/app/models/geo/repository_renamed_event.rb
ee/app/models/geo/repository_renamed_event.rb
+1
-1
ee/app/models/geo/repository_updated_event.rb
ee/app/models/geo/repository_updated_event.rb
+1
-1
ee/app/models/geo/reset_checksum_event.rb
ee/app/models/geo/reset_checksum_event.rb
+1
-1
ee/app/models/geo/tracking_base.rb
ee/app/models/geo/tracking_base.rb
+1
-1
ee/app/models/geo/upload_deleted_event.rb
ee/app/models/geo/upload_deleted_event.rb
+1
-1
ee/app/models/geo_node.rb
ee/app/models/geo_node.rb
+1
-1
ee/app/models/geo_node_namespace_link.rb
ee/app/models/geo_node_namespace_link.rb
+1
-1
ee/app/models/geo_node_status.rb
ee/app/models/geo_node_status.rb
+1
-1
ee/app/models/gitlab_subscription.rb
ee/app/models/gitlab_subscription.rb
+1
-1
ee/app/models/historical_data.rb
ee/app/models/historical_data.rb
+1
-1
ee/app/models/index_status.rb
ee/app/models/index_status.rb
+1
-1
ee/app/models/insight.rb
ee/app/models/insight.rb
+1
-1
ee/app/models/issue_link.rb
ee/app/models/issue_link.rb
+1
-1
ee/app/models/ldap_group_link.rb
ee/app/models/ldap_group_link.rb
+1
-1
ee/app/models/license.rb
ee/app/models/license.rb
+1
-1
ee/app/models/namespace_statistics.rb
ee/app/models/namespace_statistics.rb
+1
-1
ee/app/models/operations/feature_flag.rb
ee/app/models/operations/feature_flag.rb
+1
-1
ee/app/models/operations/feature_flag_scope.rb
ee/app/models/operations/feature_flag_scope.rb
+1
-1
ee/app/models/operations/feature_flags_client.rb
ee/app/models/operations/feature_flags_client.rb
+1
-1
ee/app/models/packages/maven_metadatum.rb
ee/app/models/packages/maven_metadatum.rb
+1
-1
ee/app/models/packages/package.rb
ee/app/models/packages/package.rb
+1
-1
ee/app/models/packages/package_file.rb
ee/app/models/packages/package_file.rb
+1
-1
ee/app/models/path_lock.rb
ee/app/models/path_lock.rb
+1
-1
ee/app/models/pg_replication_slot.rb
ee/app/models/pg_replication_slot.rb
+6
-6
ee/app/models/plan.rb
ee/app/models/plan.rb
+1
-1
ee/app/models/project_feature_usage.rb
ee/app/models/project_feature_usage.rb
+1
-1
ee/app/models/project_repository_state.rb
ee/app/models/project_repository_state.rb
+1
-1
ee/app/models/project_tracing_setting.rb
ee/app/models/project_tracing_setting.rb
+1
-1
ee/app/models/prometheus_alert.rb
ee/app/models/prometheus_alert.rb
+1
-1
ee/app/models/prometheus_alert_event.rb
ee/app/models/prometheus_alert_event.rb
+1
-1
ee/app/models/protected_branch/unprotect_access_level.rb
ee/app/models/protected_branch/unprotect_access_level.rb
+1
-1
ee/app/models/protected_environment.rb
ee/app/models/protected_environment.rb
+1
-1
ee/app/models/protected_environment/deploy_access_level.rb
ee/app/models/protected_environment/deploy_access_level.rb
+1
-1
ee/app/models/push_rule.rb
ee/app/models/push_rule.rb
+1
-1
ee/app/models/saml_provider.rb
ee/app/models/saml_provider.rb
+1
-1
ee/app/models/slack_integration.rb
ee/app/models/slack_integration.rb
+1
-1
ee/app/models/smartcard_identity.rb
ee/app/models/smartcard_identity.rb
+1
-1
ee/app/models/software_license.rb
ee/app/models/software_license.rb
+1
-1
ee/app/models/software_license_policy.rb
ee/app/models/software_license_policy.rb
+1
-1
ee/app/models/users_ops_dashboard_project.rb
ee/app/models/users_ops_dashboard_project.rb
+1
-1
ee/app/models/vulnerabilities/feedback.rb
ee/app/models/vulnerabilities/feedback.rb
+1
-1
ee/app/models/vulnerabilities/identifier.rb
ee/app/models/vulnerabilities/identifier.rb
+1
-1
ee/app/models/vulnerabilities/occurrence.rb
ee/app/models/vulnerabilities/occurrence.rb
+1
-1
ee/app/models/vulnerabilities/occurrence_identifier.rb
ee/app/models/vulnerabilities/occurrence_identifier.rb
+1
-1
ee/app/models/vulnerabilities/occurrence_pipeline.rb
ee/app/models/vulnerabilities/occurrence_pipeline.rb
+1
-1
ee/app/models/vulnerabilities/scanner.rb
ee/app/models/vulnerabilities/scanner.rb
+1
-1
No files found.
ee/app/models/approval.rb
View file @
0f897538
# frozen_string_literal: true
class
Approval
<
A
ctiveRecord
::
Base
class
Approval
<
A
pplicationRecord
belongs_to
:user
belongs_to
:merge_request
...
...
ee/app/models/approver.rb
View file @
0f897538
# frozen_string_literal: true
class
Approver
<
A
ctiveRecord
::
Base
class
Approver
<
A
pplicationRecord
belongs_to
:target
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
belongs_to
:user
...
...
ee/app/models/approver_group.rb
View file @
0f897538
# frozen_string_literal: true
class
ApproverGroup
<
A
ctiveRecord
::
Base
class
ApproverGroup
<
A
pplicationRecord
belongs_to
:target
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
belongs_to
:group
...
...
ee/app/models/board_assignee.rb
View file @
0f897538
# frozen_string_literal: true
class
BoardAssignee
<
A
ctiveRecord
::
Base
class
BoardAssignee
<
A
pplicationRecord
belongs_to
:board
belongs_to
:assignee
,
class_name:
'User'
...
...
ee/app/models/board_label.rb
View file @
0f897538
# frozen_string_literal: true
class
BoardLabel
<
A
ctiveRecord
::
Base
class
BoardLabel
<
A
pplicationRecord
belongs_to
:board
belongs_to
:label
...
...
ee/app/models/ci/sources/pipeline.rb
View file @
0f897538
...
...
@@ -2,7 +2,7 @@
module
Ci
module
Sources
class
Pipeline
<
A
ctiveRecord
::
Base
class
Pipeline
<
A
pplicationRecord
self
.
table_name
=
"ci_sources_pipelines"
belongs_to
:project
,
class_name:
Project
...
...
ee/app/models/concerns/has_environment_scope.rb
View file @
0f897538
...
...
@@ -46,7 +46,7 @@ module HasEnvironmentScope
# Note that the connection could be
# Gitlab::Database::LoadBalancing::ConnectionProxy
# which supports `quote` via `method_missing`
A
ctiveRecord
::
Base
.
connection
.
quote
(
value
)
A
pplicationRecord
.
connection
.
quote
(
value
)
end
# The query is trying to find variables with scopes matching the
...
...
ee/app/models/draft_note.rb
View file @
0f897538
# frozen_string_literal: true
class
DraftNote
<
A
ctiveRecord
::
Base
class
DraftNote
<
A
pplicationRecord
include
DiffPositionableNote
include
Gitlab
::
Utils
::
StrongMemoize
include
Sortable
...
...
ee/app/models/ee/epic.rb
View file @
0f897538
...
...
@@ -160,7 +160,7 @@ module EE
return
unless
::
Group
.
supports_nested_objects?
result
=
A
ctiveRecord
::
Base
.
connection
.
execute
(
A
pplicationRecord
.
connection
.
execute
(
<<-
SQL
WITH RECURSIVE descendants AS (
SELECT id, 1 depth
...
...
ee/app/models/ee/merge_request.rb
View file @
0f897538
...
...
@@ -121,7 +121,7 @@ module EE
owners
=
code_owners
if
owners
.
present?
A
ctiveRecord
::
Base
.
transaction
do
A
pplicationRecord
.
transaction
do
rule
=
approval_rules
.
code_owner
.
first
rule
||=
approval_rules
.
code_owner
.
create!
(
name:
ApprovalMergeRequestRule
::
DEFAULT_NAME_FOR_CODE_OWNER
)
...
...
ee/app/models/epic/metrics.rb
View file @
0f897538
# frozen_string_literal: true
class
Epic::Metrics
<
A
ctiveRecord
::
Base
class
Epic::Metrics
<
A
pplicationRecord
belongs_to
:epic
def
record!
...
...
ee/app/models/epic_issue.rb
View file @
0f897538
# frozen_string_literal: true
class
EpicIssue
<
A
ctiveRecord
::
Base
class
EpicIssue
<
A
pplicationRecord
include
RelativePositioning
validates
:epic
,
:issue
,
presence:
true
...
...
ee/app/models/geo/cache_invalidation_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
CacheInvalidationEvent
<
A
ctiveRecord
::
Base
class
CacheInvalidationEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/event_log.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
EventLog
<
A
ctiveRecord
::
Base
class
EventLog
<
A
pplicationRecord
include
Geo
::
Model
include
::
EachBatch
...
...
ee/app/models/geo/hashed_storage_attachments_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
HashedStorageAttachmentsEvent
<
A
ctiveRecord
::
Base
class
HashedStorageAttachmentsEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/hashed_storage_migrated_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
HashedStorageMigratedEvent
<
A
ctiveRecord
::
Base
class
HashedStorageMigratedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/job_artifact_deleted_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
JobArtifactDeletedEvent
<
A
ctiveRecord
::
Base
class
JobArtifactDeletedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/lfs_object_deleted_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
LfsObjectDeletedEvent
<
A
ctiveRecord
::
Base
class
LfsObjectDeletedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/repositories_changed_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
RepositoriesChangedEvent
<
A
ctiveRecord
::
Base
class
RepositoriesChangedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/repository_created_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
RepositoryCreatedEvent
<
A
ctiveRecord
::
Base
class
RepositoryCreatedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/repository_deleted_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
RepositoryDeletedEvent
<
A
ctiveRecord
::
Base
class
RepositoryDeletedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/repository_renamed_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
RepositoryRenamedEvent
<
A
ctiveRecord
::
Base
class
RepositoryRenamedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/repository_updated_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
RepositoryUpdatedEvent
<
A
ctiveRecord
::
Base
class
RepositoryUpdatedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/reset_checksum_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
ResetChecksumEvent
<
A
ctiveRecord
::
Base
class
ResetChecksumEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo/tracking_base.rb
View file @
0f897538
...
...
@@ -3,7 +3,7 @@
# This module is intended to centralize all database access to the secondary
# tracking database for Geo.
module
Geo
class
TrackingBase
<
A
ctiveRecord
::
Base
class
TrackingBase
<
A
pplicationRecord
self
.
abstract_class
=
true
NOT_CONFIGURED_MSG
=
'Geo secondary database is not configured'
.
freeze
...
...
ee/app/models/geo/upload_deleted_event.rb
View file @
0f897538
# frozen_string_literal: true
module
Geo
class
UploadDeletedEvent
<
A
ctiveRecord
::
Base
class
UploadDeletedEvent
<
A
pplicationRecord
include
Geo
::
Model
include
Geo
::
Eventable
...
...
ee/app/models/geo_node.rb
View file @
0f897538
# frozen_string_literal: true
class
GeoNode
<
A
ctiveRecord
::
Base
class
GeoNode
<
A
pplicationRecord
include
Presentable
include
Geo
::
SelectiveSync
...
...
ee/app/models/geo_node_namespace_link.rb
View file @
0f897538
# frozen_string_literal: true
class
GeoNodeNamespaceLink
<
A
ctiveRecord
::
Base
class
GeoNodeNamespaceLink
<
A
pplicationRecord
belongs_to
:geo_node
,
inverse_of: :namespaces
belongs_to
:namespace
...
...
ee/app/models/geo_node_status.rb
View file @
0f897538
# frozen_string_literal: true
class
GeoNodeStatus
<
A
ctiveRecord
::
Base
class
GeoNodeStatus
<
A
pplicationRecord
include
ShaAttribute
belongs_to
:geo_node
...
...
ee/app/models/gitlab_subscription.rb
View file @
0f897538
# frozen_string_literal: true
class
GitlabSubscription
<
A
ctiveRecord
::
Base
class
GitlabSubscription
<
A
pplicationRecord
default_value_for
:start_date
,
Date
.
today
belongs_to
:namespace
...
...
ee/app/models/historical_data.rb
View file @
0f897538
# frozen_string_literal: true
class
HistoricalData
<
A
ctiveRecord
::
Base
class
HistoricalData
<
A
pplicationRecord
validates
:date
,
presence:
true
# HistoricalData.during((Date.today - 1.year)..Date.today).average(:active_user_count)
...
...
ee/app/models/index_status.rb
View file @
0f897538
# frozen_string_literal: true
class
IndexStatus
<
A
ctiveRecord
::
Base
class
IndexStatus
<
A
pplicationRecord
belongs_to
:project
validates
:project_id
,
uniqueness:
true
,
presence:
true
...
...
ee/app/models/insight.rb
View file @
0f897538
# frozen_string_literal: true
class
Insight
<
A
ctiveRecord
::
Base
class
Insight
<
A
pplicationRecord
belongs_to
:group
,
foreign_key: :namespace_id
belongs_to
:project
end
ee/app/models/issue_link.rb
View file @
0f897538
# frozen_string_literal: true
class
IssueLink
<
A
ctiveRecord
::
Base
class
IssueLink
<
A
pplicationRecord
belongs_to
:source
,
class_name:
'Issue'
belongs_to
:target
,
class_name:
'Issue'
...
...
ee/app/models/ldap_group_link.rb
View file @
0f897538
# frozen_string_literal: true
class
LdapGroupLink
<
A
ctiveRecord
::
Base
class
LdapGroupLink
<
A
pplicationRecord
include
Gitlab
::
Access
belongs_to
:group
...
...
ee/app/models/license.rb
View file @
0f897538
# frozen_string_literal: true
class
License
<
A
ctiveRecord
::
Base
class
License
<
A
pplicationRecord
include
ActionView
::
Helpers
::
NumberHelper
STARTER_PLAN
=
'starter'
.
freeze
...
...
ee/app/models/namespace_statistics.rb
View file @
0f897538
# frozen_string_literal: true
class
NamespaceStatistics
<
A
ctiveRecord
::
Base
class
NamespaceStatistics
<
A
pplicationRecord
belongs_to
:namespace
validates
:namespace
,
presence:
true
...
...
ee/app/models/operations/feature_flag.rb
View file @
0f897538
...
...
@@ -6,7 +6,7 @@ module Operations
# "operations_feature_flags.active" column is not used in favor of
# operations_feature_flag_scopes's override policy.
# You can calculate actual `active` values with `for_environment` method.
class
FeatureFlag
<
A
ctiveRecord
::
Base
class
FeatureFlag
<
A
pplicationRecord
self
.
table_name
=
'operations_feature_flags'
belongs_to
:project
...
...
ee/app/models/operations/feature_flag_scope.rb
View file @
0f897538
# frozen_string_literal: true
module
Operations
class
FeatureFlagScope
<
A
ctiveRecord
::
Base
class
FeatureFlagScope
<
A
pplicationRecord
prepend
HasEnvironmentScope
self
.
table_name
=
'operations_feature_flag_scopes'
...
...
ee/app/models/operations/feature_flags_client.rb
View file @
0f897538
# frozen_string_literal: true
module
Operations
class
FeatureFlagsClient
<
A
ctiveRecord
::
Base
class
FeatureFlagsClient
<
A
pplicationRecord
include
TokenAuthenticatable
self
.
table_name
=
'operations_feature_flags_clients'
...
...
ee/app/models/packages/maven_metadatum.rb
View file @
0f897538
# frozen_string_literal: true
class
Packages::MavenMetadatum
<
A
ctiveRecord
::
Base
class
Packages::MavenMetadatum
<
A
pplicationRecord
belongs_to
:package
validates
:package
,
presence:
true
...
...
ee/app/models/packages/package.rb
View file @
0f897538
# frozen_string_literal: true
class
Packages::Package
<
A
ctiveRecord
::
Base
class
Packages::Package
<
A
pplicationRecord
belongs_to
:project
has_many
:package_files
has_one
:maven_metadatum
,
inverse_of: :package
...
...
ee/app/models/packages/package_file.rb
View file @
0f897538
# frozen_string_literal: true
class
Packages::PackageFile
<
A
ctiveRecord
::
Base
class
Packages::PackageFile
<
A
pplicationRecord
belongs_to
:package
validates
:package
,
presence:
true
...
...
ee/app/models/path_lock.rb
View file @
0f897538
# frozen_string_literal: true
class
PathLock
<
A
ctiveRecord
::
Base
class
PathLock
<
A
pplicationRecord
belongs_to
:project
belongs_to
:user
...
...
ee/app/models/pg_replication_slot.rb
View file @
0f897538
...
...
@@ -3,17 +3,17 @@
# `pg_replication_slots` is a PostgreSQL view
class
PgReplicationSlot
def
self
.
count
A
ctiveRecord
::
Base
.
connection
.
execute
(
"SELECT COUNT(*) FROM pg_replication_slots;"
)
A
pplicationRecord
.
connection
.
execute
(
"SELECT COUNT(*) FROM pg_replication_slots;"
)
.
first
.
fetch
(
'count'
).
to_i
end
def
self
.
unused_slots_count
A
ctiveRecord
::
Base
.
connection
.
execute
(
"SELECT COUNT(*) FROM pg_replication_slots WHERE active = 'f';"
)
A
pplicationRecord
.
connection
.
execute
(
"SELECT COUNT(*) FROM pg_replication_slots WHERE active = 'f';"
)
.
first
.
fetch
(
'count'
).
to_i
end
def
self
.
used_slots_count
A
ctiveRecord
::
Base
.
connection
.
execute
(
"SELECT COUNT(*) FROM pg_replication_slots WHERE active = 't';"
)
A
pplicationRecord
.
connection
.
execute
(
"SELECT COUNT(*) FROM pg_replication_slots WHERE active = 't';"
)
.
first
.
fetch
(
'count'
).
to_i
end
...
...
@@ -21,7 +21,7 @@ class PgReplicationSlot
# https://www.skillslogic.com/blog/databases/checking-postgres-replication-lag
# http://bdr-project.org/docs/stable/monitoring-peers.html
def
self
.
slots_retained_bytes
A
ctiveRecord
::
Base
.
connection
.
execute
(
<<-
SQL
.
squish
)
A
pplicationRecord
.
connection
.
execute
(
<<-
SQL
.
squish
)
SELECT slot_name, database,
active,
#{
Gitlab
::
Database
.
pg_wal_lsn_diff
}
(
#{
Gitlab
::
Database
.
pg_current_wal_insert_lsn
}
(), restart_lsn)
AS retained_bytes
...
...
@@ -32,7 +32,7 @@ class PgReplicationSlot
# returns the max number WAL space (in bytes) being used across the replication slots
def
self
.
max_retained_wal
A
ctiveRecord
::
Base
.
connection
.
execute
(
<<-
SQL
.
squish
)
A
pplicationRecord
.
connection
.
execute
(
<<-
SQL
.
squish
)
SELECT COALESCE(MAX(
#{
Gitlab
::
Database
.
pg_wal_lsn_diff
}
(
#{
Gitlab
::
Database
.
pg_current_wal_insert_lsn
}
(), restart_lsn)), 0)
FROM pg_replication_slots;
SQL
...
...
@@ -40,7 +40,7 @@ class PgReplicationSlot
end
def
self
.
max_replication_slots
A
ctiveRecord
::
Base
.
connection
.
execute
(
<<-
SQL
.
squish
)
A
pplicationRecord
.
connection
.
execute
(
<<-
SQL
.
squish
)
SELECT setting FROM pg_settings WHERE name = 'max_replication_slots';
SQL
.
first
&
.
fetch
(
'setting'
).
to_i
...
...
ee/app/models/plan.rb
View file @
0f897538
# frozen_string_literal: true
class
Plan
<
A
ctiveRecord
::
Base
class
Plan
<
A
pplicationRecord
PAID_HOSTED_PLANS
=
%w[bronze silver gold]
.
freeze
ALL_HOSTED_PLANS
=
(
PAID_HOSTED_PLANS
+
[
'early_adopter'
]).
freeze
...
...
ee/app/models/project_feature_usage.rb
View file @
0f897538
# frozen_string_literal: true
class
ProjectFeatureUsage
<
A
ctiveRecord
::
Base
class
ProjectFeatureUsage
<
A
pplicationRecord
self
.
primary_key
=
:project_id
JIRA_DVCS_CLOUD_FIELD
=
'jira_dvcs_cloud_last_sync_at'
.
freeze
...
...
ee/app/models/project_repository_state.rb
View file @
0f897538
# frozen_string_literal: true
class
ProjectRepositoryState
<
A
ctiveRecord
::
Base
class
ProjectRepositoryState
<
A
pplicationRecord
include
IgnorableColumn
include
ShaAttribute
...
...
ee/app/models/project_tracing_setting.rb
View file @
0f897538
# frozen_string_literal: true
class
ProjectTracingSetting
<
A
ctiveRecord
::
Base
class
ProjectTracingSetting
<
A
pplicationRecord
belongs_to
:project
validates
:external_url
,
length:
{
maximum:
255
},
public_url:
true
...
...
ee/app/models/prometheus_alert.rb
View file @
0f897538
# frozen_string_literal: true
class
PrometheusAlert
<
A
ctiveRecord
::
Base
class
PrometheusAlert
<
A
pplicationRecord
include
Sortable
OPERATORS_MAP
=
{
...
...
ee/app/models/prometheus_alert_event.rb
View file @
0f897538
# frozen_string_literal: true
class
PrometheusAlertEvent
<
A
ctiveRecord
::
Base
class
PrometheusAlertEvent
<
A
pplicationRecord
belongs_to
:project
,
required:
true
,
validate:
true
,
inverse_of: :prometheus_alert_events
belongs_to
:prometheus_alert
,
required:
true
,
validate:
true
,
inverse_of: :prometheus_alert_events
...
...
ee/app/models/protected_branch/unprotect_access_level.rb
View file @
0f897538
# frozen_string_literal: true
class
ProtectedBranch::UnprotectAccessLevel
<
A
ctiveRecord
::
Base
class
ProtectedBranch::UnprotectAccessLevel
<
A
pplicationRecord
include
ProtectedBranchAccess
end
ee/app/models/protected_environment.rb
View file @
0f897538
# frozen_string_literal: true
class
ProtectedEnvironment
<
A
ctiveRecord
::
Base
class
ProtectedEnvironment
<
A
pplicationRecord
include
::
Gitlab
::
Utils
::
StrongMemoize
belongs_to
:project
...
...
ee/app/models/protected_environment/deploy_access_level.rb
View file @
0f897538
# frozen_string_literal: true
class
ProtectedEnvironment::DeployAccessLevel
<
A
ctiveRecord
::
Base
class
ProtectedEnvironment::DeployAccessLevel
<
A
pplicationRecord
ALLOWED_ACCESS_LEVELS
=
[
Gitlab
::
Access
::
MAINTAINER
,
Gitlab
::
Access
::
DEVELOPER
,
...
...
ee/app/models/push_rule.rb
View file @
0f897538
# frozen_string_literal: true
class
PushRule
<
A
ctiveRecord
::
Base
class
PushRule
<
A
pplicationRecord
extend
Gitlab
::
Cache
::
RequestCache
request_cache_key
do
...
...
ee/app/models/saml_provider.rb
View file @
0f897538
# frozen_string_literal: true
class
SamlProvider
<
A
ctiveRecord
::
Base
class
SamlProvider
<
A
pplicationRecord
USER_ATTRIBUTES_LOCKED_FOR_MANAGED_ACCOUNTS
=
%i(email public_email commit_email notification_email)
.
freeze
belongs_to
:group
...
...
ee/app/models/slack_integration.rb
View file @
0f897538
# frozen_string_literal: true
class
SlackIntegration
<
A
ctiveRecord
::
Base
class
SlackIntegration
<
A
pplicationRecord
belongs_to
:service
validates
:team_id
,
presence:
true
...
...
ee/app/models/smartcard_identity.rb
View file @
0f897538
# frozen_string_literal: true
class
SmartcardIdentity
<
A
ctiveRecord
::
Base
class
SmartcardIdentity
<
A
pplicationRecord
belongs_to
:user
validates
:user
,
...
...
ee/app/models/software_license.rb
View file @
0f897538
...
...
@@ -2,7 +2,7 @@
# This class represents a software license.
# For use in the License Management feature.
class
SoftwareLicense
<
A
ctiveRecord
::
Base
class
SoftwareLicense
<
A
pplicationRecord
include
Presentable
validates
:name
,
presence:
true
...
...
ee/app/models/software_license_policy.rb
View file @
0f897538
...
...
@@ -3,7 +3,7 @@
# This class represents a software license policy. Which means the fact that the user
# approves or not of the use of a certain software license in their project.
# For use in the License Management feature.
class
SoftwareLicensePolicy
<
A
ctiveRecord
::
Base
class
SoftwareLicensePolicy
<
A
pplicationRecord
include
Presentable
# Only allows modification of the approval status
...
...
ee/app/models/users_ops_dashboard_project.rb
View file @
0f897538
# frozen_string_literal: true
class
UsersOpsDashboardProject
<
A
ctiveRecord
::
Base
class
UsersOpsDashboardProject
<
A
pplicationRecord
belongs_to
:project
belongs_to
:user
...
...
ee/app/models/vulnerabilities/feedback.rb
View file @
0f897538
# frozen_string_literal: true
module
Vulnerabilities
class
Feedback
<
A
ctiveRecord
::
Base
class
Feedback
<
A
pplicationRecord
self
.
table_name
=
'vulnerability_feedback'
belongs_to
:project
...
...
ee/app/models/vulnerabilities/identifier.rb
View file @
0f897538
# frozen_string_literal: true
module
Vulnerabilities
class
Identifier
<
A
ctiveRecord
::
Base
class
Identifier
<
A
pplicationRecord
include
ShaAttribute
self
.
table_name
=
"vulnerability_identifiers"
...
...
ee/app/models/vulnerabilities/occurrence.rb
View file @
0f897538
# frozen_string_literal: true
module
Vulnerabilities
class
Occurrence
<
A
ctiveRecord
::
Base
class
Occurrence
<
A
pplicationRecord
include
ShaAttribute
include
::
Gitlab
::
Utils
::
StrongMemoize
...
...
ee/app/models/vulnerabilities/occurrence_identifier.rb
View file @
0f897538
# frozen_string_literal: true
module
Vulnerabilities
class
OccurrenceIdentifier
<
A
ctiveRecord
::
Base
class
OccurrenceIdentifier
<
A
pplicationRecord
self
.
table_name
=
"vulnerability_occurrence_identifiers"
belongs_to
:occurrence
,
class_name:
'Vulnerabilities::Occurrence'
...
...
ee/app/models/vulnerabilities/occurrence_pipeline.rb
View file @
0f897538
# frozen_string_literal: true
module
Vulnerabilities
class
OccurrencePipeline
<
A
ctiveRecord
::
Base
class
OccurrencePipeline
<
A
pplicationRecord
self
.
table_name
=
"vulnerability_occurrence_pipelines"
belongs_to
:occurrence
,
class_name:
'Vulnerabilities::Occurrence'
...
...
ee/app/models/vulnerabilities/scanner.rb
View file @
0f897538
# frozen_string_literal: true
module
Vulnerabilities
class
Scanner
<
A
ctiveRecord
::
Base
class
Scanner
<
A
pplicationRecord
self
.
table_name
=
"vulnerability_scanners"
has_many
:occurrences
,
class_name:
'Vulnerabilities::Occurrence'
...
...
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