Moved to before filter.
This commit is contained in:
parent
0e6fde30d0
commit
cf2ce642ef
1 changed files with 3 additions and 6 deletions
|
@ -3,11 +3,11 @@
|
||||||
class Observer::Ticket::CloseTime < ActiveRecord::Observer
|
class Observer::Ticket::CloseTime < ActiveRecord::Observer
|
||||||
observe 'ticket'
|
observe 'ticket'
|
||||||
|
|
||||||
def after_create(record)
|
def before_create(record)
|
||||||
_check(record)
|
_check(record)
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_update(record)
|
def before_update(record)
|
||||||
_check(record)
|
_check(record)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -29,8 +29,5 @@ class Observer::Ticket::CloseTime < ActiveRecord::Observer
|
||||||
|
|
||||||
# set close_time
|
# set close_time
|
||||||
record.close_time = Time.now
|
record.close_time = Time.now
|
||||||
|
|
||||||
# save ticket
|
|
||||||
record.save
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue