use default rails logger during the first template import + remove some carrierwave method patches now useless with the new version of the gem

This commit is contained in:
did 2011-06-11 01:18:34 +02:00
parent cd428e467c
commit de217b74b7
2 changed files with 5 additions and 25 deletions

View File

@ -27,7 +27,7 @@ module Extensions
begin
Locomotive::Import::Job.run!(source, site, { :samples => true })
rescue Exception => e
logger.error "The import of the site template failed because of #{e.message}"
Rails.logger.error "The import of the site template failed because of #{e.message}"
end
end

View File

@ -4,33 +4,13 @@ module CarrierWave
class SanitizedFile
def original_filename=(filename)
@original_filename = filename
end
def content_type=(content_type)
@content_type = content_type
end
# http://github.com/jnicklas/carrierwave/issuesearch?state=closed&q=content+type#issue/48
def copy_to_with_content_type(new_path, permissions=nil)
new_file = self.copy_to_without_content_type(new_path, permissions)
new_file.content_type = self.content_type
new_file
end
alias_method_chain :copy_to, :content_type
# FIXME (Did) CarrierWave speaks mime type now
def content_type
return @content_type if @content_type
if @file.respond_to?(:content_type) and @file.content_type
@file.content_type.chomp
else
File.mime_type?(@file) if @file.is_a?(String)
end
def content_type_with_file_mime_type
content_type_without_file_mime_type || File.mime_type?(original_filename)
end
alias_method_chain :content_type, :file_mime_type
end
module Uploader