checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
2
SHA1:
3
- metadata.gz: 853e197c30cf1421fb9d03d5d21f943a8f4f4c5f
4
- data.tar.gz: d07f296e9fbf67a2c1c60bbbb6dd0aad4df503f5
3
+ metadata.gz: f02b1ae8c4ce69f94cb9b83278b66e08ebc95eb8
4
+ data.tar.gz: 546d5981f2cdd574cccee8b89aca1d1af045a310
5
5
SHA512:
6
- metadata.gz: 4d0de50affc296a3cd5f7bd5cee04cc17a845ac438cd21604a21a49e6a7d59716c62907b62e978cb3c1604779c6c97c4d9b8dbaa169cf1b9eaa6ffd57b3ad13e
7
- data.tar.gz: 3f981d249aadb475ac8304129ba3ff6fc1dab5794a50e1f340e8e47cb0f3c50bfaa9e73806da69c3747ea4b3f33950ffbaafc1b5fa51a8d0142f181c726614d8
6
+ metadata.gz: 6fef5f71d2087d2aed03c1f01457b093795374b75b990480f939835221db50c788e1788815c32aaf406e5e11ccae24c25cd4a922dcebdde43322f417449e1061
7
+ data.tar.gz: b33d8d6c4b633467c2b9f0816281a564ac3d39ca5bce69371e096035a304cab1bf3c1221efc833c4f9cddac1e679f2594138b0fdd4d6bef5337d0d47829a6f82
data/app/controllers/eivo/concerns/resource.rb CHANGED
@@ -14,7 +14,9 @@ module EIVO
14
14
end
15
15
16
16
def create
17
- @object ||= collection.new(object_params_create)
17
+ @object ||= collection.new
18
+ @object.assign_attributes(object_params_create)
19
+
18
20
if @object.save
19
21
render :new
20
22
else
@@ -28,7 +30,9 @@ module EIVO
28
30
29
31
def update
30
32
@object ||= collection
31
- if @object.update(object_params_update)
33
+ @object.assign_attributes(object_params_update)
34
+
35
+ if @object.save
32
36
render :edit
33
37
else
34
38
redirect_to action: :index
data/app/controllers/eivo/concerns/resources.rb CHANGED
@@ -18,7 +18,9 @@ module EIVO
18
18
end
19
19
20
20
def create
21
- @object ||= collection.new(object_params_create)
21
+ @object ||= collection.new
22
+ @object.assign_attributes(object_params_create)
23
+
22
24
if @object.save
23
25
redirect_to action: :index
24
26
else
@@ -32,6 +34,8 @@ module EIVO
32
34
33
35
def update
34
36
@object ||= collection.find(params[:id])
37
+ @object.assign_attributes(object_params_update)
38
+
35
39
if @object.update(object_params_update)
36
40
redirect_to action: :index
37
41
else
data/eivo-rails.gemspec CHANGED
@@ -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'
5
- spec.version = '0.0.3'
5
+ spec.version = '0.0.4'
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
3
3
version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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-08 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