BigW Consortium Gitlab

Set/unset merge request locked_at timestamp after transition

parent 1961b590
...@@ -70,6 +70,16 @@ class MergeRequest < ActiveRecord::Base ...@@ -70,6 +70,16 @@ class MergeRequest < ActiveRecord::Base
transition locked: :reopened transition locked: :reopened
end end
after_transition any => :locked do |merge_request, transition|
merge_request.locked_at = Time.now
merge_request.save
end
after_transition :locked => (any - :locked) do |merge_request, transition|
merge_request.locked_at = nil
merge_request.save
end
state :opened state :opened
state :reopened state :reopened
state :closed state :closed
......
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