trabajo-afectivo/app/models/application_model/has_recent_views.rb

24 lines
438 B
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
module ApplicationModel::HasRecentViews
extend ActiveSupport::Concern
included do
before_destroy :recent_view_destroy
end
=begin
delete object recent viewed list, will be executed automatically
model = Model.find(123)
model.recent_view_destroy
=end
def recent_view_destroy
RecentView.log_destroy(self.class.to_s, id)
true
end
end