freeform 1.0.9 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +8 -8
- data/lib/freeform/form.rb +10 -69
- data/lib/freeform/version.rb +1 -1
- data/spec/dummy/bin/bundle +0 -0
- data/spec/dummy/bin/rails +0 -0
- data/spec/dummy/bin/rake +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +4582 -0
- metadata +3 -5
- data/freeform-1.0.7.gem +0 -0
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjA0MmU0YThkYWRkNjhmZjc4N2Y2NmUyOTE3MWE4MWZjZTVkZDc0NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTRmMGY1Yjc4YzkxNDUwNWEwNTZlNjVmYWNlODdhM2M2M2I0NTA3MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTM4ZjNlYmM5MGYyNjQ0OGYyN2VhZTIxNmY2Y2Y0Y2IyNzY0ODI2MTQ2NTQy
|
10
|
+
MWIyZjMxNjRmODc4ZGE4NTIyYTBhOTM2NGNkNTFmNmQ5ZWM5OGFlOTNiMTI5
|
11
|
+
MTg0YTRkYTI1YzhkN2UzOTY2OTE0M2RkZTAwMzMyZjg0ZmFhYWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTgzODg1NTFjM2YyNzVkNmRlMjYzZjAzODhlY2VmYmQ3Y2FiZDJmNGRhZmJk
|
14
|
+
NzEyMWIwMDFjNzUxZjMyMDY5ZjMzZDkwY2MxZDE0MTQyYTk2OTBhOTU4ZDkx
|
15
|
+
N2E2ZTkzZWZhNWJhNDliYmU2YzhhMzYyMDdmMDA2MTFjMzUyMWM=
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
freeform (1.0.
|
4
|
+
freeform (1.0.9)
|
5
5
|
activemodel
|
6
6
|
formtastic
|
7
|
-
rails (
|
7
|
+
rails (>= 3.2.0)
|
8
8
|
simple_form
|
9
9
|
|
10
10
|
GEM
|
@@ -46,7 +46,7 @@ GEM
|
|
46
46
|
rack-test (>= 0.5.4)
|
47
47
|
selenium-webdriver (~> 2.0)
|
48
48
|
xpath (~> 0.1.4)
|
49
|
-
childprocess (0.5.
|
49
|
+
childprocess (0.5.2)
|
50
50
|
ffi (~> 1.0, >= 1.0.11)
|
51
51
|
diff-lcs (1.2.5)
|
52
52
|
erubis (2.7.0)
|
@@ -65,14 +65,14 @@ GEM
|
|
65
65
|
mini_portile (0.5.2)
|
66
66
|
mocha (1.0.0)
|
67
67
|
metaclass (~> 0.0.1)
|
68
|
-
multi_json (1.9.
|
68
|
+
multi_json (1.9.2)
|
69
69
|
nokogiri (1.6.1)
|
70
70
|
mini_portile (~> 0.5.0)
|
71
71
|
polyglot (0.3.4)
|
72
72
|
rack (1.4.5)
|
73
73
|
rack-cache (1.2)
|
74
74
|
rack (>= 0.4)
|
75
|
-
rack-ssl (1.3.
|
75
|
+
rack-ssl (1.3.4)
|
76
76
|
rack
|
77
77
|
rack-test (0.6.2)
|
78
78
|
rack (>= 1.0)
|
@@ -110,8 +110,8 @@ GEM
|
|
110
110
|
rspec-core (~> 2.14.0)
|
111
111
|
rspec-expectations (~> 2.14.0)
|
112
112
|
rspec-mocks (~> 2.14.0)
|
113
|
-
rubyzip (1.1.
|
114
|
-
selenium-webdriver (2.
|
113
|
+
rubyzip (1.1.2)
|
114
|
+
selenium-webdriver (2.41.0)
|
115
115
|
childprocess (>= 0.5.0)
|
116
116
|
multi_json (~> 1.0)
|
117
117
|
rubyzip (~> 1.0)
|
@@ -125,7 +125,7 @@ GEM
|
|
125
125
|
rack (~> 1.0)
|
126
126
|
tilt (~> 1.1, != 1.3.0)
|
127
127
|
sqlite3 (1.3.9)
|
128
|
-
thor (0.
|
128
|
+
thor (0.19.1)
|
129
129
|
tilt (1.4.1)
|
130
130
|
treetop (1.4.15)
|
131
131
|
polyglot
|
data/lib/freeform/form.rb
CHANGED
@@ -32,16 +32,7 @@ module FreeForm
|
|
32
32
|
def save
|
33
33
|
return false unless valid? || marked_for_destruction?
|
34
34
|
|
35
|
-
#
|
36
|
-
self.class.models.each do |form_model|
|
37
|
-
model = send(form_model)
|
38
|
-
# This is for nested models.
|
39
|
-
if model.is_a?(Array)
|
40
|
-
model.each { |m| m.save }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
# After nested models are handled, save or destroy myself.
|
35
|
+
# Save or destroy myself.
|
45
36
|
self.class.models.each do |form_model|
|
46
37
|
model = send(form_model)
|
47
38
|
# This is for form models.
|
@@ -53,6 +44,15 @@ module FreeForm
|
|
53
44
|
end
|
54
45
|
end
|
55
46
|
end
|
47
|
+
|
48
|
+
# Loop through nested models sending them the save call
|
49
|
+
self.class.models.each do |form_model|
|
50
|
+
model = send(form_model)
|
51
|
+
# This is for nested models.
|
52
|
+
if model.is_a?(Array)
|
53
|
+
model.each { |m| m.save }
|
54
|
+
end
|
55
|
+
end
|
56
56
|
end
|
57
57
|
|
58
58
|
def save!
|
@@ -64,65 +64,6 @@ module FreeForm
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
# def destroy_all_marked_for_destruction
|
68
|
-
# self.class.models.each do |form_model|
|
69
|
-
# model = send(form_model)
|
70
|
-
# # This is for nested form models.
|
71
|
-
# if model.is_a?(Array)
|
72
|
-
# model.each { |m| m.destroy_all_marked_for_destruction }
|
73
|
-
# end
|
74
|
-
# end
|
75
|
-
|
76
|
-
# # Destroy objects
|
77
|
-
# self.class.models.each do |form_model|
|
78
|
-
# model = send(form_model)
|
79
|
-
# unless model.is_a?(Array)
|
80
|
-
# if marked_for_destruction?
|
81
|
-
# model.destroy
|
82
|
-
# end
|
83
|
-
# end
|
84
|
-
# end
|
85
|
-
# end
|
86
|
-
|
87
|
-
# def save
|
88
|
-
# return false unless valid? || marked_for_destruction?
|
89
|
-
|
90
|
-
# # NEW LOGIC!! Destroy all forms from the bottom up, then save all from the top down!
|
91
|
-
# destroy_all_marked_for_destruction
|
92
|
-
|
93
|
-
|
94
|
-
# # Save parent form objects first
|
95
|
-
# self.class.models.each do |form_model|
|
96
|
-
# model = send(form_model)
|
97
|
-
# # This is for nested form models.
|
98
|
-
# unless model.is_a?(Array)
|
99
|
-
# unless marked_for_destruction?
|
100
|
-
# # puts "Saving #{model.inspect}"
|
101
|
-
# model.save
|
102
|
-
# # puts "Errors = #{model.errors.inspect}"
|
103
|
-
# end
|
104
|
-
# end
|
105
|
-
# end
|
106
|
-
|
107
|
-
# # Save then call save on nested models
|
108
|
-
# self.class.models.each do |form_model|
|
109
|
-
# model = send(form_model)
|
110
|
-
# # This is for nested form models.
|
111
|
-
# if model.is_a?(Array)
|
112
|
-
# model.each { |m| m.save }
|
113
|
-
# end
|
114
|
-
# end
|
115
|
-
# end
|
116
|
-
|
117
|
-
# def save!
|
118
|
-
# raise FreeForm::FormInvalid, "form invalid." unless valid?
|
119
|
-
|
120
|
-
# self.class.models.each do |form_model|
|
121
|
-
# model = send(form_model)
|
122
|
-
# model.is_a?(Array) ? model.each { |m| m.save! } : save_or_destroy!(model)
|
123
|
-
# end
|
124
|
-
# end
|
125
|
-
|
126
67
|
private
|
127
68
|
def initialize_child_models
|
128
69
|
self.class.child_models.each do |c|
|
data/lib/freeform/version.rb
CHANGED
data/spec/dummy/bin/bundle
CHANGED
File without changes
|
data/spec/dummy/bin/rails
CHANGED
File without changes
|
data/spec/dummy/bin/rake
CHANGED
File without changes
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|