rpush 3.2.1 → 3.2.2

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
  SHA1:
3
- metadata.gz: 788419dc26bef6ca15bcb0d3af3c63936b081e99
4
- data.tar.gz: 9e434c844f99d569478da9f8ee3280dd089dc584
3
+ metadata.gz: 697387cef6b440ad36399e558de9dee6357a0e88
4
+ data.tar.gz: 3502062c5e96d2286e3dc17e879cd7be76254198
5
5
  SHA512:
6
- metadata.gz: 620523a9d8942b264e82319ac20e07262e409d9b0fa71e5dbcfce64d9c5cb63ac13b4880ee46f348c8c6b0f32730434ba917986dfd2460c5fb9403c64861636f
7
- data.tar.gz: 83aad026ae9f936d0610a90c9ee5a28aac6019a52372c989978db12c27073c21dcb518a5f2473889e696a642d1a06d410430897655306f542a7927c255b3dda8
6
+ metadata.gz: 70c779f80461bcbc4169fb103d1bd89d002a2ca0f66b776996907d0ceb83fcd145d476062e5eddb896c94298540853c1061318285e67a79da7f5cdc022dd7f05
7
+ data.tar.gz: 289d0ec7e57330b1367f277b2fca0919aa9eb1b33cab2e47222dd1cfebe905a064bcffbb64003243f6c1be1b183244bccd218ad530f58f947cc59ee10b0e8b4d
@@ -12,6 +12,12 @@
12
12
 
13
13
  - None
14
14
 
15
+ ## 3.2.2 (2018-07-10)
16
+
17
+ ### Fixed
18
+
19
+ - Migrations now work with Rails 5.2 and ActiveRecord. Redis support for Rails 5.2 is not yet working if you're using Modis, see [this issue](https://github.com/ileitch/modis/issues/13).
20
+
15
21
  ## 3.2.1 (2018-07-10)
16
22
 
17
23
  ### Fixed
data/README.md CHANGED
@@ -21,7 +21,7 @@ Rpush aims to be the *de facto* gem for sending push notifications in Ruby. Its
21
21
 
22
22
  #### Feature Highlights
23
23
 
