formbuilder-rb 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/formbuilder/entry.rb +1 -0
- data/lib/formbuilder/version.rb +1 -1
- data/spec/lib/formbuilder/entry_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a894b4589a8cef57008cf4f90c567343348d950
|
4
|
+
data.tar.gz: 6d3752d4b3e3f1ee6a82c44d7a243e97d10019c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64db786cdde7a337a757f9e906261f5ac37fdde9441edb02dcbedc991b862c42561a0431c1bf8495bd29e259e915c0f090c4d52e84618ee3aa49fdcefbddaae6
|
7
|
+
data.tar.gz: d5d483d47ca724698226ea107027b9832b774b127f0cb49e43b60ff85c646221f7abb3065f23e7af6b1902b334216c1d742d2090dc0e6a85f3482f4340732f9d
|
data/Gemfile.lock
CHANGED
data/lib/formbuilder/entry.rb
CHANGED
@@ -112,6 +112,7 @@ module Formbuilder
|
|
112
112
|
|
113
113
|
def save_responses(response_field_params, response_fields, opts = {})
|
114
114
|
set_responses({}) unless opts[:partial_update]
|
115
|
+
response_field_params ||= {}
|
115
116
|
|
116
117
|
response_fields.select { |rf| rf.input_field }.each do |response_field|
|
117
118
|
self.save_response(response_field_params[response_field.id.to_s], response_field, response_field_params)
|
data/lib/formbuilder/version.rb
CHANGED
@@ -98,6 +98,10 @@ describe Formbuilder::Entry do
|
|
98
98
|
entry.save_responses({ "#{first_field.id}" => 'boo' }, form.response_fields)
|
99
99
|
entry.response_value(first_field).should == 'boo'
|
100
100
|
end
|
101
|
+
|
102
|
+
it 'should not choke on nil' do
|
103
|
+
entry.save_responses(nil, form.response_fields)
|
104
|
+
end
|
101
105
|
end
|
102
106
|
|
103
107
|
describe '#destroy_response' do
|