lite-form 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/_config.yml +1 -0
- data/lib/lite/form/helpers/propagation.rb +3 -3
- data/lib/lite/form/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 332e38b7f8b9e39c80cf2e13643938e14338bc907d6b503f9b07a02dd451748e
|
4
|
+
data.tar.gz: b5741f66ae2607c67015d8c52ad2ff3661ec37c97cf2076772a33d3adfa6801b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 721309484a981b86df4b9f33a5b8e1db0a5a5588e47a70d36c88dc1fa988df86ad8c543db3e06316ec25d0f9ce9746404e8c4c237401b9e099ab3bf91dac6339
|
7
|
+
data.tar.gz: b4355a52c6175f59d881b812655c9690c34e6d3270717b3b29ff9c904134ac48c0c27201b406b36892a69427a648af3dd2fdaa3a4bf6b295124b4a2454ec2082
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
-
## [1.0.
|
9
|
+
## [1.0.1] - 2019-09-12
|
10
|
+
### Fixed
|
11
|
+
- Fixed issue where create propagation was being returned without errors
|
12
|
+
|
13
|
+
## [1.0.0] - 2019-09-12
|
10
14
|
### Added
|
11
15
|
- Initial project version
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -70,7 +70,7 @@ class UserForm < ApplicationForm
|
|
70
70
|
def create_action
|
71
71
|
# Propagation methods help you perform an action on an object.
|
72
72
|
# If successful is returns the result else it adds the object
|
73
|
-
# errors to the form object. Available propagation methods are
|
73
|
+
# errors to the form object. Available propagation methods are:
|
74
74
|
# `create_and_return!(object, params)`, `update_and_return!(object, params)`,
|
75
75
|
# `save_and_return!(object)`, and `destroy_and_return!(object)`
|
76
76
|
create_and_return!(User, attributes)
|
data/_config.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
theme: jekyll-theme-leap-day
|
@@ -9,19 +9,19 @@ module Lite
|
|
9
9
|
|
10
10
|
%i[archive destroy save].each do |action|
|
11
11
|
define_method("#{action}_and_return!") do |klass|
|
12
|
-
|
12
|
+
merge_errors!(klass) unless klass.send(action)
|
13
13
|
klass
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
def create_and_return!(klass, params)
|
18
18
|
klass = klass.create(params)
|
19
|
-
|
19
|
+
merge_errors!(klass) unless klass.persisted?
|
20
20
|
klass
|
21
21
|
end
|
22
22
|
|
23
23
|
def update_and_return!(klass, params)
|
24
|
-
|
24
|
+
merge_errors!(klass) unless klass.update(params)
|
25
25
|
klass
|
26
26
|
end
|
27
27
|
|
data/lib/lite/form/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite-form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- LICENSE.txt
|
198
198
|
- README.md
|
199
199
|
- Rakefile
|
200
|
+
- _config.yml
|
200
201
|
- bin/console
|
201
202
|
- bin/setup
|
202
203
|
- lib/generators/lite/form/install_generator.rb
|