Sha256: ad99eac24f672bd81190d9e4923b8bf8e043e2182e4c866934d93aa1d48a29eb
Contents?: true
Size: 1.06 KB
Versions: 67
Compression:
Stored size: 1.06 KB
Contents
module UINotifications module Tasks class TaskBulkResume < ::UINotifications::Base def initialize(task, resumed_length, failed_length, skipped_length) @subject = task @resumed_length = resumed_length @failed_length = failed_length @skipped_length = skipped_length end def create Notification.create!( initiator: initiator, audience: audience, subject: subject, notification_blueprint: blueprint, message: message, notification_recipients: [NotificationRecipient.create({ :user => User.current })] ) end def audience Notification::AUDIENCE_USER end def message ('%{resumed} Tasks were resumed. %{failed} Tasks failed to resume. %{skipped} Tasks were skipped. ' % { resumed: @resumed_length, failed: @failed_length, skipped: @skipped_length }) end def blueprint @blueprint ||= NotificationBlueprint.find_by(name: 'tasks_bulk_resume') end end end end
Version data entries
67 entries across 67 versions & 1 rubygems