aform 0.0.7 → 0.0.8

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: d9df2b57aeb8971ff9e39d745dcd5eff638dda62
4
- data.tar.gz: e571e37db8431d9058396d5ffa2400ead9ccb501
3
+ metadata.gz: c3e9528f74d5c3f18e44f52ec39ec5ffc1f90cfe
4
+ data.tar.gz: 0772c89c70b7ea965c9d758e4fabc52fccef0ccd
5
5
  SHA512:
6
- metadata.gz: 6179f8685ab941adbe1bae32685857787978c7931cb47698968aee0d51e82915132526205afe2ec28e3eff30d276e35f7adab6fa4ead45811f184f74b80a6749
7
- data.tar.gz: 07d14ba691df39bc0f35f0ad77f6a2d8caddfebe36146f5ea9f8400cf8bb0c9da9970095d2f81db77f78f714cdad1b649e159d932e2aabe27169209f66c9b60a
6
+ metadata.gz: a19b3824ebc90036f5a8d7b8be5a0e04e1181a8288bb84b202427c92b8d37ebef2f02a1d129bb2d6e1f9f84867ae4040a1e0de8ee650ee9a6135362edb4d3084
7
+ data.tar.gz: 1ae43757cc9900acc5e804c7bbe967c19bd9e7172165f0e680b19a85d4b157a333857c4c2b33e5286bf166782ed783ad99079909741b15be1f254ba0b2aa0252
@@ -52,7 +52,7 @@ class Aform::Model
52
52
  if @form.respond_to?(p[:field])
53
53
  memo.merge(field_name => @form.public_send(p[:field], attrs))
54
54
  else
55
- if !attrs[p[:field]].nil?
55
+ if attrs.has_key?(p[:field])
56
56
  memo.merge(field_name => attrs[p[:field]])
57
57
  else
58
58
  memo
@@ -1,3 +1,3 @@
1
1
  module Aform
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -117,6 +117,15 @@ describe Aform::Model do
117
117
  association.must_equal([model])
118
118
  end
119
119
  end
120
+
121
+ context "when value of a param is null" do
122
+ let(:form_model) { subject.new(model, mock_form, name: nil, count: 2, other_attr: "other")}
123
+ let(:model) { mock_ar_model(attributes: {name: "123"}) }
124
+ it "saves nil" do
125
+ form_model.save
126
+ model.attributes.must_equal(name: nil, count: 2)
127
+ end
128
+ end
120
129
  end
121
130
 
122
131
  context "when object for destroying" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Versal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-07 00:00:00.000000000 Z
11
+ date: 2014-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport