From 825d1fcff336778add33dc835f85fa297ace5b9b Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 11 Feb 2015 00:48:46 +0100 Subject: [PATCH] Added Screenshot.image_url for Rake migration task to paperclip --- app/models/screenshot.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/screenshot.rb b/app/models/screenshot.rb index 7162dab..a97f110 100644 --- a/app/models/screenshot.rb +++ b/app/models/screenshot.rb @@ -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…"