diff options
Diffstat (limited to 'app/models/projects/import_export')
-rw-r--r-- | app/models/projects/import_export/relation_export.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/models/projects/import_export/relation_export.rb b/app/models/projects/import_export/relation_export.rb index 15198049f87..9bdf10d7c0e 100644 --- a/app/models/projects/import_export/relation_export.rb +++ b/app/models/projects/import_export/relation_export.rb @@ -34,11 +34,18 @@ module Projects scope :by_relation, -> (relation) { where(relation: relation) } + STATUS = { + queued: 0, + started: 1, + finished: 2, + failed: 3 + }.freeze + state_machine :status, initial: :queued do - state :queued, value: 0 - state :started, value: 1 - state :finished, value: 2 - state :failed, value: 3 + state :queued, value: STATUS[:queued] + state :started, value: STATUS[:started] + state :finished, value: STATUS[:finished] + state :failed, value: STATUS[:failed] event :start do transition queued: :started |