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 +4 -4
- data/lib/formwandler/field.rb +2 -2
- data/lib/formwandler/form.rb +3 -2
- data/lib/formwandler/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c58985c9314b2ee1dbeb4372f7c0554eb16322c27767daaf227ae6be46b8b61e
|
4
|
+
data.tar.gz: cc39146f7953edc67dc131ec87e48d54b6631882f2457b565744ebabb602ab92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55eeb2ca00dcf309f9eaa60a57326fb5feb3f684a5ddf2fcaf889e551b03048f60863570a97f4fa6b886b13bc9a27b01839d1ef751506158a010569d6f7b4cf4
|
7
|
+
data.tar.gz: 593380319ef6ac9e31a74ac204aa0ac9f88b402ff077a23caa0b67c3a4ae0d526814f6c18b15057953858c5db0fc4bcecd3434c4f0bec201359a6b09b67ac723
|
data/lib/formwandler/field.rb
CHANGED
@@ -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("#{
|
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(
|
28
|
+
model_instance ? model_instance.public_send(source) : @value
|
29
29
|
end
|
30
30
|
|
31
31
|
def hidden?
|
data/lib/formwandler/form.rb
CHANGED
@@ -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
|
data/lib/formwandler/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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.
|
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: []
|