Class: Crier::Notification
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Crier::Notification
- Defined in:
- lib/crier/notification.rb
Instance Method Summary collapse
-
#to(audience) ⇒ Object
Shortcut for creating a private audience for this notification.
- #to_others(audience) ⇒ Object
Instance Method Details
#to(audience) ⇒ Object
Shortcut for creating a private audience for this notification
19 20 21 22 23 24 |
# File 'lib/crier/notification.rb', line 19 def to(audience) self.update_column(:private, true) self.audience = (self.audience + Array(audience)).uniq return self end |
#to_others(audience) ⇒ Object
26 27 28 |
# File 'lib/crier/notification.rb', line 26 def to_others(audience) to(Array(audience) - [crier]) end |