deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 07/26] Core: Added check if user_metadata in blob respond to the :each method
Date Tue, 15 May 2012 15:15:39 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/views/blobs/show.xml.haml |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/server/views/blobs/show.xml.haml b/server/views/blobs/show.xml.haml
index 34b9cca..bde9e80 100644
--- a/server/views/blobs/show.xml.haml
+++ b/server/views/blobs/show.xml.haml
@@ -1,11 +1,14 @@
 !!! XML
 %blob{:href => bucket_url(@blob.bucket) + '/' + @blob.id, :id => @blob.id}
+  %bucket{ :id => @blob.bucket, :href => bucket_url(@blob.bucket)}
   - @blob.attributes.select{ |attr| (attr!=:id && attr!=:user_metadata) }.each do
|attribute|
+    - next if attribute == :bucket
     - unless attribute == :content
       - haml_tag(attribute, :<) do
         - haml_concat @blob.send(attribute)
   %user_metadata
-    - @blob.user_metadata.each do |k, v|
-      %entry{:key => k}
-        #{cdata v}
-  %content{:href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content'}
+    - if @blob.user_metadata.respond_to? :each
+      - @blob.user_metadata.each do |k, v|
+        %entry{:key => k}
+          #{cdata v}
+  %content{:href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content', :rel =>
'blob_content'}
-- 
1.7.10.1


Mime
View raw message