volt 0.7.7 → 0.7.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74ea3a341b93854eef0a8477634b7b21a88c289c
|
4
|
+
data.tar.gz: 92d8ffbdd68245f528c522528adc8e78d873ccbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 562ad2af2497878707f9259d16fd2c5983e19aad385b9048e81d399467953e20ad0302d1404bd88fa7c5fbd8de29d872202f5854ae6a292a88fd329f9b4dc99d
|
7
|
+
data.tar.gz: 09d8dfcf71e4995e0983a52fb1169f0153dccbc21d0ce72cd5bdb73b5a25c0a702afab9d50ed72a8a53bdb5588f9a6e7536d9220bd329755cf5220dbef9886db
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.8
|
data/lib/volt/models/model.rb
CHANGED
@@ -266,7 +266,6 @@ class Model
|
|
266
266
|
|
267
267
|
def save!
|
268
268
|
if errors.size == 0
|
269
|
-
puts "SAVING: #{self.errors.inspect} - #{self.inspect} - #{options[:save_to].inspect} on #{self.inspect}"
|
270
269
|
save_to = options[:save_to]
|
271
270
|
if save_to
|
272
271
|
if save_to.is_a?(ArrayModel)
|
@@ -274,8 +273,9 @@ class Model
|
|
274
273
|
new_model = save_to.append(self.attributes)
|
275
274
|
|
276
275
|
options[:save_to] = new_model
|
276
|
+
|
277
|
+
# TODO: return a promise that resolves if the append works
|
277
278
|
else
|
278
|
-
puts "SAVE BUFFERED"
|
279
279
|
# We have a saved model
|
280
280
|
return save_to.assign_attributes(self.attributes)
|
281
281
|
end
|
@@ -283,7 +283,7 @@ class Model
|
|
283
283
|
raise "Model is not a buffer, can not be saved, modifications should be persisted as they are made."
|
284
284
|
end
|
285
285
|
|
286
|
-
return
|
286
|
+
return Promise.new.resolve({})
|
287
287
|
else
|
288
288
|
# Some errors, mark all fields
|
289
289
|
self.class.validations.keys.each do |key|
|
@@ -291,7 +291,7 @@ class Model
|
|
291
291
|
end
|
292
292
|
trigger_for_methods!('changed', :errors, :marked_errors)
|
293
293
|
|
294
|
-
return
|
294
|
+
return Promise.new.reject(errors)
|
295
295
|
end
|
296
296
|
end
|
297
297
|
|
@@ -21,7 +21,6 @@ class ContentBinding < BaseBinding
|
|
21
21
|
|
22
22
|
# Exception values display the exception as a string
|
23
23
|
value = value.to_s
|
24
|
-
# puts "UPDATE C: #{value.inspect} on #{self.inspect}"
|
25
24
|
|
26
25
|
# Update the html in this section
|
27
26
|
# TODO: Move the formatter into another class.
|
@@ -72,12 +72,12 @@ describe TemplateBinding do
|
|
72
72
|
|
73
73
|
it "should find a matching component" do
|
74
74
|
@templates = {
|
75
|
-
'comments/new/
|
75
|
+
'comments/new/index/body' => ''
|
76
76
|
}
|
77
77
|
|
78
78
|
path, result = @template_binding.path_for_template('comments/new')
|
79
|
-
expect(path).to eq('comments/new/
|
80
|
-
expect(result).to eq(['comments', 'new_controller', '
|
79
|
+
expect(path).to eq('comments/new/index/body')
|
80
|
+
expect(result).to eq(['comments', 'new_controller', 'index'])
|
81
81
|
end
|
82
82
|
|
83
83
|
it "should lookup sub-templates within its own file" do
|
@@ -108,10 +108,10 @@ describe TemplateBinding do
|
|
108
108
|
|
109
109
|
it "should lookup in a controller" do
|
110
110
|
@templates = {
|
111
|
-
'main/nav/
|
111
|
+
'main/nav/index/body' => ''
|
112
112
|
}
|
113
113
|
|
114
|
-
expect(@template_binding.path_for_template('nav').first).to eq('main/nav/
|
114
|
+
expect(@template_binding.path_for_template('nav').first).to eq('main/nav/index/body')
|
115
115
|
end
|
116
116
|
|
117
117
|
it "should lookup in a controller/view" do
|
@@ -124,18 +124,18 @@ describe TemplateBinding do
|
|
124
124
|
|
125
125
|
it "should lookup in a controller" do
|
126
126
|
@templates = {
|
127
|
-
'main/nav/
|
127
|
+
'main/nav/index/body' => ''
|
128
128
|
}
|
129
129
|
|
130
|
-
expect(@template_binding.path_for_template('nav').first).to eq('main/nav/
|
130
|
+
expect(@template_binding.path_for_template('nav').first).to eq('main/nav/index/body')
|
131
131
|
end
|
132
132
|
|
133
133
|
it "should lookup in a component" do
|
134
134
|
@templates = {
|
135
|
-
'nav/main/
|
135
|
+
'nav/main/index/body' => ''
|
136
136
|
}
|
137
137
|
|
138
|
-
expect(@template_binding.path_for_template('nav').first).to eq('nav/main/
|
138
|
+
expect(@template_binding.path_for_template('nav').first).to eq('nav/main/index/body')
|
139
139
|
end
|
140
140
|
|
141
141
|
it "should lookup in a component/controller/view" do
|
@@ -149,10 +149,10 @@ describe TemplateBinding do
|
|
149
149
|
|
150
150
|
it "should let you force a sub template" do
|
151
151
|
@templates = {
|
152
|
-
'nav/main/
|
152
|
+
'nav/main/index/title' => '',
|
153
153
|
'auth/login/new/title' => ''
|
154
154
|
}
|
155
155
|
|
156
|
-
expect(@template_binding.path_for_template('nav', 'title').first).to eq('nav/main/
|
156
|
+
expect(@template_binding.path_for_template('nav', 'title').first).to eq('nav/main/index/title')
|
157
157
|
end
|
158
158
|
end
|