Class: Crier::Notification

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/crier/notification.rb

Instance Method Summary collapse

Instance Method Details

#to(audience) ⇒ Object

Shortcut for creating a private audience for this notification



25
26
27
28
29
30
# File 'lib/crier/notification.rb', line 25

def to(audience)
  self.update_column(:private, true)
  self.audience = (self.audience + Array(audience)).uniq

  return self
end

#to_others(audience) ⇒ Object



32
33
34
# File 'lib/crier/notification.rb', line 32

def to_others(audience)
  to(Array(audience) - [crier])
end