Sha256: 2e377e89707b9297df0b1ed729441f186888b9f1ea146911d4d8c0f73d1661ec
Contents?: true
Size: 688 Bytes
Versions: 31
Compression:
Stored size: 688 Bytes
Contents
module Ddr module Models module EventLoggable extend ActiveSupport::Concern def events event_class.for_object(self) end def update_events event_class(:update).for_object(self) end # TESTME def notify_event(type, args={}) Ddr::Notifications.notify_event(type, args.merge(pid: id)) end def has_events? events.count > 0 end private def event_class_name(token=nil) type = token ? "#{token.to_s.camelize}Event" : "Event" "Ddr::Events::#{type}" end def event_class(token=nil) event_class_name(token).constantize end end end end
Version data entries
31 entries across 31 versions & 1 rubygems