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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a8ca7a4757adcecac09d4d977dbd354cdb9215f96a573ce9922e44602293f68
4
- data.tar.gz: 2ef1338ab530d735be39b77c8ce4e870bf8ed842d315635bd71475cd9e1aa1a3
3
+ metadata.gz: 332e38b7f8b9e39c80cf2e13643938e14338bc907d6b503f9b07a02dd451748e
4
+ data.tar.gz: b5741f66ae2607c67015d8c52ad2ff3661ec37c97cf2076772a33d3adfa6801b
5
5
  SHA512:
6
- metadata.gz: f3a33e566908020673daa66c4c0c91b596f791362fab0fe57ab7ea3f44718193bc790b8b20e40f9b5598410704d17e1574e4063dd77163c8c2903624b8f4b0ce
7
- data.tar.gz: bd5856b089ff8195158ed352882dcb96525ba6fcc6c0d9ea24dc4be5db5197b23025fdd7f73a4eb9f9ebdc4a24af0a7cc1b31152eeae3dd9070e36ff560075b0
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.0] - 2019-09-01
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-form (1.0.0)
4
+ lite-form (1.0.1)
5
5
  activemodel
6
6
 
7
7
  GEM
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
- errors.merge!(klass.errors) unless klass.send(action)
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
- errors.merge!(klass.errors) unless klass
19
+ merge_errors!(klass) unless klass.persisted?
20
20
  klass
21
21
  end
22
22
 
23
23
  def update_and_return!(klass, params)
24
- errors.merge!(klass.errors) unless klass.update(params)
24
+ merge_errors!(klass) unless klass.update(params)
25
25
  klass
26
26
  end
27
27
 
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Form
5
5
 
6
- VERSION ||= '1.0.0'
6
+ VERSION ||= '1.0.1'
7
7
 
8
8
  end
9
9
  end
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.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