acts_as_pushable 0.1.1 → 0.2.0

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: ed12f0e669f857b1557bfd63ceaf0b707666202e
4
- data.tar.gz: 82c4bbdfc796f1c940a6a0f1d4fa3eb89ee7b5c5
3
+ metadata.gz: a3cf52438238f0a1ecc519c79d1e0c109e2aa3b3
4
+ data.tar.gz: e0050a1abd40c76018e755af5c972c6df8949c03
5
5
  SHA512:
6
- metadata.gz: cc1fda57e9415e2492820c26a233311c0d6eea4886dde6112d98b8f2a56482ddfe2e2220ffb6c7699808ecf4633e84ef788ad23dd2bb49c739b0be8e5abf200d
7
- data.tar.gz: a8f27a82cd72ef09e38750ae37f5d1b722fb16f988be7b0b9abae1fd8ef23f186a302cbb217de5487f2b6a0d3f6723ab4a44b5084951e6ba65a02d7a49e8457c
6
+ metadata.gz: 85e0b91b69df6f7b34a3dbf0acdccf8e5ab1ffa6e6a3ada051fe55edd6dd953e616dff1f1957d8409bffddeeb7909ab3272c04ca1249679138813edfcfd122a6
7
+ data.tar.gz: 775bf5cd462bceaad998e312409039f5942e294b9ee76359f931f8b767380e4946e99d1cc6c35e4e23ce88747e619e9e2aaf923a2fcc272e0edaa872cb701129
data/README.md CHANGED
@@ -25,7 +25,8 @@ or just install it -
25
25
  Run the generator to create the migrations and initializer template -
26
26
 
27
27
  ```shell
28
- rails generate act_as_pushable
28
+ rails generate act_as_pushable:install
29
+ rake db:migrate
29
30
  ```
30
31
 
31
32
  This a file at `config/initializers/acts_as_pushable.rb` that you can modify to match your settings. Follow the quick start guides for the platforms that you want to support.
@@ -21,12 +21,20 @@ module ActsAsPushable
21
21
 
22
22
  def add_device(device_params)
23
23
  device = build_device(device_params)
24
- device.save
24
+ if device.save
25
+ return device
26
+ else
27
+ device.errors.each do |attribute, message|
28
+ errors.add(:devices, "#{attribute} #{message}")
29
+ end
30
+ return false
31
+ end
25
32
  end
26
33
 
27
34
  def add_device!(device_params)
28
35
  device = build_device(device_params)
29
36
  device.save!
37
+ return device
30
38
  end
31
39
 
32
40
  def send_push_notification(title:, message:, **options)
@@ -1,3 +1,3 @@
1
1
  module ActsAsPushable
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_pushable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Butler