freeform 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- freeform (0.0.4)
4
+ freeform (1.0.0)
5
5
  activemodel
6
6
  formtastic
7
7
  nested_form (~> 0.3.2)
@@ -34,7 +34,9 @@ module FreeForm
34
34
 
35
35
  # Example: form.addresses will return all nested address forms
36
36
  define_method(:"#{attribute}") do
37
- @nested_attributes ||= []
37
+ value = instance_variable_get("@nested_#{attribute}")
38
+ value ||= []
39
+ instance_variable_set("@nested_#{attribute}", value)
38
40
  end
39
41
 
40
42
  # Example: form.build_addresses (optional custom initializer)
@@ -53,8 +55,11 @@ module FreeForm
53
55
 
54
56
  # Build new model
55
57
  form_model = form_class.new(initializer)
56
- @nested_attributes ||= []
57
- @nested_attributes << form_model
58
+ value = instance_variable_get("@nested_#{attribute}")
59
+ value ||= []
60
+ value << form_model
61
+ instance_variable_set("@nested_#{attribute}", value)
62
+
58
63
  form_model
59
64
  end
60
65
  alias_method :"build_#{singularized_attribute}", :"build_#{attribute}"
@@ -1,3 +1,3 @@
1
1
  module Freeform
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
Binary file