Commit ac7b6688 authored by haseeb's avatar haseeb Committed by oswaldoferreira

changed the way of nullifying colums

parent 6496b29e
...@@ -86,6 +86,11 @@ class Issue < ActiveRecord::Base ...@@ -86,6 +86,11 @@ 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: :opened do |issue|
issue.closed_at = nil
issue.closed_by = nil
end
end end
class << self class << self
......
...@@ -10,7 +10,6 @@ module Issues ...@@ -10,7 +10,6 @@ module Issues
execute_hooks(issue, 'reopen') execute_hooks(issue, 'reopen')
invalidate_cache_counts(issue, users: issue.assignees) invalidate_cache_counts(issue, users: issue.assignees)
issue.update_project_counter_caches issue.update_project_counter_caches
issue.update(closed_by: nil, closed_at: nil)
end end
issue issue
......
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