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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d80510c787edb2b4e300a9c42aacf98dc93a188
4
- data.tar.gz: 42cbf2765f69f2e681b068ec26d68dca5acb1a57
3
+ metadata.gz: 4741522b947fe4e41362f7350a8334b93fb949c1
4
+ data.tar.gz: e778bd35d8f3a8f48e095482076b403ce222541a
5
5
  SHA512:
6
- metadata.gz: 37a450b673cb95de15c1b13acd555c687211486c442121f093dc530b5a75444eb15708d54fc4b838c4178fc0c3bceeb52e169f459736044e3ead14cc8a16d05e
7
- data.tar.gz: e24ae1cb69be7eae15483f7b630668af82b08fe34b609c89209fee63b8f7bc92c5f1661bc749a1d749d884d48036944e0ba86b777bb71234c15d7b4ddc76af6c
6
+ metadata.gz: c371e0e8f3966238846156a150aa99fff8a83dca10315f7a4ff819b9f1ecadad52a5dfb710f3685ec9d724f34b39f6afa8e384d2e0882337553a2e02215b955a
7
+ data.tar.gz: c13b74e182bd6fb8d6c9f9a55ea31cd6db1defe8b01a8605a8a9fe85aa7300be247a1ced2e203fe0d0d2d978aa40e71dcbb87e1aee20f33ffd577d98cc0f7cf0
@@ -1,5 +1,5 @@
1
1
  module Rasti
2
2
  class Form
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
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? name
88
- write_attribute name, value
88
+ if self.class.attributes.key? attr_name
89
+ write_attribute attr_name, value
89
90
  else
90
- errors[name] << 'unexpected attribute'
91
+ errors[attr_name] << 'unexpected attribute'
91
92
  end
92
93
 
93
94
  rescue CastError => error
94
- errors[name] << error.message
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["#{name}.#{inner_name}"] << message }
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.2
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-09-27 00:00:00.000000000 Z
11
+ date: 2017-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_require