notifiable-core 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/notifiable/notifier_base.rb +3 -1
- data/lib/notifiable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 168bcc6951c9034d4d764b3450636ad3d29d2b9b0ef2f3c6006540ee14b5ad98
|
4
|
+
data.tar.gz: 113f00a07fcec019617f374397e61364d54547370455ac9e8449d729595a57e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 205fea17555043f1bae8572a3857ce4f8415c4fb6fd5421433047b3df15bb04234f07c7381d6f9fc39dacf70aab14c32bbade60032599bcce8712f012441bd43
|
7
|
+
data.tar.gz: f0fdfec5cc6ee40a34e3af5d9c8fc4986369ddc9201f9f8bdab59cc1b58fb89f57e1510b273962beee4983d9271855c6ffa04e5d4e7653414b16a3c47d65a9be
|
@@ -3,6 +3,8 @@ require 'logger'
|
|
3
3
|
|
4
4
|
module Notifiable
|
5
5
|
class NotifierBase
|
6
|
+
OK_STATUS = 0
|
7
|
+
|
6
8
|
attr_reader :env, :notification
|
7
9
|
|
8
10
|
def self.notifier_attribute(*vars)
|
@@ -41,7 +43,7 @@ module Notifiable
|
|
41
43
|
|
42
44
|
def flush; end
|
43
45
|
|
44
|
-
def processed(device_token, status, error_message = nil)
|
46
|
+
def processed(device_token, status = OK_STATUS, error_message = nil)
|
45
47
|
if @notification.app.save_notification_statuses
|
46
48
|
receipts << { notification_id: notification.id, device_token_id: device_token.id, status: status, created_at: DateTime.now, error_message: error_message }
|
47
49
|
save_receipts if receipts.count >= Notifiable.notification_status_batch_size
|
data/lib/notifiable/version.rb
CHANGED