2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
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
|