eivo-rails-api 0.0.6 → 0.0.7

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: e8ca540f8217156b765e15258ae4183347d801e8
4
- data.tar.gz: c4a50640b15c2c352e305a268215a2f4f4641c63
3
+ metadata.gz: 4b93f8aa8e0fe3d2189265c57125ed2974ec6c62
4
+ data.tar.gz: bb669e2d2c833a5bb88fb412153eef83759214e7
5
5
  SHA512:
6
- metadata.gz: 5564cdb5b805d7a14335cdae3597655481dbc5b473aa14772ccdfb73f396487e9cc62b9d431c8233fae58cd06bd81359e60ee641b34663b9b238d9f1025a3fd1
7
- data.tar.gz: 96c282e73bec60cba58e5559b6a767828e1b0d9c25c18910406fe64abd67df5250e69fd7062734c992b3292d5aba74b18c7449a44bfaf05e32752251184e8486
6
+ metadata.gz: 0846f4061e04880efede8b0fa6eb820d186c2ebab02ecffc9694441620b9a6bebfe50cf04bc70fc678a2f40640fc3d6469a3fe5731e8528d2758bf51207d6ee4
7
+ data.tar.gz: 3f084ba81858becbafeadfb76ec9d1b8dd8778c1b3899398c3f16bdf14ba6778a8fcba002f847620831c948f454b872b78cf1a5c4af0a43a65d478b4a245832a
@@ -15,7 +15,9 @@ module EIVO
15
15
  end
16
16
 
17
17
  def create
18
- @object ||= collection.new(object_params_create)
18
+ @object ||= collection.new
19
+ @object.assign_attributes(object_params_create)
20
+
19
21
  if @object.save
20
22
  render_success serializer.new(@object, @serializer_options)
21
23
  else
@@ -25,7 +27,9 @@ module EIVO
25
27
 
26
28
  def update
27
29
  @object ||= collection
28
- if @object.update(object_params_update)
30
+ @object.assign_attributes(object_params_update)
31
+
32
+ if @object.save
29
33
  render_success serializer.new(@object, @serializer_options)
30
34
  else
31
35
  render_model_errors @object.errors
@@ -37,7 +37,9 @@ module EIVO
37
37
  end
38
38
 
39
39
  def create
40
- @object ||= collection.new(object_params_create)
40
+ @object ||= collection.new
41
+ @object.assign_attributes(object_params_create)
42
+
41
43
  if @object.save
42
44
  render_success serializer.new(@object, @serializer_options)
43
45
  else
@@ -47,7 +49,9 @@ module EIVO
47
49
 
48
50
  def update
49
51
  @object ||= collection.find(params[:id])
50
- if @object.update(object_params_update)
52
+ @object.assign_attributes(object_params_update)
53
+
54
+ if @object.save
51
55
  render_success serializer.new(@object, @serializer_options)
52
56
  else
53
57
  render_model_errors @object.errors
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'eivo-rails-api'
5
- spec.version = '0.0.6'
5
+ spec.version = '0.0.7'
6
6
  spec.authors = ['Jonathan VUKOVICH-TRIBOUHARET']
7
7
  spec.email = ['jonathan@eivo.co']
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eivo-rails-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan VUKOVICH-TRIBOUHARET
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-11 00:00:00.000000000 Z
11
+ date: 2019-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor