From cf2ce642ef1f6620a8d1cc02abfe77b84d621b75 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 1 May 2015 16:26:28 +0200 Subject: [PATCH] Moved to before filter. --- app/models/observer/ticket/close_time.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/models/observer/ticket/close_time.rb b/app/models/observer/ticket/close_time.rb index 1ce45ee1b..1854ceb40 100644 --- a/app/models/observer/ticket/close_time.rb +++ b/app/models/observer/ticket/close_time.rb @@ -3,18 +3,18 @@ class Observer::Ticket::CloseTime < ActiveRecord::Observer observe 'ticket' - def after_create(record) + def before_create(record) _check(record) end - def after_update(record) + def before_update(record) _check(record) end private def _check(record) - # puts 'check close time' + #puts 'check close time' # return if we run import mode return if Setting.get('import_mode') @@ -29,8 +29,5 @@ class Observer::Ticket::CloseTime < ActiveRecord::Observer # set close_time record.close_time = Time.now - - # save ticket - record.save end end