2017-01-31 17:13:45 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
2017-05-02 15:21:13 +00:00
|
|
|
module ChecksLatestChangeObserved
|
2017-01-31 17:13:45 +00:00
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
after_create :latest_change_set_from_observer
|
|
|
|
after_update :latest_change_set_from_observer
|
|
|
|
after_touch :latest_change_set_from_observer
|
|
|
|
after_destroy :latest_change_set_from_observer_destroy
|
|
|
|
end
|
|
|
|
|
|
|
|
def latest_change_set_from_observer
|
|
|
|
self.class.latest_change_set(updated_at)
|
|
|
|
end
|
|
|
|
|
|
|
|
def latest_change_set_from_observer_destroy
|
|
|
|
self.class.latest_change_set(nil)
|
|
|
|
end
|
|
|
|
end
|