rasti-form 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rasti/form/version.rb +1 -1
- data/lib/rasti/form.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4741522b947fe4e41362f7350a8334b93fb949c1
|
4
|
+
data.tar.gz: e778bd35d8f3a8f48e095482076b403ce222541a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c371e0e8f3966238846156a150aa99fff8a83dca10315f7a4ff819b9f1ecadad52a5dfb710f3685ec9d724f34b39f6afa8e384d2e0882337553a2e02215b955a
|
7
|
+
data.tar.gz: c13b74e182bd6fb8d6c9f9a55ea31cd6db1defe8b01a8605a8a9fe85aa7300be247a1ced2e203fe0d0d2d978aa40e71dcbb87e1aee20f33ffd577d98cc0f7cf0
|
data/lib/rasti/form/version.rb
CHANGED
data/lib/rasti/form.rb
CHANGED
@@ -83,19 +83,20 @@ module Rasti
|
|
83
83
|
|
84
84
|
def assign_attributes(attrs={})
|
85
85
|
attrs.each do |name, value|
|
86
|
+
attr_name = name.to_sym
|
86
87
|
begin
|
87
|
-
if self.class.attributes.key?
|
88
|
-
write_attribute
|
88
|
+
if self.class.attributes.key? attr_name
|
89
|
+
write_attribute attr_name, value
|
89
90
|
else
|
90
|
-
errors[
|
91
|
+
errors[attr_name] << 'unexpected attribute'
|
91
92
|
end
|
92
93
|
|
93
94
|
rescue CastError => error
|
94
|
-
errors[
|
95
|
+
errors[attr_name] << error.message
|
95
96
|
|
96
97
|
rescue ValidationError => error
|
97
98
|
error.errors.each do |inner_name, inner_errors|
|
98
|
-
inner_errors.each { |message| errors["#{
|
99
|
+
inner_errors.each { |message| errors["#{attr_name}.#{inner_name}"] << message }
|
99
100
|
end
|
100
101
|
end
|
101
102
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasti-form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_require
|