Added Screenshot.image_url for Rake migration task to paperclip

This commit is contained in:
Christoph Haas 2015-02-11 00:48:46 +01:00
parent ada5832dae
commit 825d1fcff3

View file

@ -30,6 +30,12 @@ class Screenshot < ActiveRecord::Base
"Anonymous"
end
# Return Debshots 1.x path to allow migration of images into Paperclip filesystem schema
def image_url(size)
"#{Rails.configuration.images_path_prefix}/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png"
end
def status
text = ''
# Completes the sentence: "This image…"