formwandler 0.8.1 → 0.8.2

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: 66346495ce82162b0731fb3263fa8977dd8f55e80c1e1f919fa7014b5b612e9c
4
- data.tar.gz: 40056efd340d347534d994208c7d3a01940321f77df11796e0f9c9a7f61d582a
3
+ metadata.gz: c58985c9314b2ee1dbeb4372f7c0554eb16322c27767daaf227ae6be46b8b61e
4
+ data.tar.gz: cc39146f7953edc67dc131ec87e48d54b6631882f2457b565744ebabb602ab92
5
5
  SHA512:
6
- metadata.gz: 1e8f616e7ffeee9c4c709d041f804acb39c90a749c302b705350728f9786bcbf5f67d4ecf783c53fb6907be9d176ba8977479ae1590ee8cac272ffd6468cfba6
7
- data.tar.gz: 28dc8f68e34baf128ff272c02e9bdd84c01aabddec4d4d8a32c1923f00becc2037201ec8d66aa3d350ee75bbcf682909ba2b1ebba64672c533a01ea3e3d0d03f
6
+ metadata.gz: 55eeb2ca00dcf309f9eaa60a57326fb5feb3f684a5ddf2fcaf889e551b03048f60863570a97f4fa6b886b13bc9a27b01839d1ef751506158a010569d6f7b4cf4
7
+ data.tar.gz: 593380319ef6ac9e31a74ac204aa0ac9f88b402ff077a23caa0b67c3a4ae0d526814f6c18b15057953858c5db0fc4bcecd3434c4f0bec201359a6b09b67ac723
@@ -14,7 +14,7 @@ module Formwandler
14
14
  def value=(new_value)
15
15
  new_value = transform_value(new_value, field_definition.in_transformation)
16
16
  if model_instance
17
- model_instance.public_send("#{field_definition.source}=", new_value)
17
+ model_instance.public_send("#{source}=", new_value)
18
18
  else
19
19
  @value = new_value
20
20
  end
@@ -25,7 +25,7 @@ module Formwandler
25
25
  end
26
26
 
27
27
  def raw_value
28
- model_instance ? model_instance.public_send(field_definition.source) : @value
28
+ model_instance ? model_instance.public_send(source) : @value
29
29
  end
30
30
 
31
31
  def hidden?
@@ -126,11 +126,12 @@ module Formwandler
126
126
  def models_valid?
127
127
  all_valid = true
128
128
  models.each do |name, model|
129
- all_valid = false if model.invalid?
130
129
  next if model.valid?
130
+
131
+ all_valid = false
131
132
  fields_for_model(name).each do |field|
132
133
  model.errors[field.source].each do |error_message|
133
- errors.add(field.name, error_message)
134
+ errors.add(field.name, error_message) unless errors.messages[field.source].include? error_message
134
135
  end
135
136
  end
136
137
  end
@@ -1,3 +1,3 @@
1
1
  module Formwandler
2
- VERSION = '0.8.1'
2
+ VERSION = '0.8.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formwandler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Bilharz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-24 00:00:00.000000000 Z
11
+ date: 2020-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.3.6
89
+ version: '1.4'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.3.6
96
+ version: '1.4'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: byebug
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +127,7 @@ homepage: https://github.com/sbilharz/formwandler
127
127
  licenses:
128
128
  - MIT
129
129
  metadata: {}
130
- post_install_message:
130
+ post_install_message:
131
131
  rdoc_options: []
132
132
  require_paths:
133
133
  - lib
@@ -142,8 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubygems_version: 3.0.3
146
- signing_key:
145
+ rubygems_version: 3.1.2
146
+ signing_key:
147
147
  specification_version: 4
148
148
  summary: Form objects for rails
149
149
  test_files: []