24
- * Use [**ActiveRecord**](https://github.com/rpush/rpush/wiki/Using-ActiveRecord) or [**Redis**](https://github.com/rpush/rpush/wiki/Using-Redis) for storage.
24
+ * Use [**ActiveRecord**](https://github.com/rpush/rpush/wiki/Using-ActiveRecord) or [**Redis**](https://github.com/rpush/rpush/wiki/Using-Redis) for storage. **Note:** Redis support for Rails 5.2 is not yet working if you're using Modis, see [this issue](https://github.com/ileitch/modis/issues/13).
25
25
  * Plugins for [**Bugsnag**](https://github.com/rpush/rpush-plugin-bugsnag),
26
26
  [**Sentry**](https://github.com/rpush/rpush-plugin-sentry), [**StatsD**](https://github.com/rpush/rpush-plugin-statsd) or [write your own](https://github.com/rpush/rpush/wiki/Writing-a-Plugin).
27
27
  * Seamless integration with your projects, including **Rails**.
@@ -50,11 +50,20 @@ class AddGcm < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0]
50
50
  change_column :rapns_notifications, :app_id, :integer, null: false
51
51
  remove_column :rapns_notifications, :app
52
52
 
53
- if index_name_exists?(:rapns_notifications, "index_rapns_notifications_multi", true)
54
- remove_index :rapns_notifications, name: "index_rapns_notifications_multi"
55
- elsif index_name_exists?(:rapns_notifications, "index_rapns_notifications_on_delivered_failed_deliver_after", false)
56
- remove_index :rapns_notifications, name: "index_rapns_notifications_on_delivered_failed_deliver_after"
53
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
54
+ if index_name_exists?(:rapns_notifications, "index_rapns_notifications_multi")
55
+ remove_index :rapns_notifications, name: "index_rapns_notifications_multi"
56
+ elsif index_name_exists?(:rapns_notifications, "index_rapns_notifications_on_delivered_failed_deliver_after")
57
+ remove_index :rapns_notifications, name: "index_rapns_notifications_on_delivered_failed_deliver_after"
58
+ end
59
+ else
60
+ if index_name_exists?(:rapns_notifications, "index_rapns_notifications_multi", true)
61
+ remove_index :rapns_notifications, name: "index_rapns_notifications_multi"
62
+ elsif index_name_exists?(:rapns_notifications, "index_rapns_notifications_on_delivered_failed_deliver_after", false)
63
+ remove_index :rapns_notifications, name: "index_rapns_notifications_on_delivered_failed_deliver_after"
64
+ end
57
65
  end
66
+
58
67
  add_index :rapns_notifications, [:app_id, :delivered, :failed, :deliver_after], name: "index_rapns_notifications_multi"
59
68
  end
60
69
 
@@ -91,8 +100,14 @@ class AddGcm < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0]
91
100
  AddGcm::Rapns::Notification.update_all(['app = ?', app.key], ['app_id = ?', app.id])
92
101
  end
93
102
 
94
- if index_name_exists?(:rapns_notifications, :index_rapns_notifications_multi, true)
95
- remove_index :rapns_notifications, name: :index_rapns_notifications_multi
103
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
104
+ if index_name_exists?(:rapns_notifications, :index_rapns_notifications_multi)
105
+ remove_index :rapns_notifications, name: :index_rapns_notifications_multi
106
+ end
107
+ else
108
+ if index_name_exists?(:rapns_notifications, :index_rapns_notifications_multi, true)
109
+ remove_index :rapns_notifications, name: :index_rapns_notifications_multi
110
+ end
96
111
  end
97
112
 
98
113
  remove_column :rapns_notifications, :app_id
@@ -64,9 +64,16 @@ class AddRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0
64
64
  end
65
65
 
66
66
  def self.down
67
- if index_name_exists?(:rapns_notifications, 'index_rapns_notifications_multi', true)
68
- remove_index :rapns_notifications, name: 'index_rapns_notifications_multi'
67
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
68
+ if index_name_exists?(:rapns_notifications, 'index_rapns_notifications_multi')
69
+ remove_index :rapns_notifications, name: 'index_rapns_notifications_multi'
70
+ end
71
+ else
72
+ if index_name_exists?(:rapns_notifications, 'index_rapns_notifications_multi', true)
73
+ remove_index :rapns_notifications, name: 'index_rapns_notifications_multi'
74
+ end
69
75
  end
76
+
70
77
  drop_table :rapns_notifications
71
78
  end
72
79
  end
@@ -83,9 +90,16 @@ class AddRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0
83
90
  end
84
91
 
85
92
  def self.down
86
- if index_name_exists?(:rapns_feedback, :index_rapns_feedback_on_device_token, true)
87
- remove_index :rapns_feedback, name: :index_rapns_feedback_on_device_token
93
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
94
+ if index_name_exists?(:rapns_feedback, :index_rapns_feedback_on_device_token)
95
+ remove_index :rapns_feedback, name: :index_rapns_feedback_on_device_token
96
+ end
97
+ else
98
+ if index_name_exists?(:rapns_feedback, :index_rapns_feedback_on_device_token, true)
99
+ remove_index :rapns_feedback, name: :index_rapns_feedback_on_device_token
100
+ end
88
101
  end
102
+
89
103
  drop_table :rapns_feedback
90
104
  end
91
105
  end
@@ -181,11 +195,20 @@ class AddRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0
181
195
  change_column :rapns_notifications, :app_id, :integer, null: false
182
196
  remove_column :rapns_notifications, :app
183
197
 
184
- if index_name_exists?(:rapns_notifications, "index_rapns_notifications_multi", true)
185
- remove_index :rapns_notifications, name: "index_rapns_notifications_multi"
186
- elsif index_name_exists?(:rapns_notifications, "index_rapns_notifications_on_delivered_failed_deliver_after", false)
187
- remove_index :rapns_notifications, name: "index_rapns_notifications_on_delivered_failed_deliver_after"
198
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
199
+ if index_name_exists?(:rapns_notifications, "index_rapns_notifications_multi")
200
+ remove_index :rapns_notifications, name: "index_rapns_notifications_multi"
201
+ elsif index_name_exists?(:rapns_notifications, "index_rapns_notifications_on_delivered_failed_deliver_after")
202
+ remove_index :rapns_notifications, name: "index_rapns_notifications_on_delivered_failed_deliver_after"
203
+ end
204
+ else
205
+ if index_name_exists?(:rapns_notifications, "index_rapns_notifications_multi", true)
206
+ remove_index :rapns_notifications, name: "index_rapns_notifications_multi"
207
+ elsif index_name_exists?(:rapns_notifications, "index_rapns_notifications_on_delivered_failed_deliver_after", false)
208
+ remove_index :rapns_notifications, name: "index_rapns_notifications_on_delivered_failed_deliver_after"
209
+ end
188
210
  end
211
+
189
212
  add_index :rapns_notifications, [:app_id, :delivered, :failed, :deliver_after], name: "index_rapns_notifications_multi"
190
213
  end
191
214
 
@@ -222,8 +245,14 @@ class AddRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0
222
245
  AddGcm::Rapns::Notification.where(app_id: app.id).update_all(app: app.key)
223
246
  end
224
247
 
225
- if index_name_exists?(:rapns_notifications, :index_rapns_notifications_multi, true)
248
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
249
+ if index_name_exists?(:rapns_notifications, :index_rapns_notifications_multi)
250
+ remove_index :rapns_notifications, name: :index_rapns_notifications_multi
251
+ end
252
+ else
253
+ if index_name_exists?(:rapns_notifications, :index_rapns_notifications_multi, true)
226
254
  remove_index :rapns_notifications, name: :index_rapns_notifications_multi
255
+ end
227
256
  end
228
257
 
229
258
  remove_column :rapns_notifications, :app_id
@@ -293,12 +322,24 @@ class AddRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0
293
322
  rename_table :rapns_apps, :rpush_apps
294
323
  rename_table :rapns_feedback, :rpush_feedback
295
324
 
296
- if index_name_exists?(:rpush_notifications, :index_rapns_notifications_multi, true)
297
- rename_index :rpush_notifications, :index_rapns_notifications_multi, :index_rpush_notifications_multi
325
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
326
+ if index_name_exists?(:rpush_notifications, :index_rapns_notifications_multi)
327
+ rename_index :rpush_notifications, :index_rapns_notifications_multi, :index_rpush_notifications_multi
328
+ end
329
+ else
330
+ if index_name_exists?(:rpush_notifications, :index_rapns_notifications_multi, true)
331
+ rename_index :rpush_notifications, :index_rapns_notifications_multi, :index_rpush_notifications_multi
332
+ end
298
333
  end
299
334
 
300
- if index_name_exists?(:rpush_feedback, :index_rapns_feedback_on_device_token, true)
301
- rename_index :rpush_feedback, :index_rapns_feedback_on_device_token, :index_rpush_feedback_on_device_token
335
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
336
+ if index_name_exists?(:rpush_feedback, :index_rapns_feedback_on_device_token)
337
+ rename_index :rpush_feedback, :index_rapns_feedback_on_device_token, :index_rpush_feedback_on_device_token
338
+ end
339
+ else
340
+ if index_name_exists?(:rpush_feedback, :index_rapns_feedback_on_device_token, true)
341
+ rename_index :rpush_feedback, :index_rapns_feedback_on_device_token, :index_rpush_feedback_on_device_token
342
+ end
302
343
  end
303
344
 
304
345
  update_type(RenameRapnsToRpush::Rpush::Notification, 'Rapns::Apns::Notification', 'Rpush::Apns::Notification')
@@ -323,12 +364,24 @@ class AddRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0
323
364
  update_type(RenameRapnsToRpush::Rpush::App, 'Rpush::Adm::App', 'Rapns::Adm::App')
324
365
  update_type(RenameRapnsToRpush::Rpush::App, 'Rpush::Wpns::App', 'Rapns::Wpns::App')
325
366
 
326
- if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
327
- rename_index :rpush_notifications, :index_rpush_notifications_multi, :index_rapns_notifications_multi
367
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
368
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi)
369
+ rename_index :rpush_notifications, :index_rpush_notifications_multi, :index_rapns_notifications_multi
370
+ end
371
+ else
372
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
373
+ rename_index :rpush_notifications, :index_rpush_notifications_multi, :index_rapns_notifications_multi
374
+ end
328
375
  end
329
376
 
330
- if index_name_exists?(:rpush_feedback, :index_rpush_feedback_on_device_token, true)
331
- rename_index :rpush_feedback, :index_rpush_feedback_on_device_token, :index_rapns_feedback_on_device_token
377
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
378
+ if index_name_exists?(:rpush_feedback, :index_rpush_feedback_on_device_token)
379
+ rename_index :rpush_feedback, :index_rpush_feedback_on_device_token, :index_rapns_feedback_on_device_token
380
+ end
381
+ else
382
+ if index_name_exists?(:rpush_feedback, :index_rpush_feedback_on_device_token, true)
383
+ rename_index :rpush_feedback, :index_rpush_feedback_on_device_token, :index_rapns_feedback_on_device_token
384
+ end
332
385
  end
333
386
 
334
387
  rename_table :rpush_notifications, :rapns_notifications
@@ -10,9 +10,16 @@ class CreateRapnsFeedback < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Mi
10
10
  end
11
11
 
12
12
  def self.down
13
- if index_name_exists?(:rapns_feedback, :index_rapns_feedback_on_device_token, true)
14
- remove_index :rapns_feedback, name: :index_rapns_feedback_on_device_token
13
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
14
+ if index_name_exists?(:rapns_feedback, :index_rapns_feedback_on_device_token)
15
+ remove_index :rapns_feedback, name: :index_rapns_feedback_on_device_token
16
+ end
17
+ else
18
+ if index_name_exists?(:rapns_feedback, :index_rapns_feedback_on_device_token, true)
19
+ remove_index :rapns_feedback, name: :index_rapns_feedback_on_device_token
20
+ end
15
21
  end
22
+
16
23
  drop_table :rapns_feedback
17
24
  end
18
25
  end
@@ -21,9 +21,16 @@ class CreateRapnsNotifications < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecor
21
21
  end
22
22
 
23
23
  def self.down
24
- if index_name_exists?(:rapns_notifications, 'index_rapns_notifications_multi', true)
25
- remove_index :rapns_notifications, name: 'index_rapns_notifications_multi'
24
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
25
+ if index_name_exists?(:rapns_notifications, 'index_rapns_notifications_multi')
26
+ remove_index :rapns_notifications, name: 'index_rapns_notifications_multi'
27
+ end
28
+ else
29
+ if index_name_exists?(:rapns_notifications, 'index_rapns_notifications_multi', true)
30
+ remove_index :rapns_notifications, name: 'index_rapns_notifications_multi'
31
+ end
26
32
  end
33
+
27
34
  drop_table :rapns_notifications
28
35
  end
29
36
  end
@@ -18,12 +18,24 @@ class RenameRapnsToRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Mig
18
18
  rename_table :rapns_apps, :rpush_apps
19
19
  rename_table :rapns_feedback, :rpush_feedback
20
20
 
21
- if index_name_exists?(:rpush_notifications, :index_rapns_notifications_multi, true)
22
- rename_index :rpush_notifications, :index_rapns_notifications_multi, :index_rpush_notifications_multi
21
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
22
+ if index_name_exists?(:rpush_notifications, :index_rapns_notifications_multi)
23
+ rename_index :rpush_notifications, :index_rapns_notifications_multi, :index_rpush_notifications_multi
24
+ end
25
+ else
26
+ if index_name_exists?(:rpush_notifications, :index_rapns_notifications_multi, true)
27
+ rename_index :rpush_notifications, :index_rapns_notifications_multi, :index_rpush_notifications_multi
28
+ end
23
29
  end
24
30
 
25
- if index_name_exists?(:rpush_feedback, :index_rapns_feedback_on_device_token, true)
26
- rename_index :rpush_feedback, :index_rapns_feedback_on_device_token, :index_rpush_feedback_on_device_token
31
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
32
+ if index_name_exists?(:rpush_feedback, :index_rapns_feedback_on_device_token)
33
+ rename_index :rpush_feedback, :index_rapns_feedback_on_device_token, :index_rpush_feedback_on_device_token
34
+ end
35
+ else
36
+ if index_name_exists?(:rpush_feedback, :index_rapns_feedback_on_device_token, true)
37
+ rename_index :rpush_feedback, :index_rapns_feedback_on_device_token, :index_rpush_feedback_on_device_token
38
+ end
27
39
  end
28
40
 
29
41
  update_type(RenameRapnsToRpush::Rpush::Notification, 'Rapns::Apns::Notification', 'Rpush::Apns::Notification')
@@ -48,12 +60,24 @@ class RenameRapnsToRpush < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Mig
48
60
  update_type(RenameRapnsToRpush::Rpush::App, 'Rpush::Adm::App', 'Rapns::Adm::App')
49
61
  update_type(RenameRapnsToRpush::Rpush::App, 'Rpush::Wpns::App', 'Rapns::Wpns::App')
50
62
 
51
- if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
52
- rename_index :rpush_notifications, :index_rpush_notifications_multi, :index_rapns_notifications_multi
63
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
64
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi)
65
+ rename_index :rpush_notifications, :index_rpush_notifications_multi, :index_rapns_notifications_multi
66
+ end
67
+ else
68
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
69
+ rename_index :rpush_notifications, :index_rpush_notifications_multi, :index_rapns_notifications_multi
70
+ end
53
71
  end
