devise-onesignal 3.0.0 → 3.0.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +3 -2
- data/lib/devise-onesignal/device_concern.rb +1 -1
- data/lib/devise-onesignal/device_helper.rb +1 -1
- data/lib/devise-onesignal/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: 512a364e2790a927c71a474ec19a9b66026e8e044d4d1f59a1f1577ac8bbe334
|
4
|
+
data.tar.gz: 3aa80afbc7d74072bc793750be7a98fd64329a4b541c540112c6aa91d8cfc5d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a22c23438ba1f388817f11a0919feff63dbca9f78b85f8e434387cf8017c29aace7a7bd0255448c29739acf67a0af7440404364b900b679416cadbac3bd59429
|
7
|
+
data.tar.gz: 35dd3694f3277ca45430081b6b4e1a3a211f047e3ac2a087c144512b2fbbb88cece3415523bd5e366e9dc119367d88c7e53631b9d39ce27c944cdae343d3d173
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -12,6 +12,7 @@ This gem works well together with [notifications-rails](https://github.com/jonhu
|
|
12
12
|
|
13
13
|
* [Installation](#installation)
|
14
14
|
* [Usage](#usage)
|
15
|
+
* [Devise object](#devise-object)
|
15
16
|
* [Device methods](#device-methods)
|
16
17
|
* [current_device](#current_device)
|
17
18
|
* [Subscribing](#subscribing)
|
@@ -84,7 +85,7 @@ document.addEventListener( 'turbolinks:load', function() {
|
|
84
85
|
|
85
86
|
You most likely want to associate your devise object (e.g. `current_user`) with your OneSignal integration. Now, if your Devise model is called `User` and the `current_user` method is available you don't have to worry about that.
|
86
87
|
|
87
|
-
Let's say our Devise model is named `Admin`. Just add `private` method to your `ApplicationController`:
|
88
|
+
Let's say our Devise model is named `Admin`. Just add a `private` method to your `ApplicationController`:
|
88
89
|
|
89
90
|
```ruby
|
90
91
|
def set_device_owner
|
@@ -184,7 +185,7 @@ https://github.com/jonhue/devise-onesignal/graphs/contributors
|
|
184
185
|
|
185
186
|
### Semantic Versioning
|
186
187
|
|
187
|
-
|
188
|
+
devise-onesignal follows Semantic Versioning 2.0 as defined at http://semver.org.
|
188
189
|
|
189
190
|
## License
|
190
191
|
|
@@ -17,7 +17,7 @@ module DeviseOnesignal
|
|
17
17
|
device = Device.find_or_create_by! onesignal_id: onesignal_player_id
|
18
18
|
device.onesignal_permission = cookies[:oneSignalPlayerPermission]
|
19
19
|
device.last_used = Time.now
|
20
|
-
device.owner = set_device_owner
|
20
|
+
device.owner = ApplicationController.set_device_owner || set_device_owner
|
21
21
|
device.save!
|
22
22
|
end
|
23
23
|
end
|
@@ -5,7 +5,7 @@ module DeviseOnesignal
|
|
5
5
|
if cookies[:oneSignalPlayerId].nil?
|
6
6
|
device = Device.new
|
7
7
|
device.onesignal_permission = cookies[:oneSignalPlayerPermission]
|
8
|
-
device.owner = set_device_owner
|
8
|
+
device.owner = ApplicationController.set_device_owner || set_device_owner
|
9
9
|
device.last_used = Time.now
|
10
10
|
else
|
11
11
|
device = Device.find_by onesignal_id: cookies[:oneSignalPlayerId]
|