Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gems/activerecord-gitlab/spec/support/models.rb')
-rw-r--r--gems/activerecord-gitlab/spec/support/models.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/gems/activerecord-gitlab/spec/support/models.rb b/gems/activerecord-gitlab/spec/support/models.rb
index c0017656ea8..445dc8b2ac2 100644
--- a/gems/activerecord-gitlab/spec/support/models.rb
+++ b/gems/activerecord-gitlab/spec/support/models.rb
@@ -48,3 +48,14 @@ class Metadata < PartitionedRecord
belongs_to :job,
->(metadata) { where(partition_id: metadata.partition_id) }
end
+
+class LockingJob < PartitionedRecord
+ self.table_name = :locking_jobs
+ query_constraints :id, :partition_id
+
+ enum status: { created: 0, completed: 1 }
+
+ def locking_enabled?
+ will_save_change_to_status?
+ end
+end