devise-onesignal 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +3 -1
- data/lib/devise-onesignal/device_concern.rb +2 -2
- data/lib/devise-onesignal/device_helper.rb +1 -1
- data/lib/devise-onesignal/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707334af5eec5b6d9f438d18a43d64bbd8cc0b303eb13fc9375121ac6b25545b
|
4
|
+
data.tar.gz: 7262bab8d4bba70337b3149d177bb69c22c4cc03b025e5b652519247fc7ba05f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a5239f4ec9f8c8e37aa3a6937eac1c881baed5d4a1b676715515cebfb344724f0f1c3b6daf25e9f928407f7f5ac3139799bf0ab9b53100e9c81077a3b5c1086
|
7
|
+
data.tar.gz: 1281729268836127af4c14d8fab344c4d7370278e3c8b03264eec7ecc04805d782bf9d9f4d3822fd6b93bfd225ff9079e5ced34e60d212a9746e5f86e0de619b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -85,9 +85,11 @@ document.addEventListener( 'turbolinks:load', function() {
|
|
85
85
|
|
86
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.
|
87
87
|
|
88
|
-
Let's say our Devise model is named `Admin`. Just add a `
|
88
|
+
Let's say our Devise model is named `Admin`. Just add a `protected` method to your `ApplicationController`:
|
89
89
|
|
90
90
|
```ruby
|
91
|
+
protected
|
92
|
+
|
91
93
|
def set_device_owner
|
92
94
|
current_admin if current_admin
|
93
95
|
end
|
@@ -17,13 +17,13 @@ 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 =
|
20
|
+
device.owner = set_device_owner
|
21
21
|
device.save!
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
def set_device_owner
|
26
|
-
current_user if current_user
|
26
|
+
super || current_user if current_user
|
27
27
|
end
|
28
28
|
|
29
29
|
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 =
|
8
|
+
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]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise-onesignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.7.
|
133
|
+
rubygems_version: 2.7.4
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Implement user targeted cross-platform notifications in your Rails app
|