Commit b23f71ec authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Set/unset merge request locked_at timestamp after transition

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 1961b590
......@@ -70,6 +70,16 @@ class MergeRequest < ActiveRecord::Base
transition locked: :reopened
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 :reopened
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