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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2232ec293e7d3a67295fe26055dbdc7db5ff24c4c86f5c0b9b78e43722985c6
4
- data.tar.gz: 8446b547d9c23e92b25386c34b3d55ba753c557751bee00313e58dc086718478
3
+ metadata.gz: 707334af5eec5b6d9f438d18a43d64bbd8cc0b303eb13fc9375121ac6b25545b
4
+ data.tar.gz: 7262bab8d4bba70337b3149d177bb69c22c4cc03b025e5b652519247fc7ba05f
5
5
  SHA512:
6
- metadata.gz: 00d052ac560e504a9dd337360afc01beabc1d5f0085a218c26725940432a1c33f46e06eecfa96729b20cedcab310e0db1ca81a1930a326fe480c76daca07b6af
7
- data.tar.gz: a670f74484da03934eb58aa74c9799985724262234a0b92feb13b6aebf58f4cb9fb292f0f432bde9762db1d72aafb8820ada942dcdcb653fa001047a7a08738c
6
+ metadata.gz: 0a5239f4ec9f8c8e37aa3a6937eac1c881baed5d4a1b676715515cebfb344724f0f1c3b6daf25e9f928407f7f5ac3139799bf0ab9b53100e9c81077a3b5c1086
7
+ data.tar.gz: 1281729268836127af4c14d8fab344c4d7370278e3c8b03264eec7ecc04805d782bf9d9f4d3822fd6b93bfd225ff9079e5ced34e60d212a9746e5f86e0de619b
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 3.1.3 - 2018-01-02
8
+
9
+ * bugfixes
10
+ * fixed overriding `set_device_owner` method
11
+
7
12
  ### 3.1.2 - 2017-12-28
8
13
 
9
14
  * bugfixes
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 `private` method to your `ApplicationController`:
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 = ApplicationController.try(:set_device_owner) || set_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 = ApplicationController.try(:set_device_owner) || set_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]
@@ -1,5 +1,5 @@
1
1
  module DeviseOnesignal
2
2
 
3
- VERSION = '3.1.2'
3
+ VERSION = '3.1.3'
4
4
 
5
5
  end
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.2
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: 2017-12-28 00:00:00.000000000 Z
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.3
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