Class: Async::Messaging::Notify
- Inherits:
-
Object
- Object
- Async::Messaging::Notify
- Defined in:
- lib/async-messaging/notify.rb
Class Method Summary collapse
Class Method Details
.clear_all ⇒ Object
19 20 21 |
# File 'lib/async-messaging/notify.rb', line 19 def clear_all Mongoid::Message.delete_all end |
.notify_user(target_user_instance, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/async-messaging/notify.rb', line 6 def notify_user(target_user_instance, ={}) [:subject] ||= "" [:content] ||= "" [:category] ||= :flash [:flags] ||= [:notice] # collect source user s = Async::Messaging.setup from_user_id = s.model_root.id target_user_id = target_user_instance.id # create document entry Mongoid::Message.create! .merge({from: from_user_id, to: target_user_id}) end |