sinatra-backstage 0.2.1 → 0.2.2
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: 874df067c1f31e0fa5c8913f9968b5d375eeb4a3
|
4
|
+
data.tar.gz: f985613fd20fc61bc2ee0e01910288500b116411
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ee548654babda6cea1d9ba5f7849ecd03485d1c35974c997140f4b3cf89ff21b1f5ddb2d9a4e69526ff87a170f947e39301291d776efd6340920cb8cb2d828
|
7
|
+
data.tar.gz: f68d0ee1bb05a71d7929b7131193ef08dabb1b3b41f2aae85587b77dcd2e1050319f3d8bb191a9335240b3993fafb49a18d282d30015a1c8cca7bd07a688dd9b
|
@@ -50,11 +50,10 @@ module Sinatra
|
|
50
50
|
rescue DataMapper::SaveFailureError => e
|
51
51
|
puts e.resource.errors.inspect
|
52
52
|
e.resource.errors.each do |error|
|
53
|
-
puts error
|
53
|
+
puts "-- REST.Routing new ( error = #{error} )"
|
54
54
|
@errors << error
|
55
55
|
end
|
56
56
|
@errors.flatten!
|
57
|
-
puts @errors.inspect
|
58
57
|
end
|
59
58
|
end
|
60
59
|
|
@@ -12,15 +12,18 @@ module Sinatra
|
|
12
12
|
helpers Sinatra::Backstage::StoredFile::Helper
|
13
13
|
|
14
14
|
## Add logo after create franchise
|
15
|
-
before namespace, :method => :post do
|
15
|
+
before "#{namespace}/new", :method => :post do
|
16
16
|
if params[:object][field_name]
|
17
17
|
begin
|
18
|
+
# puts "-- StoredFile before new ( params[:object] = #{params[:object]}"
|
18
19
|
attachment = params[:object].delete(field_name)
|
19
20
|
attachment_attrs = get_attachment_attrs(attachment)
|
21
|
+
# puts "-- StoredFile before new ( attachment_attrs = #{attachment_attrs}"
|
20
22
|
params[:object][field_name] = child_klass.create(
|
21
23
|
attachment_attrs,
|
22
24
|
attachment[:tempfile]
|
23
25
|
)
|
26
|
+
# puts "-- StoredFile before new ( result params[:object] = #{params[:object]}"
|
24
27
|
rescue DataMapper::SaveFailureError => e
|
25
28
|
puts e.resource.errors.inspect
|
26
29
|
end
|