Do not set closed_at to nil when issue is reopened

This commit is contained in:
Felipe Artur 2017-04-04 15:19:09 -03:00
parent 0a4b853f2c
commit 251255e7ca
3 changed files with 4 additions and 12 deletions

View file

@ -59,10 +59,6 @@ class Issue < ActiveRecord::Base
before_transition any => :closed do |issue|
issue.closed_at = Time.zone.now
end
before_transition closed: any do |issue|
issue.closed_at = nil
end
end
def hook_attrs

View file

@ -0,0 +1,4 @@
---
title: Do not set closed_at to nil when issue is reopened
merge_request:
author:

View file

@ -51,14 +51,6 @@ describe Issue, models: true do
expect(issue.closed_at).to eq(now)
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
describe '#to_reference' do