54
72
 
55
- if index_name_exists?(:rpush_feedback, :index_rpush_feedback_on_device_token, true)
56
- rename_index :rpush_feedback, :index_rpush_feedback_on_device_token, :index_rapns_feedback_on_device_token
73
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
74
+ if index_name_exists?(:rpush_feedback, :index_rpush_feedback_on_device_token)
75
+ rename_index :rpush_feedback, :index_rpush_feedback_on_device_token, :index_rapns_feedback_on_device_token
76
+ end
77
+ else
78
+ if index_name_exists?(:rpush_feedback, :index_rpush_feedback_on_device_token, true)
79
+ rename_index :rpush_feedback, :index_rpush_feedback_on_device_token, :index_rapns_feedback_on_device_token
80
+ end
57
81
  end
58
82
 
59
83
  rename_table :rpush_notifications, :rapns_notifications
@@ -17,8 +17,14 @@ class Rpush200Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migrat
17
17
  add_column :rpush_notifications, :processing, :boolean, null: false, default: false
18
18
  add_column :rpush_notifications, :priority, :integer, null: true
19
19
 
20
- if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
21
- remove_index :rpush_notifications, name: :index_rpush_notifications_multi
20
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
21
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi)
22
+ remove_index :rpush_notifications, name: :index_rpush_notifications_multi
23
+ end
24
+ else
25
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
26
+ remove_index :rpush_notifications, name: :index_rpush_notifications_multi
27
+ end
22
28
  end
23
29
 
24
30
  add_index :rpush_notifications, [:delivered, :failed], name: 'index_rpush_notifications_multi', where: 'NOT delivered AND NOT failed'
@@ -46,8 +52,14 @@ class Rpush200Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migrat
46
52
  change_column :rpush_feedback, :app_id, :string
47
53
  rename_column :rpush_feedback, :app_id, :app
48
54
 
49
- if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
50
- remove_index :rpush_notifications, name: :index_rpush_notifications_multi
55
+ if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
56
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi)
57
+ remove_index :rpush_notifications, name: :index_rpush_notifications_multi
58
+ end
59
+ else
60
+ if index_name_exists?(:rpush_notifications, :index_rpush_notifications_multi, true)
61
+ remove_index :rpush_notifications, name: :index_rpush_notifications_multi
62
+ end
51
63
  end
52
64
 
53
65
  add_index :rpush_notifications, [:app_id, :delivered, :failed, :deliver_after], name: 'index_rpush_notifications_multi'
@@ -2,7 +2,7 @@ module Rpush
2
2
  module VERSION
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- TINY = 1
5
+ TINY = 2
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpush
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Leitch