From 0be4c9392455b6c491f9b50cda4c8dbb8194b49a Mon Sep 17 00:00:00 2001 From: dinedine Date: Fri, 4 Feb 2011 15:43:43 +0100 Subject: [PATCH] import theme from the rails console is now possible --- lib/locomotive/import/job.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/locomotive/import/job.rb b/lib/locomotive/import/job.rb index 19749c4d..f45d3e13 100644 --- a/lib/locomotive/import/job.rb +++ b/lib/locomotive/import/job.rb @@ -91,12 +91,16 @@ module Locomotive def store_zipfile(zipfile) return nil if zipfile.blank? - file = CarrierWave::SanitizedFile.new(zipfile) - uploader = self.get_uploader(@site) begin - uploader.store!(file) + if zipfile.is_a?(String) && zipfile =~ /^http:\/\// + uploader.download!(zipfile) + uploader.store! + else + file = CarrierWave::SanitizedFile.new(zipfile) + uploader.store!(file) + end uploader.identifier rescue CarrierWave::IntegrityError nil