Commit 251255e7 authored by Felipe Artur's avatar Felipe Artur

Do not set closed_at to nil when issue is reopened

parent 0a4b853f
...@@ -59,10 +59,6 @@ class Issue < ActiveRecord::Base ...@@ -59,10 +59,6 @@ class Issue < ActiveRecord::Base
before_transition any => :closed do |issue| before_transition any => :closed do |issue|
issue.closed_at = Time.zone.now issue.closed_at = Time.zone.now
end end
before_transition closed: any do |issue|
issue.closed_at = nil
end
end end
def hook_attrs def hook_attrs
......
---
title: Do not set closed_at to nil when issue is reopened
merge_request:
author:
...@@ -51,14 +51,6 @@ describe Issue, models: true do ...@@ -51,14 +51,6 @@ describe Issue, models: true do
expect(issue.closed_at).to eq(now) expect(issue.closed_at).to eq(now)
end end
it 'sets closed_at to nil when issue is reopened' do
issue = create(:issue, state: 'closed')
issue.reopen
expect(issue.closed_at).to be_nil
end
end end
describe '#to_reference' do describe '#to_reference' do
......
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