Module: Ddr::Models::EventLoggable

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/ddr/models/event_loggable.rb

Instance Method Summary collapse

Instance Method Details

#eventsObject



6
7
8
# File 'lib/ddr/models/event_loggable.rb', line 6

def events
  event_class.for_object(self)
end

#has_events?Boolean

Returns:

  • (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_eventsObject



10
11
12
# File 'lib/ddr/models/event_loggable.rb', line 10

def update_events
  event_class(:update).for_object(self)
end