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: 9648efd127afec99207dae2c319b492a841101e3cabcb809dde11f541252400e
4
- data.tar.gz: 0b0a79f22453ca49c2d6e7f5697b3ebb93a5042841ff9ac5c6f5b585252f45ee
3
+ metadata.gz: 7002f861f64ff1747bb41baa65026f4c74db325a8bd1a230a2846283c2d7b65e
4
+ data.tar.gz: f31eb5759067290435edf494fc2a0317208d7e9301affdae34334b009368fb81
5
5
  SHA512:
6
- metadata.gz: 59a292c2a89751f1bd06806f9a89a0987c9c5a07dd897f8d235cb50c14417b7bb35fe4620e26476a38888851d8e9ef1a218feff612e77a4b8784b016d12a58b5
7
- data.tar.gz: cdc08c68e5872c95ffc929830f3fc123a6a9292d7afb04467e04963695bfb4c28e4f784557e6a974b1bb18a5426498227613c976b6935ebe5d75243415d0d4cb
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
- redirect_to_model
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
- redirect_to_model
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://'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecordApi
4
4
  module Rest
5
- VERSION = '1.0.14'.freeze
5
+ VERSION = '1.0.15'.freeze
6
6
  end
7
7
  end
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.14
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-12 00:00:00.000000000 Z
11
+ date: 2019-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler