lib/devise/async/model.rb in devise-async-0.7.0 vs lib/devise/async/model.rb in devise-async-0.8.0

- old
+ new

@@ -22,29 +22,29 @@ # This method overwrites devise's own `send_devise_notification` # to capture all email notifications and enqueue it for background # processing instead of sending it inline as devise does by # default. - def send_devise_notification(notification, opts = {}) + def send_devise_notification(notification, *args) return super unless Devise::Async.enabled # If the record is dirty we keep pending notifications to be enqueued # by the callback and avoid before commit job processing. if changed? - devise_pending_notifications << [ notification, opts ] + devise_pending_notifications << [ notification, args ] # If the record isn't dirty (aka has already been saved) enqueue right away # because the callback has already been triggered. else - Devise::Async::Worker.enqueue(notification, self.class.name, self.id.to_s, opts) + Devise::Async::Worker.enqueue(notification, self.class.name, self.id.to_s, *args) end end # Send all pending notifications. def send_devise_pending_notifications - devise_pending_notifications.each do |notification, opts| + devise_pending_notifications.each do |notification, args| # Use `id.to_s` to avoid problems with mongoid 2.4.X ids being serialized # wrong with YAJL. - Devise::Async::Worker.enqueue(notification, self.class.name, self.id.to_s, opts) + Devise::Async::Worker.enqueue(notification, self.class.name, self.id.to_s, *args) end @devise_pending_notifications = [] end def devise_pending_notifications