notifiable-rails 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/notifiable/device_tokens_controller.rb +11 -11
- data/lib/notifiable/version.rb +1 -1
- data/spec/test_app/log/test.log +1895 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 517b2ed6174e9bd62e6e780f4f83b4e8615a33df
|
4
|
+
data.tar.gz: e6d16036d447f3ce4e252bd5338fab1ca86e7384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abe080484c13af1cff08c15ebf90ebcde24204180061ff91222a2336e4f97329d3aee1830d623d248be179f220b5983b1524e9d952505cfd18e97cca2a24a46a
|
7
|
+
data.tar.gz: 26d5b31cf9d864c182cdaf9088c5f9a83ab8bdd6c09ef6da254c9cd3f5b14fe5e14c41b513fa36d9c681e1003a52c99b58b5b37e77360e430364ef8751d3bca0
|
@@ -13,11 +13,19 @@ module Notifiable
|
|
13
13
|
@device_token = DeviceToken.find_by(:token => params[:token])
|
14
14
|
@device_token = DeviceToken.new unless @device_token
|
15
15
|
|
16
|
-
|
16
|
+
if @device_token.update_attributes(device_token_params)
|
17
|
+
render :json => { :id => @device_token.id }, :status => :ok
|
18
|
+
else
|
19
|
+
render :json => { :errors => @device_token.errors.full_messages }, :status => :unprocessable_entity
|
20
|
+
end
|
17
21
|
end
|
18
22
|
|
19
23
|
def update
|
20
|
-
|
24
|
+
if @device_token.update_attributes(device_token_params)
|
25
|
+
head :status => :ok
|
26
|
+
else
|
27
|
+
render :json => { :errors => @device_token.errors.full_messages }, :status => :unprocessable_entity
|
28
|
+
end
|
21
29
|
end
|
22
30
|
|
23
31
|
def destroy
|
@@ -28,15 +36,7 @@ module Notifiable
|
|
28
36
|
end
|
29
37
|
end
|
30
38
|
|
31
|
-
private
|
32
|
-
def perform_update(params)
|
33
|
-
if @device_token.update_attributes(params)
|
34
|
-
render :json => @device_token, :status => :ok
|
35
|
-
else
|
36
|
-
render :json => { :errors => @device_token.errors.full_messages }, :status => :unprocessable_entity
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
39
|
+
private
|
40
40
|
def device_token_params
|
41
41
|
device_token_params = params.permit(Notifiable.api_device_token_params)
|
42
42
|
|
data/lib/notifiable/version.rb
CHANGED