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
|
2018-06-25 13:32:54 +00:00
|
|
|
after_commit :latest_change_set_from_observer
|
2017-01-31 17:13:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def latest_change_set_from_observer
|
2018-06-25 13:32:54 +00:00
|
|
|
latest_change = destroyed? ? nil : updated_at
|
|
|
|
self.class.latest_change_set(latest_change)
|
2017-01-31 17:13:45 +00:00
|
|
|
end
|
|
|
|
end
|