active_record_api-rest 1.0.14 → 1.0.15
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7002f861f64ff1747bb41baa65026f4c74db325a8bd1a230a2846283c2d7b65e
|
4
|
+
data.tar.gz: f31eb5759067290435edf494fc2a0317208d7e9301affdae34334b009368fb81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb151f99b8f3aa796cf4f282005714a1c22c75444697f8cd7ffaea6051cc26772efe2520e76dadf3eb441d1040e24674870760255118f87a52677392a342dd9b
|
7
|
+
data.tar.gz: 1acacde814702317e012c331a58d8b61f2657f4d55e6fdfa20df0159437cf60e7f2c76cac0f99ddc3494bb9aa312727662f2abad5cd790f5a60444f427950ae2
|
@@ -14,13 +14,12 @@ module ActiveRecordApi
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def show
|
17
|
-
return unless stale?(last_modified: model.updated_at)
|
18
17
|
render json: model, serializer: serializer
|
19
18
|
end
|
20
19
|
|
21
20
|
def create
|
22
21
|
if model.save
|
23
|
-
|
22
|
+
render json: model
|
24
23
|
else
|
25
24
|
render json: model.errors, status: :unprocessable_entity
|
26
25
|
end
|
@@ -28,7 +27,7 @@ module ActiveRecordApi
|
|
28
27
|
|
29
28
|
def update
|
30
29
|
if model.update(modifiable_params)
|
31
|
-
|
30
|
+
render json: model
|
32
31
|
else
|
33
32
|
render json: model.errors, status: :unprocessable_entity
|
34
33
|
end
|
@@ -22,14 +22,6 @@ module ActiveRecordApi
|
|
22
22
|
"#{protocol}#{host_with_port}#{path}"
|
23
23
|
end
|
24
24
|
|
25
|
-
def redirect_url(model)
|
26
|
-
if action_name == 'update'
|
27
|
-
current_url
|
28
|
-
else
|
29
|
-
"#{current_url}/#{model.id}"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
25
|
def protocol
|
34
26
|
return 'http://' if Rails.env.development?
|
35
27
|
'https://'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_api-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Full Measure Education
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|