devise-onesignal 2.0.0 → 2.0.1

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: b88207054f8bb5822b6c47f4932517eee81812ecb3ed7319087ed9660ff0ea88
4
- data.tar.gz: f86553157eafcb7d9ef43c5fe7761c17a5d243470a40f95c03c3f1407da52277
3
+ metadata.gz: 107a9075cb4ba1e6aa859142f8ad429ef18470f32bc515b754e522c96b4771e8
4
+ data.tar.gz: 513f23e8a4ca0a60f7535c0e5e68f43f1c8421ed368e86e76cea524b4ab0784a
5
5
  SHA512:
6
- metadata.gz: 2dc9e06943bf79803d871b8458874643791b7123ae78c8909303bed17405d67c80620fd717ee21bf7e0972d1d2c56aea1c43f87c7304261e67d38dc3ea7a2fe5
7
- data.tar.gz: b99727eb1b459caa119dc3b57be474c9bc597264196823007ab15f6b306f50371167a2ec59378e23ffb0a8d1fc38d15ad67a34cf5c4b70480d467f26ae8dd157
6
+ metadata.gz: a523ec599d55ab9c7a3bcc35210dfaf9a2f43c6934589ac174a10cd9b6b2a1b8995a369a5eb0d20305ddf2b0d7e02a2dbd08e0c7743a09be0e75a77c68bb0eb2
7
+ data.tar.gz: 68cc49c37097dfef72fce53965c54413474aaf7577b940f7526d01d2575b0244e524eb0461db5c6e79da4ea624d9c9398568aefd9a4b3e7515ced9d4335034bb
@@ -4,6 +4,11 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 2.0.1 - 2017-12-20
8
+
9
+ * bugfixes
10
+ * fixed `undefined method 'permission=' for #<Device>`
11
+
7
12
  ### 2.0.0 - 2017-12-19
8
13
 
9
14
  * features
data/README.md CHANGED
@@ -125,7 +125,7 @@ Just call `OneSignalSubscribe();` in your frontend code and OneSignal will ask y
125
125
 
126
126
  **Note:** You most likely don't want to let your users unsubscribe from receiving notifications, but instead allow them to manually disable receiving any new notifications. For that purpose use the [notifications-rails](https://github.com/jonhue/notifications-rails) gem, which adds a notification API and detailed user settings.
127
127
 
128
- If you want to completely remove a user from OneSignal, call `OneSignalSubscribe();` in your javascript.
128
+ If you want to completely remove a user from OneSignal, call `OneSignalUnsubscribe();` in your javascript.
129
129
 
130
130
  ---
131
131
 
@@ -139,11 +139,15 @@ DeviseOnesignal.configure do |config|
139
139
  end
140
140
  ```
141
141
 
142
- **`app_id` (required)** Your OneSignal app id. Create one here: https://onesignal.com
143
- **`devise_class`** Specify your devise class. Defaults to `'User'`.
144
- **`auto_register`** Automatically try to subscribe the user when loading a page. Defaults to `false`.
145
- **`persist_notification`** Automatically dismiss the notification after ~20 seconds in Chrome. Defaults to `false`.
146
- **`subscribe_with_modal`** Show a modal instead of a native browser window when subscribing a user to OneSignal. Defaults to `false`.
142
+ **`app_id` (required)** Your OneSignal app id. Takes a string. Create one here: https://onesignal.com
143
+
144
+ **`devise_class`** Specify your devise class. Takes a string. Defaults to `'User'`.
145
+
146
+ **`auto_register`** Automatically try to subscribe the user when loading a page. Takes a boolean. Defaults to `false`.
147
+
148
+ **`persist_notification`** Automatically dismiss the notification after ~20 seconds in Chrome. Takes a boolean. Defaults to `false`.
149
+
150
+ **`subscribe_with_modal`** Show a modal instead of a native browser window when subscribing a user to OneSignal. Takes a boolean. Defaults to `false`.
147
151
 
148
152
  ---
149
153
 
@@ -16,7 +16,7 @@ module DeviseOnesignal
16
16
  onesignal_user_id = cookies[:oneSignalUserId]
17
17
  device = Device.find_or_create_by! onesignal_id: onesignal_user_id
18
18
  device.user = current_user if current_user
19
- device.permission = cookies[:oneSignalUserPermission]
19
+ device.onesignal_permission = cookies[:oneSignalUserPermission]
20
20
  device.last_used = Time.now
21
21
  device.save!
22
22
  end
@@ -5,7 +5,7 @@ module DeviseOnesignal
5
5
  if cookies[:oneSignalUserId].nil?
6
6
  device = Device.new
7
7
  device.user = current_user if current_user
8
- device.permission = cookies[:oneSignalUserPermission]
8
+ device.onesignal_permission = cookies[:oneSignalUserPermission]
9
9
  device.last_used = Time.now
10
10
  else
11
11
  device = Device.find_by(onesignal_id: cookies[:oneSignalUserId])
@@ -2,13 +2,13 @@ module DeviseOnesignal
2
2
  module DeviceLib
3
3
 
4
4
  def onesignal_enabled?
5
- self.permission == 'granted'
5
+ self.onesignal_permission == 'granted'
6
6
  end
7
7
  def onesignal_disabled?
8
- self.permission == 'denied'
8
+ self.onesignal_permission == 'denied'
9
9
  end
10
10
  def onesignal_set?
11
- !self.permission == 'default'
11
+ !self.onesignal_permission == 'default'
12
12
  end
13
13
 
14
14
  end
@@ -1,5 +1,5 @@
1
1
  module DeviseOnesignal
2
2
 
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
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: 2.0.0
4
+ version: 2.0.1
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-19 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler