import theme from the rails console is now possible

This commit is contained in:
dinedine 2011-02-04 15:43:43 +01:00
parent 6ac4ff0393
commit 0be4c93924

View File

@ -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