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

transitionable.rb « concerns « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 70e1fc8b78a9bb6a4dc8771cd4a199728a1170c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Transitionable
  extend ActiveSupport::Concern

  attr_accessor :transitioning

  def transitioning?
    return false unless transitioning && Feature.enabled?(:skip_validations_during_transitions, project)

    true
  end

  def enable_transitioning
    self.transitioning = true
  end

  def disable_transitioning
    self.transitioning = false
  end
end