action_push_native 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 221069cb3459cd2c07eaa4d7a3d2c98c741f2817a15a47cf27e8bc4ea6dd93fb
|
|
4
|
+
data.tar.gz: 5719b281f487a336d96100213946fa41ce8115a573cb1888cfe0eb4422c97bb6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d308c3a5d4a6d721bfe60a09d4f3dc0fdce3c7058ecfc82ed7dfd050b10b121adeadbd89ed48b843bd53a52a62b53fc958d6fd5191b666c83441d8ae51735e62
|
|
7
|
+
data.tar.gz: b782ef4aac0fca069a82415cdb278c1fb5d162a3608f8cede1404934dd859583b7a54b55880925c1e12016e776b734dab352ebbb8ba31b2e95cbf1c3a31c9d3e
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module ActionPushNative
|
|
4
|
-
class Device <
|
|
4
|
+
class Device < Record
|
|
5
5
|
include ActiveSupport::Rescuable
|
|
6
6
|
|
|
7
7
|
rescue_from(TokenError) { destroy! }
|
|
8
8
|
|
|
9
9
|
belongs_to :owner, polymorphic: true, optional: true
|
|
10
10
|
|
|
11
|
-
enum :platform, { apple: "apple", google: "google" }
|
|
11
|
+
enum :platform, { apple: "apple", google: "google" }, validate: true
|
|
12
12
|
|
|
13
13
|
def push(notification)
|
|
14
14
|
notification.token = token
|
data/lib/action_push_native.rb
CHANGED
|
@@ -27,7 +27,7 @@ module ActionPushNative
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def self.config_for(platform, notification)
|
|
30
|
-
platform_config =
|
|
30
|
+
platform_config = config[platform.to_sym]
|
|
31
31
|
raise "ActionPushNative: '#{platform}' platform is not configured" unless platform_config.present?
|
|
32
32
|
|
|
33
33
|
if notification.application.present?
|
|
@@ -38,6 +38,13 @@ module ActionPushNative
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
def self.config
|
|
42
|
+
path = Rails.application.paths["config/push"].existent.first
|
|
43
|
+
raise "ActionPushNative: config/push.yml not found" unless path
|
|
44
|
+
|
|
45
|
+
Rails.application.config_for(Pathname.new(path))
|
|
46
|
+
end
|
|
47
|
+
|
|
41
48
|
def self.deprecator
|
|
42
49
|
@deprecator ||= ActiveSupport::Deprecation.new
|
|
43
50
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: action_push_native
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jacopo Beschi
|
|
@@ -105,6 +105,7 @@ files:
|
|
|
105
105
|
- Rakefile
|
|
106
106
|
- app/jobs/action_push_native/notification_job.rb
|
|
107
107
|
- app/models/action_push_native/device.rb
|
|
108
|
+
- app/models/action_push_native/record.rb
|
|
108
109
|
- db/migrate/20250610075650_create_action_push_native_device.rb
|
|
109
110
|
- lib/action_push_native.rb
|
|
110
111
|
- lib/action_push_native/configured_notification.rb
|