trabajo-afectivo/app/models/concerns/checks_latest_change_observed.rb
2022-01-01 14:38:12 +01:00

14 lines
361 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
module ChecksLatestChangeObserved
extend ActiveSupport::Concern
included do
after_commit :latest_change_set_from_observer
end
def latest_change_set_from_observer
latest_change = destroyed? ? nil : updated_at
self.class.latest_change_set(latest_change)
end
end