Module: Ddr::Models::EventLoggable
Instance Method Summary collapse
- #events ⇒ Object
- #has_events? ⇒ Boolean
-
#notify_event(type, args = {}) ⇒ Object
TESTME.
- #update_events ⇒ Object
Instance Method Details
#events ⇒ Object
6 7 8 |
# File 'lib/ddr/models/event_loggable.rb', line 6 def events event_class.for_object(self) end |
#has_events? ⇒ Boolean
19 20 21 |
# File 'lib/ddr/models/event_loggable.rb', line 19 def has_events? events.count > 0 end |
#notify_event(type, args = {}) ⇒ Object
TESTME
15 16 17 |
# File 'lib/ddr/models/event_loggable.rb', line 15 def notify_event(type, args={}) Ddr::Notifications.notify_event(type, args.merge(pid: id)) end |
#update_events ⇒ Object
10 11 12 |
# File 'lib/ddr/models/event_loggable.rb', line 10 def update_events event_class(:update).for_object(self) end |