Commit 7116c4ec authored by Nick Thomas's avatar Nick Thomas

Inherit from ApplicationRecord instead of ActiveRecord::Base

parent 3542a3c6
# frozen_string_literal: true # frozen_string_literal: true
class AbuseReport < ActiveRecord::Base class AbuseReport < ApplicationRecord
include CacheMarkdownField include CacheMarkdownField
cache_markdown_field :message, pipeline: :single_line cache_markdown_field :message, pipeline: :single_line
......
# frozen_string_literal: true # frozen_string_literal: true
class Appearance < ActiveRecord::Base class Appearance < ApplicationRecord
include CacheableAttributes include CacheableAttributes
include CacheMarkdownField include CacheMarkdownField
include ObjectStorage::BackgroundMove include ObjectStorage::BackgroundMove
......
# frozen_string_literal: true # frozen_string_literal: true
class ApplicationSetting < ActiveRecord::Base class ApplicationSetting < ApplicationRecord
include CacheableAttributes include CacheableAttributes
include CacheMarkdownField include CacheMarkdownField
include TokenAuthenticatable include TokenAuthenticatable
......
# frozen_string_literal: true # frozen_string_literal: true
class ApplicationSetting class ApplicationSetting
class Term < ActiveRecord::Base class Term < ApplicationRecord
include CacheMarkdownField include CacheMarkdownField
has_many :term_agreements has_many :term_agreements
......
# frozen_string_literal: true # frozen_string_literal: true
class AuditEvent < ActiveRecord::Base class AuditEvent < ApplicationRecord
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
belongs_to :user, foreign_key: :author_id belongs_to :user, foreign_key: :author_id
......
# frozen_string_literal: true # frozen_string_literal: true
class AwardEmoji < ActiveRecord::Base class AwardEmoji < ApplicationRecord
DOWNVOTE_NAME = "thumbsdown".freeze DOWNVOTE_NAME = "thumbsdown".freeze
UPVOTE_NAME = "thumbsup".freeze UPVOTE_NAME = "thumbsup".freeze
......
# frozen_string_literal: true # frozen_string_literal: true
class Badge < ActiveRecord::Base class Badge < ApplicationRecord
include FromUnion include FromUnion
# This structure sets the placeholders that the urls # This structure sets the placeholders that the urls
......
# frozen_string_literal: true # frozen_string_literal: true
class Board < ActiveRecord::Base class Board < ApplicationRecord
belongs_to :group belongs_to :group
belongs_to :project belongs_to :project
......
# frozen_string_literal: true # frozen_string_literal: true
# Tracks which boards in a specific group a user has visited # Tracks which boards in a specific group a user has visited
class BoardGroupRecentVisit < ActiveRecord::Base class BoardGroupRecentVisit < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :group belongs_to :group
belongs_to :board belongs_to :board
......
# frozen_string_literal: true # frozen_string_literal: true
# Tracks which boards in a specific project a user has visited # Tracks which boards in a specific project a user has visited
class BoardProjectRecentVisit < ActiveRecord::Base class BoardProjectRecentVisit < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :project belongs_to :project
belongs_to :board belongs_to :board
......
# frozen_string_literal: true # frozen_string_literal: true
class BroadcastMessage < ActiveRecord::Base class BroadcastMessage < ApplicationRecord
include CacheMarkdownField include CacheMarkdownField
include Sortable include Sortable
......
# frozen_string_literal: true # frozen_string_literal: true
class ChatName < ActiveRecord::Base class ChatName < ApplicationRecord
LAST_USED_AT_INTERVAL = 1.hour LAST_USED_AT_INTERVAL = 1.hour
belongs_to :service belongs_to :service
......
# frozen_string_literal: true # frozen_string_literal: true
class ChatTeam < ActiveRecord::Base class ChatTeam < ApplicationRecord
validates :team_id, presence: true validates :team_id, presence: true
validates :namespace, uniqueness: true validates :namespace, uniqueness: true
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Ci module Ci
# The purpose of this class is to store Build related data that can be disposed. # 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. # Data that should be persisted forever, should be stored with Ci::Build model.
class BuildMetadata < ActiveRecord::Base class BuildMetadata < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include Presentable include Presentable
include ChronicDurationAttribute include ChronicDurationAttribute
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Ci module Ci
# The purpose of this class is to store Build related runner session. # The purpose of this class is to store Build related runner session.
# Data will be removed after transitioning from running to any state. # Data will be removed after transitioning from running to any state.
class BuildRunnerSession < ActiveRecord::Base class BuildRunnerSession < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
self.table_name = 'ci_builds_runner_session' self.table_name = 'ci_builds_runner_session'
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class BuildTraceChunk < ActiveRecord::Base class BuildTraceChunk < ApplicationRecord
include FastDestroyAll include FastDestroyAll
include ::Gitlab::ExclusiveLeaseHelpers include ::Gitlab::ExclusiveLeaseHelpers
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class BuildTraceSection < ActiveRecord::Base class BuildTraceSection < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
belongs_to :build, class_name: 'Ci::Build' belongs_to :build, class_name: 'Ci::Build'
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class BuildTraceSectionName < ActiveRecord::Base class BuildTraceSectionName < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
belongs_to :project belongs_to :project
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class GroupVariable < ActiveRecord::Base class GroupVariable < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include HasVariable include HasVariable
include Presentable include Presentable
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class JobArtifact < ActiveRecord::Base class JobArtifact < ApplicationRecord
include AfterCommitQueue include AfterCommitQueue
include ObjectStorage::BackgroundMove include ObjectStorage::BackgroundMove
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class Pipeline < ActiveRecord::Base class Pipeline < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include HasStatus include HasStatus
include Importable include Importable
...@@ -184,7 +184,7 @@ module Ci ...@@ -184,7 +184,7 @@ module Ci
scope :sort_by_merge_request_pipelines, -> do scope :sort_by_merge_request_pipelines, -> do
sql = 'CASE ci_pipelines.source WHEN (?) THEN 0 ELSE 1 END, ci_pipelines.id DESC' sql = 'CASE ci_pipelines.source WHEN (?) THEN 0 ELSE 1 END, ci_pipelines.id DESC'
query = ActiveRecord::Base.send(:sanitize_sql_array, [sql, sources[:merge_request_event]]) # rubocop:disable GitlabSecurity/PublicSend query = ApplicationRecord.send(:sanitize_sql_array, [sql, sources[:merge_request_event]]) # rubocop:disable GitlabSecurity/PublicSend
order(query) order(query)
end end
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class PipelineChatData < ActiveRecord::Base class PipelineChatData < ApplicationRecord
self.table_name = 'ci_pipeline_chat_data' self.table_name = 'ci_pipeline_chat_data'
belongs_to :chat_name belongs_to :chat_name
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class PipelineSchedule < ActiveRecord::Base class PipelineSchedule < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include Importable include Importable
include IgnorableColumn include IgnorableColumn
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class PipelineScheduleVariable < ActiveRecord::Base class PipelineScheduleVariable < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include HasVariable include HasVariable
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class PipelineVariable < ActiveRecord::Base class PipelineVariable < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include HasVariable include HasVariable
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class Runner < ActiveRecord::Base class Runner < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include Gitlab::SQL::Pattern include Gitlab::SQL::Pattern
include IgnorableColumn include IgnorableColumn
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class RunnerNamespace < ActiveRecord::Base class RunnerNamespace < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
belongs_to :runner, inverse_of: :runner_namespaces, validate: true belongs_to :runner, inverse_of: :runner_namespaces, validate: true
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class RunnerProject < ActiveRecord::Base class RunnerProject < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
belongs_to :runner, inverse_of: :runner_projects belongs_to :runner, inverse_of: :runner_projects
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class Stage < ActiveRecord::Base class Stage < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include Importable include Importable
include HasStatus include HasStatus
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class Trigger < ActiveRecord::Base class Trigger < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include IgnorableColumn include IgnorableColumn
include Presentable include Presentable
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class TriggerRequest < ActiveRecord::Base class TriggerRequest < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
belongs_to :trigger belongs_to :trigger
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class Variable < ActiveRecord::Base class Variable < ApplicationRecord
extend Gitlab::Ci::Model extend Gitlab::Ci::Model
include HasVariable include HasVariable
include Presentable include Presentable
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class CertManager < ActiveRecord::Base class CertManager < ApplicationRecord
VERSION = 'v0.5.2'.freeze VERSION = 'v0.5.2'.freeze
self.table_name = 'clusters_applications_cert_managers' self.table_name = 'clusters_applications_cert_managers'
......
...@@ -4,7 +4,7 @@ require 'openssl' ...@@ -4,7 +4,7 @@ require 'openssl'
module Clusters module Clusters
module Applications module Applications
class Helm < ActiveRecord::Base class Helm < ApplicationRecord
self.table_name = 'clusters_applications_helm' self.table_name = 'clusters_applications_helm'
attr_encrypted :ca_key, attr_encrypted :ca_key,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class Ingress < ActiveRecord::Base class Ingress < ApplicationRecord
VERSION = '1.1.2'.freeze VERSION = '1.1.2'.freeze
self.table_name = 'clusters_applications_ingress' self.table_name = 'clusters_applications_ingress'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class Jupyter < ActiveRecord::Base class Jupyter < ApplicationRecord
VERSION = '0.9-174bbd5'.freeze VERSION = '0.9-174bbd5'.freeze
self.table_name = 'clusters_applications_jupyter' self.table_name = 'clusters_applications_jupyter'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class Knative < ActiveRecord::Base class Knative < ApplicationRecord
VERSION = '0.3.0'.freeze VERSION = '0.3.0'.freeze
REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts'.freeze REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts'.freeze
METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'.freeze METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'.freeze
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class Prometheus < ActiveRecord::Base class Prometheus < ApplicationRecord
include PrometheusAdapter include PrometheusAdapter
VERSION = '6.7.3' VERSION = '6.7.3'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class Runner < ActiveRecord::Base class Runner < ApplicationRecord
VERSION = '0.3.0'.freeze VERSION = '0.3.0'.freeze
self.table_name = 'clusters_applications_runners' self.table_name = 'clusters_applications_runners'
......
# frozen_string_literal: true # frozen_string_literal: true
module Clusters module Clusters
class Cluster < ActiveRecord::Base class Cluster < ApplicationRecord
include Presentable include Presentable
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
include FromUnion include FromUnion
......
# frozen_string_literal: true # frozen_string_literal: true
module Clusters module Clusters
class Group < ActiveRecord::Base class Group < ApplicationRecord
self.table_name = 'cluster_groups' self.table_name = 'cluster_groups'
belongs_to :cluster, class_name: 'Clusters::Cluster' belongs_to :cluster, class_name: 'Clusters::Cluster'
......
# frozen_string_literal: true # frozen_string_literal: true
module Clusters module Clusters
class KubernetesNamespace < ActiveRecord::Base class KubernetesNamespace < ApplicationRecord
include Gitlab::Kubernetes include Gitlab::Kubernetes
self.table_name = 'clusters_kubernetes_namespaces' self.table_name = 'clusters_kubernetes_namespaces'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Platforms module Platforms
class Kubernetes < ActiveRecord::Base class Kubernetes < ApplicationRecord
include Gitlab::Kubernetes include Gitlab::Kubernetes
include ReactiveCaching include ReactiveCaching
include EnumWithNil include EnumWithNil
......
# frozen_string_literal: true # frozen_string_literal: true
module Clusters module Clusters
class Project < ActiveRecord::Base class Project < ApplicationRecord
self.table_name = 'cluster_projects' self.table_name = 'cluster_projects'
belongs_to :cluster, class_name: 'Clusters::Cluster' belongs_to :cluster, class_name: 'Clusters::Cluster'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Providers module Providers
class Gcp < ActiveRecord::Base class Gcp < ApplicationRecord
self.table_name = 'cluster_providers_gcp' self.table_name = 'cluster_providers_gcp'
belongs_to :cluster, inverse_of: :provider_gcp, class_name: 'Clusters::Cluster' belongs_to :cluster, inverse_of: :provider_gcp, class_name: 'Clusters::Cluster'
......
# frozen_string_literal: true # frozen_string_literal: true
class CommitStatus < ActiveRecord::Base class CommitStatus < ApplicationRecord
include HasStatus include HasStatus
include Importable include Importable
include AfterCommitQueue include AfterCommitQueue
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# For example, let's generate internal ids for Issue per Project: # For example, let's generate internal ids for Issue per Project:
# ``` # ```
# class Issue < ActiveRecord::Base # class Issue < ApplicationRecord
# has_internal_id :iid, scope: :project, init: ->(s) { s.project.issues.maximum(:iid) } # has_internal_id :iid, scope: :project, init: ->(s) { s.project.issues.maximum(:iid) }
# end # end
# ``` # ```
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# #
# Example: # Example:
# #
# class User < ActiveRecord::Base # class User < ApplicationRecord
# include IgnorableColumn # include IgnorableColumn
# #
# ignore_column :updated_at # ignore_column :updated_at
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# Usage: # Usage:
# #
# class Issue < ActiveRecord::Base # class Issue < ApplicationRecord
# include Participable # include Participable
# #
# # ... # # ...
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# Example of use: # Example of use:
# #
# class Foo < ActiveRecord::Base # class Foo < ApplicationRecord
# include ReactiveCaching # include ReactiveCaching
# #
# self.reactive_cache_key = ->(thing) { ["foo", thing.id] } # self.reactive_cache_key = ->(thing) { ["foo", thing.id] }
......
...@@ -39,7 +39,7 @@ module ShaAttribute ...@@ -39,7 +39,7 @@ module ShaAttribute
end end
def database_exists? def database_exists?
ActiveRecord::Base.connection ApplicationRecord.connection
true true
rescue rescue
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# #
# Usage: # Usage:
# #
# class Milestone < ActiveRecord::Base # class Milestone < ApplicationRecord
# strip_attributes :title # strip_attributes :title
# end # end
# #
......
# frozen_string_literal: true # frozen_string_literal: true
class ContainerRepository < ActiveRecord::Base class ContainerRepository < ApplicationRecord
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
belongs_to :project belongs_to :project
......
# frozen_string_literal: true # frozen_string_literal: true
module ConversationalDevelopmentIndex module ConversationalDevelopmentIndex
class Metric < ActiveRecord::Base class Metric < ApplicationRecord
include Presentable include Presentable
self.table_name = 'conversational_development_index_metrics' self.table_name = 'conversational_development_index_metrics'
......
# frozen_string_literal: true # frozen_string_literal: true
class DeployKeysProject < ActiveRecord::Base class DeployKeysProject < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :deploy_key, inverse_of: :deploy_keys_projects belongs_to :deploy_key, inverse_of: :deploy_keys_projects
......
# frozen_string_literal: true # frozen_string_literal: true
class DeployToken < ActiveRecord::Base class DeployToken < ApplicationRecord
include Expirable include Expirable
include TokenAuthenticatable include TokenAuthenticatable
include PolicyActor include PolicyActor
......
# frozen_string_literal: true # frozen_string_literal: true
class Deployment < ActiveRecord::Base class Deployment < ApplicationRecord
include AtomicInternalId include AtomicInternalId
include IidRoutes include IidRoutes
include AfterCommitQueue include AfterCommitQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class Email < ActiveRecord::Base class Email < ApplicationRecord
include Sortable include Sortable
include Gitlab::SQL::Pattern include Gitlab::SQL::Pattern
......
# frozen_string_literal: true # frozen_string_literal: true
class Environment < ActiveRecord::Base class Environment < ApplicationRecord
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
# Used to generate random suffixes for the slug # Used to generate random suffixes for the slug
LETTERS = 'a'..'z' LETTERS = 'a'..'z'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Placeholder class for model that is implemented in EE # Placeholder class for model that is implemented in EE
# It reserves '&' as a reference prefix, but the table does not exists in CE # It reserves '&' as a reference prefix, but the table does not exists in CE
class Epic < ActiveRecord::Base class Epic < ApplicationRecord
def self.link_reference_pattern def self.link_reference_pattern
nil nil
end end
......
# frozen_string_literal: true # frozen_string_literal: true
module ErrorTracking module ErrorTracking
class ProjectErrorTrackingSetting < ActiveRecord::Base class ProjectErrorTrackingSetting < ApplicationRecord
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
include ReactiveCaching include ReactiveCaching
......
# frozen_string_literal: true # frozen_string_literal: true
class Event < ActiveRecord::Base class Event < ApplicationRecord
include Sortable include Sortable
include IgnorableColumn include IgnorableColumn
include FromUnion include FromUnion
......
# frozen_string_literal: true # frozen_string_literal: true
class ForkNetwork < ActiveRecord::Base class ForkNetwork < ApplicationRecord
belongs_to :root_project, class_name: 'Project' belongs_to :root_project, class_name: 'Project'
has_many :fork_network_members has_many :fork_network_members
has_many :projects, through: :fork_network_members has_many :projects, through: :fork_network_members
......
# frozen_string_literal: true # frozen_string_literal: true
class ForkNetworkMember < ActiveRecord::Base class ForkNetworkMember < ApplicationRecord
belongs_to :fork_network belongs_to :fork_network
belongs_to :project belongs_to :project
belongs_to :forked_from_project, class_name: 'Project' belongs_to :forked_from_project, class_name: 'Project'
......
# frozen_string_literal: true # frozen_string_literal: true
class GpgKey < ActiveRecord::Base class GpgKey < ApplicationRecord
KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze
KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'.freeze KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'.freeze
......
# frozen_string_literal: true # frozen_string_literal: true
class GpgKeySubkey < ActiveRecord::Base class GpgKeySubkey < ApplicationRecord
include ShaAttribute include ShaAttribute
sha_attribute :keyid sha_attribute :keyid
......
# frozen_string_literal: true # frozen_string_literal: true
class GroupCustomAttribute < ActiveRecord::Base class GroupCustomAttribute < ApplicationRecord
belongs_to :group belongs_to :group
validates :group, :key, :value, presence: true validates :group, :key, :value, presence: true
......
# frozen_string_literal: true # frozen_string_literal: true
class WebHook < ActiveRecord::Base class WebHook < ApplicationRecord
include Sortable include Sortable
attr_encrypted :token, attr_encrypted :token,
......
# frozen_string_literal: true # frozen_string_literal: true
class WebHookLog < ActiveRecord::Base class WebHookLog < ApplicationRecord
belongs_to :web_hook belongs_to :web_hook
serialize :request_headers, Hash # rubocop:disable Cop/ActiveRecordSerialize serialize :request_headers, Hash # rubocop:disable Cop/ActiveRecordSerialize
......
# frozen_string_literal: true # frozen_string_literal: true
class Identity < ActiveRecord::Base class Identity < ApplicationRecord
include Sortable include Sortable
include CaseSensitivity include CaseSensitivity
......
# frozen_string_literal: true # frozen_string_literal: true
class Identity < ActiveRecord::Base class Identity < ApplicationRecord
# This module and method are defined in a separate file to allow EE to # 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. # redefine the `scopes` method before it is used in the `Identity` model.
module UniquenessScopes module UniquenessScopes
......
# frozen_string_literal: true # frozen_string_literal: true
class ImportExportUpload < ActiveRecord::Base class ImportExportUpload < ApplicationRecord
include WithUploads include WithUploads
include ObjectStorage::BackgroundMove include ObjectStorage::BackgroundMove
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# In order to leverage InternalId for other usages, the idea is to # In order to leverage InternalId for other usages, the idea is to
# * Add `usage` value to enum # * Add `usage` value to enum
# * (Optionally) add columns to `internal_ids` if needed for scope. # * (Optionally) add columns to `internal_ids` if needed for scope.
class InternalId < ActiveRecord::Base class InternalId < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :namespace belongs_to :namespace
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
class Issue < ActiveRecord::Base class Issue < ApplicationRecord
include AtomicInternalId include AtomicInternalId
include IidRoutes include IidRoutes
include Issuable include Issuable
......
# frozen_string_literal: true # frozen_string_literal: true
class Issue::Metrics < ActiveRecord::Base class Issue::Metrics < ApplicationRecord
belongs_to :issue belongs_to :issue
def record! def record!
......
# frozen_string_literal: true # frozen_string_literal: true
class IssueAssignee < ActiveRecord::Base class IssueAssignee < ApplicationRecord
belongs_to :issue belongs_to :issue
belongs_to :assignee, class_name: "User", foreign_key: :user_id belongs_to :assignee, class_name: "User", foreign_key: :user_id
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'digest/md5' require 'digest/md5'
class Key < ActiveRecord::Base class Key < ApplicationRecord
include AfterCommitQueue include AfterCommitQueue
include Sortable include Sortable
......
# frozen_string_literal: true # frozen_string_literal: true
class Label < ActiveRecord::Base class Label < ApplicationRecord
include CacheMarkdownField include CacheMarkdownField
include Referable include Referable
include Subscribable include Subscribable
......
# frozen_string_literal: true # frozen_string_literal: true
class LabelLink < ActiveRecord::Base class LabelLink < ApplicationRecord
include Importable include Importable
belongs_to :target, polymorphic: true, inverse_of: :label_links # rubocop:disable Cop/PolymorphicAssociations belongs_to :target, polymorphic: true, inverse_of: :label_links # rubocop:disable Cop/PolymorphicAssociations
......
# frozen_string_literal: true # frozen_string_literal: true
class LabelPriority < ActiveRecord::Base class LabelPriority < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :label belongs_to :label
......
# frozen_string_literal: true # frozen_string_literal: true
class LfsFileLock < ActiveRecord::Base class LfsFileLock < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :user belongs_to :user
......
# frozen_string_literal: true # frozen_string_literal: true
class LfsObject < ActiveRecord::Base class LfsObject < ApplicationRecord
include AfterCommitQueue include AfterCommitQueue
include ObjectStorage::BackgroundMove include ObjectStorage::BackgroundMove
......
# frozen_string_literal: true # frozen_string_literal: true
class LfsObjectsProject < ActiveRecord::Base class LfsObjectsProject < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :lfs_object belongs_to :lfs_object
......
# frozen_string_literal: true # frozen_string_literal: true
class List < ActiveRecord::Base class List < ApplicationRecord
prepend ::EE::List # rubocop: disable Cop/InjectEnterpriseEditionModule prepend ::EE::List # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :board belongs_to :board
......
# frozen_string_literal: true # frozen_string_literal: true
class Member < ActiveRecord::Base class Member < ApplicationRecord
include AfterCommitQueue include AfterCommitQueue
include Sortable include Sortable
include Importable include Importable
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequest < ActiveRecord::Base class MergeRequest < ApplicationRecord
include AtomicInternalId include AtomicInternalId
include IidRoutes include IidRoutes
include Issuable include Issuable
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequest::Metrics < ActiveRecord::Base class MergeRequest::Metrics < ApplicationRecord
belongs_to :merge_request belongs_to :merge_request
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :pipeline_id
belongs_to :latest_closed_by, class_name: 'User' belongs_to :latest_closed_by, class_name: 'User'
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequestDiff < ActiveRecord::Base class MergeRequestDiff < ApplicationRecord
include Sortable include Sortable
include Importable include Importable
include ManualInverseAssociation include ManualInverseAssociation
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequestDiffCommit < ActiveRecord::Base class MergeRequestDiffCommit < ApplicationRecord
include ShaAttribute include ShaAttribute
belongs_to :merge_request_diff belongs_to :merge_request_diff
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequestDiffFile < ActiveRecord::Base class MergeRequestDiffFile < ApplicationRecord
include Gitlab::EncodingHelper include Gitlab::EncodingHelper
include DiffFile include DiffFile
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequestsClosingIssues < ActiveRecord::Base class MergeRequestsClosingIssues < ApplicationRecord
belongs_to :merge_request belongs_to :merge_request
belongs_to :issue belongs_to :issue
......
# frozen_string_literal: true # frozen_string_literal: true
class Milestone < ActiveRecord::Base class Milestone < ApplicationRecord
# Represents a "No Milestone" state used for filtering Issues and Merge # Represents a "No Milestone" state used for filtering Issues and Merge
# Requests that have no milestone assigned. # Requests that have no milestone assigned.
MilestoneStruct = Struct.new(:title, :name, :id) MilestoneStruct = Struct.new(:title, :name, :id)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# A note on the root of an issue, merge request, commit, or snippet. # A note on the root of an issue, merge request, commit, or snippet.
# #
# A note of this type is never resolvable. # A note of this type is never resolvable.
class Note < ActiveRecord::Base class Note < ApplicationRecord
extend ActiveModel::Naming extend ActiveModel::Naming
include Participable include Participable
include Mentionable include Mentionable
......
# frozen_string_literal: true # frozen_string_literal: true
class NoteDiffFile < ActiveRecord::Base class NoteDiffFile < ApplicationRecord
include DiffFile include DiffFile
scope :for_commit_or_unresolved, -> do scope :for_commit_or_unresolved, -> do
......
# frozen_string_literal: true # frozen_string_literal: true
class NotificationSetting < ActiveRecord::Base class NotificationSetting < ApplicationRecord
include IgnorableColumn include IgnorableColumn
ignore_column :events ignore_column :events
......
# frozen_string_literal: true # frozen_string_literal: true
class PagesDomain < ActiveRecord::Base class PagesDomain < ApplicationRecord
VERIFICATION_KEY = 'gitlab-pages-verification-code'.freeze VERIFICATION_KEY = 'gitlab-pages-verification-code'.freeze
VERIFICATION_THRESHOLD = 3.days.freeze VERIFICATION_THRESHOLD = 3.days.freeze
......
# frozen_string_literal: true # frozen_string_literal: true
class PersonalAccessToken < ActiveRecord::Base class PersonalAccessToken < ApplicationRecord
include Expirable include Expirable
include IgnorableColumn include IgnorableColumn
include TokenAuthenticatable include TokenAuthenticatable
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# The PoolRepository model is the database equivalent of an ObjectPool for Gitaly # The PoolRepository model is the database equivalent of an ObjectPool for Gitaly
# That is; PoolRepository is the record in the database, ObjectPool is the # That is; PoolRepository is the record in the database, ObjectPool is the
# repository on disk # repository on disk
class PoolRepository < ActiveRecord::Base class PoolRepository < ApplicationRecord
include Shardable include Shardable
include AfterCommitQueue include AfterCommitQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Postgresql module Postgresql
class ReplicationSlot < ActiveRecord::Base class ReplicationSlot < ApplicationRecord
self.table_name = 'pg_replication_slots' self.table_name = 'pg_replication_slots'
# Returns true if there are any replication slots in use. # Returns true if there are any replication slots in use.
......
# frozen_string_literal: true # frozen_string_literal: true
class ProgrammingLanguage < ActiveRecord::Base class ProgrammingLanguage < ApplicationRecord
validates :name, presence: true validates :name, presence: true
validates :color, allow_blank: false, color: true validates :color, allow_blank: false, color: true
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
class Project < ActiveRecord::Base class Project < ApplicationRecord
include Gitlab::ConfigHelper include Gitlab::ConfigHelper
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
include Gitlab::VisibilityLevel include Gitlab::VisibilityLevel
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectAuthorization < ActiveRecord::Base class ProjectAuthorization < ApplicationRecord
include FromUnion include FromUnion
prepend ::EE::ProjectAuthorization # rubocop: disable Cop/InjectEnterpriseEditionModule prepend ::EE::ProjectAuthorization # rubocop: disable Cop/InjectEnterpriseEditionModule
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectAutoDevops < ActiveRecord::Base class ProjectAutoDevops < ApplicationRecord
belongs_to :project belongs_to :project
enum deploy_strategy: { enum deploy_strategy: {
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectCiCdSetting < ActiveRecord::Base class ProjectCiCdSetting < ApplicationRecord
belongs_to :project, inverse_of: :ci_cd_settings belongs_to :project, inverse_of: :ci_cd_settings
# The version of the schema that first introduced this model/table. # The version of the schema that first introduced this model/table.
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectCustomAttribute < ActiveRecord::Base class ProjectCustomAttribute < ApplicationRecord
belongs_to :project belongs_to :project
validates :project, :key, :value, presence: true validates :project, :key, :value, presence: true
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectDailyStatistic < ActiveRecord::Base class ProjectDailyStatistic < ApplicationRecord
belongs_to :project belongs_to :project
scope :of_project, -> (project) { where(project: project) } scope :of_project, -> (project) { where(project: project) }
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectDeployToken < ActiveRecord::Base class ProjectDeployToken < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :deploy_token, inverse_of: :project_deploy_tokens belongs_to :deploy_token, inverse_of: :project_deploy_tokens
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectFeature < ActiveRecord::Base class ProjectFeature < ApplicationRecord
# == Project features permissions # == Project features permissions
# #
# Grants access level to project tools # Grants access level to project tools
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectGroupLink < ActiveRecord::Base class ProjectGroupLink < ApplicationRecord
include Expirable include Expirable
GUEST = 10 GUEST = 10
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
class ProjectImportData < ActiveRecord::Base class ProjectImportData < ApplicationRecord
prepend ::EE::ProjectImportData # rubocop: disable Cop/InjectEnterpriseEditionModule prepend ::EE::ProjectImportData # rubocop: disable Cop/InjectEnterpriseEditionModule
belongs_to :project, inverse_of: :import_data belongs_to :project, inverse_of: :import_data
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectImportState < ActiveRecord::Base class ProjectImportState < ApplicationRecord
include AfterCommitQueue include AfterCommitQueue
self.table_name = "project_mirror_data" self.table_name = "project_mirror_data"
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectRepository < ActiveRecord::Base class ProjectRepository < ApplicationRecord
include Shardable include Shardable
belongs_to :project, inverse_of: :project_repository belongs_to :project, inverse_of: :project_repository
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectStatistics < ActiveRecord::Base class ProjectStatistics < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :namespace belongs_to :namespace
......
# frozen_string_literal: true # frozen_string_literal: true
class PrometheusMetric < ActiveRecord::Base class PrometheusMetric < ApplicationRecord
belongs_to :project, validate: true, inverse_of: :prometheus_metrics belongs_to :project, validate: true, inverse_of: :prometheus_metrics
enum group: { enum group: {
......
# frozen_string_literal: true # frozen_string_literal: true
class ProtectedBranch < ActiveRecord::Base class ProtectedBranch < ApplicationRecord
include ProtectedRef include ProtectedRef
protected_ref_access_levels :merge, :push protected_ref_access_levels :merge, :push
......
# frozen_string_literal: true # frozen_string_literal: true
class ProtectedBranch::MergeAccessLevel < ActiveRecord::Base class ProtectedBranch::MergeAccessLevel < ApplicationRecord
include ProtectedBranchAccess include ProtectedBranchAccess
end end
# frozen_string_literal: true # frozen_string_literal: true
class ProtectedBranch::PushAccessLevel < ActiveRecord::Base class ProtectedBranch::PushAccessLevel < ApplicationRecord
include ProtectedBranchAccess include ProtectedBranchAccess
end end
# frozen_string_literal: true # frozen_string_literal: true
class ProtectedTag < ActiveRecord::Base class ProtectedTag < ApplicationRecord
include ProtectedRef include ProtectedRef
validates :name, uniqueness: { scope: :project_id } validates :name, uniqueness: { scope: :project_id }
......
# frozen_string_literal: true # frozen_string_literal: true
class ProtectedTag::CreateAccessLevel < ActiveRecord::Base class ProtectedTag::CreateAccessLevel < ApplicationRecord
include ProtectedTagAccess include ProtectedTagAccess
def check_access(user) def check_access(user)
......
# frozen_string_literal: true # frozen_string_literal: true
class PushEventPayload < ActiveRecord::Base class PushEventPayload < ApplicationRecord
include ShaAttribute include ShaAttribute
belongs_to :event, inverse_of: :push_event_payload belongs_to :event, inverse_of: :push_event_payload
......
# frozen_string_literal: true # frozen_string_literal: true
class RedirectRoute < ActiveRecord::Base class RedirectRoute < ApplicationRecord
belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
validates :source, presence: true validates :source, presence: true
......
# frozen_string_literal: true # frozen_string_literal: true
class Release < ActiveRecord::Base class Release < ApplicationRecord
include CacheMarkdownField include CacheMarkdownField
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true # frozen_string_literal: true
module Releases module Releases
class Link < ActiveRecord::Base class Link < ApplicationRecord
self.table_name = 'release_links' self.table_name = 'release_links'
belongs_to :release belongs_to :release
......
# frozen_string_literal: true # frozen_string_literal: true
class RemoteMirror < ActiveRecord::Base class RemoteMirror < ApplicationRecord
include AfterCommitQueue include AfterCommitQueue
include MirrorAuthentication include MirrorAuthentication
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryLanguage < ActiveRecord::Base class RepositoryLanguage < ApplicationRecord
belongs_to :project belongs_to :project
belongs_to :programming_language belongs_to :programming_language
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# This model is not used yet, it will be used for: # This model is not used yet, it will be used for:
# https://gitlab.com/gitlab-org/gitlab-ce/issues/48483 # https://gitlab.com/gitlab-org/gitlab-ce/issues/48483
class ResourceLabelEvent < ActiveRecord::Base class ResourceLabelEvent < ApplicationRecord
include Importable include Importable
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
include CacheMarkdownField include CacheMarkdownField
......
# frozen_string_literal: true # frozen_string_literal: true
class Route < ActiveRecord::Base class Route < ApplicationRecord
include CaseSensitivity include CaseSensitivity
belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
......
# frozen_string_literal: true # frozen_string_literal: true
class SentNotification < ActiveRecord::Base class SentNotification < ApplicationRecord
serialize :position, Gitlab::Diff::Position # rubocop:disable Cop/ActiveRecordSerialize serialize :position, Gitlab::Diff::Position # rubocop:disable Cop/ActiveRecordSerialize
belongs_to :project belongs_to :project
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# To add new service you should build a class inherited from Service # To add new service you should build a class inherited from Service
# and implement a set of methods # and implement a set of methods
class Service < ActiveRecord::Base class Service < ApplicationRecord
include Sortable include Sortable
include Importable include Importable
include ProjectServicesLoggable include ProjectServicesLoggable
......
# frozen_string_literal: true # frozen_string_literal: true
class Shard < ActiveRecord::Base class Shard < ApplicationRecord
# Store shard names from the configuration file in the database. This is not a # 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 # list of active shards - we just want to assign an immutable, unique ID to
# every shard name for easy indexing / referencing. # every shard name for easy indexing / referencing.
......
# frozen_string_literal: true # frozen_string_literal: true
class Snippet < ActiveRecord::Base class Snippet < ApplicationRecord
include Gitlab::VisibilityLevel include Gitlab::VisibilityLevel
include Redactable include Redactable
include CacheMarkdownField include CacheMarkdownField
......
# frozen_string_literal: true # frozen_string_literal: true
class SpamLog < ActiveRecord::Base class SpamLog < ApplicationRecord
belongs_to :user belongs_to :user
validates :user, presence: true validates :user, presence: true
......
# frozen_string_literal: true # frozen_string_literal: true
class Subscription < ActiveRecord::Base class Subscription < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :project belongs_to :project
belongs_to :subscribable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :subscribable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
......
# frozen_string_literal: true # frozen_string_literal: true
class SystemNoteMetadata < ActiveRecord::Base class SystemNoteMetadata < ApplicationRecord
# These notes's action text might contain a reference that is external. # These notes's action text might contain a reference that is external.
# We should always force a deep validation upon references that are found # We should always force a deep validation upon references that are found
# in this note type. # in this note type.
......
# frozen_string_literal: true # frozen_string_literal: true
class TermAgreement < ActiveRecord::Base class TermAgreement < ApplicationRecord
belongs_to :term, class_name: 'ApplicationSetting::Term' belongs_to :term, class_name: 'ApplicationSetting::Term'
belongs_to :user belongs_to :user
......
# frozen_string_literal: true # frozen_string_literal: true
class Timelog < ActiveRecord::Base class Timelog < ApplicationRecord
validates :time_spent, :user, presence: true validates :time_spent, :user, presence: true
validate :issuable_id_is_present validate :issuable_id_is_present
......
# frozen_string_literal: true # frozen_string_literal: true
class Todo < ActiveRecord::Base class Todo < ApplicationRecord
include Sortable include Sortable
include FromUnion include FromUnion
......
# frozen_string_literal: true # frozen_string_literal: true
class TrendingProject < ActiveRecord::Base class TrendingProject < ApplicationRecord
belongs_to :project belongs_to :project
# The number of months to include in the trending calculation. # The number of months to include in the trending calculation.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Registration information for U2F (universal 2nd factor) devices, like Yubikeys # Registration information for U2F (universal 2nd factor) devices, like Yubikeys
class U2fRegistration < ActiveRecord::Base class U2fRegistration < ApplicationRecord
belongs_to :user belongs_to :user
def self.register(user, app_id, params, challenges) def self.register(user, app_id, params, challenges)
......
# frozen_string_literal: true # frozen_string_literal: true
class Upload < ActiveRecord::Base class Upload < ApplicationRecord
# Upper limit for foreground checksum processing # Upper limit for foreground checksum processing
CHECKSUM_THRESHOLD = 100.megabytes CHECKSUM_THRESHOLD = 100.megabytes
......
...@@ -432,7 +432,7 @@ class User < ApplicationRecord ...@@ -432,7 +432,7 @@ class User < ApplicationRecord
fuzzy_arel_match(:name, query, lower_exact_match: true) fuzzy_arel_match(:name, query, lower_exact_match: true)
.or(fuzzy_arel_match(:username, query, lower_exact_match: true)) .or(fuzzy_arel_match(:username, query, lower_exact_match: true))
.or(arel_table[:email].eq(query)) .or(arel_table[:email].eq(query))
).reorder(order % { query: ActiveRecord::Base.connection.quote(query) }, :name) ).reorder(order % { query: ApplicationRecord.connection.quote(query) }, :name)
end end
# Limits the result set to users _not_ in the given query/list of IDs. # Limits the result set to users _not_ in the given query/list of IDs.
......
# frozen_string_literal: true # frozen_string_literal: true
class UserAgentDetail < ActiveRecord::Base class UserAgentDetail < ApplicationRecord
belongs_to :subject, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :subject, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
validates :user_agent, :ip_address, :subject_id, :subject_type, presence: true validates :user_agent, :ip_address, :subject_id, :subject_type, presence: true
......
# frozen_string_literal: true # frozen_string_literal: true
class UserCallout < ActiveRecord::Base class UserCallout < ApplicationRecord
belongs_to :user belongs_to :user
# We use `UserCalloutEnums.feature_names` here so that EE can more easily # We use `UserCalloutEnums.feature_names` here so that EE can more easily
......
# frozen_string_literal: true # frozen_string_literal: true
class UserCustomAttribute < ActiveRecord::Base class UserCustomAttribute < ApplicationRecord
belongs_to :user belongs_to :user
validates :user_id, :key, :value, presence: true validates :user_id, :key, :value, presence: true
......
# frozen_string_literal: true # frozen_string_literal: true
class UserInteractedProject < ActiveRecord::Base class UserInteractedProject < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :project belongs_to :project
......
# frozen_string_literal: true # frozen_string_literal: true
class UserPreference < ActiveRecord::Base class UserPreference < ApplicationRecord
# We could use enums, but Rails 4 doesn't support multiple # We could use enums, but Rails 4 doesn't support multiple
# enum options with same name for multiple fields, also it creates # enum options with same name for multiple fields, also it creates
# extra methods that aren't really needed here. # extra methods that aren't really needed here.
......
# frozen_string_literal: true # frozen_string_literal: true
class UserStatus < ActiveRecord::Base class UserStatus < ApplicationRecord
include CacheMarkdownField include CacheMarkdownField
self.primary_key = :user_id self.primary_key = :user_id
......
# frozen_string_literal: true # frozen_string_literal: true
class UserSyncedAttributesMetadata < ActiveRecord::Base class UserSyncedAttributesMetadata < ApplicationRecord
belongs_to :user belongs_to :user
validates :user, presence: true validates :user, presence: true
......
# frozen_string_literal: true # frozen_string_literal: true
class UsersStarProject < ActiveRecord::Base class UsersStarProject < ApplicationRecord
belongs_to :project, counter_cache: :star_count, touch: true belongs_to :project, counter_cache: :star_count, touch: true
belongs_to :user belongs_to :user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment