lib/sga/asset.rb in sga_paperclippolymorph-0.2.4 vs lib/sga/asset.rb in sga_paperclippolymorph-0.2.6
- old
+ new
@@ -11,12 +11,15 @@
:styles => {
:tiny => "64x64>",
:small => "176x112>",
:medium => "630x630>",
:large => "1024x1024>"
- }
+ },
+ :path => "/system/:attachment/asset/:id_partition/:style/:filename",
+ :url => "/system/:attachment/asset/:id_partition/:style/:filename"
+
def url(*args)
data.url(*args)
end
def name
@@ -56,10 +59,10 @@
def path
File.join RAILS_ROOT, 'public', self.url_without_random
end
def file_md5sum
- IO.popen("md5sum #{path} | awk '{print $1}'"){|f| f.gets.strip}
+ IO.popen("md5sum '#{path}' | awk '{print $1}'"){|f| f.gets.strip}
end
def url_without_random format=:original
self.url(format) =~ /^(.*)\?\d*$/ ? $1 : self.url(format)
end