checks_latest_change_observed.rb 359 B

12345678910111213
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. module ChecksLatestChangeObserved
  3. extend ActiveSupport::Concern
  4. included do
  5. after_commit :latest_change_set_from_observer
  6. end
  7. def latest_change_set_from_observer
  8. latest_change = destroyed? ? nil : updated_at
  9. self.class.latest_change_set(latest_change)
  10. end
  11. end