From 251255e7ca3e1b1526041fdb1f501a884ea468e6 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Tue, 4 Apr 2017 15:19:09 -0300 Subject: [PATCH] Do not set closed_at to nil when issue is reopened --- app/models/issue.rb | 4 ---- changelogs/unreleased/issue_91_ee_backport.yml | 4 ++++ spec/models/issue_spec.rb | 8 -------- 3 files changed, 4 insertions(+), 12 deletions(-) create mode 100644 changelogs/unreleased/issue_91_ee_backport.yml diff --git a/app/models/issue.rb b/app/models/issue.rb index 10a5d9d2a24..472796df9df 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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 diff --git a/changelogs/unreleased/issue_91_ee_backport.yml b/changelogs/unreleased/issue_91_ee_backport.yml new file mode 100644 index 00000000000..17bc0e435f3 --- /dev/null +++ b/changelogs/unreleased/issue_91_ee_backport.yml @@ -0,0 +1,4 @@ +--- +title: Do not set closed_at to nil when issue is reopened +merge_request: +author: diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index b8584301baa..4bdd46a581d 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -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