A small fix
This commit is contained in:
parent
a3468274ff
commit
dd3caa1161
@ -79,22 +79,22 @@ class AvatarUploader < CarrierWave::Uploader::Base
|
||||
# super(*versions)
|
||||
#end
|
||||
|
||||
def manipulate!
|
||||
cache_stored_file! if !cached?
|
||||
image = ::MiniMagick::Image.open(current_path)
|
||||
|
||||
begin
|
||||
image.format(@format.to_s.downcase) if @format
|
||||
image = yield(image)
|
||||
image.write(current_path)
|
||||
image.run_command("identify", '"' + current_path + '"')
|
||||
ensure
|
||||
image.destroy!
|
||||
end
|
||||
rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
|
||||
default = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :locale => :en)
|
||||
message = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :default => default)
|
||||
raise CarrierWave::ProcessingError, message
|
||||
end
|
||||
# def manipulate!
|
||||
# cache_stored_file! if !cached?
|
||||
# image = ::MiniMagick::Image.open(current_path)
|
||||
#
|
||||
# begin
|
||||
# image.format(@format.to_s.downcase) if @format
|
||||
# image = yield(image)
|
||||
# image.write(current_path)
|
||||
# image.run_command("identify", '"' + current_path + '"')
|
||||
# ensure
|
||||
# image.destroy!
|
||||
# end
|
||||
# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
|
||||
# default = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :locale => :en)
|
||||
# message = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :default => default)
|
||||
# raise CarrierWave::ProcessingError, message
|
||||
# end
|
||||
|
||||
end
|
||||
|
@ -39,22 +39,22 @@ class PosterUploader < CarrierWave::Uploader::Base
|
||||
image['width'] > image['height']
|
||||
end
|
||||
|
||||
def manipulate!
|
||||
cache_stored_file! if !cached?
|
||||
image = ::MiniMagick::Image.open(current_path)
|
||||
|
||||
begin
|
||||
image.format(@format.to_s.downcase) if @format
|
||||
image = yield(image)
|
||||
image.write(current_path)
|
||||
image.run_command("identify", '"' + current_path + '"')
|
||||
ensure
|
||||
image.destroy!
|
||||
end
|
||||
rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
|
||||
default = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :locale => :en)
|
||||
message = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :default => default)
|
||||
raise CarrierWave::ProcessingError, message
|
||||
end
|
||||
# def manipulate!
|
||||
# cache_stored_file! if !cached?
|
||||
# image = ::MiniMagick::Image.open(current_path)
|
||||
#
|
||||
# begin
|
||||
# image.format(@format.to_s.downcase) if @format
|
||||
# image = yield(image)
|
||||
# image.write(current_path)
|
||||
# image.run_command("identify", '"' + current_path + '"')
|
||||
# ensure
|
||||
# image.destroy!
|
||||
# end
|
||||
# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
|
||||
# default = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :locale => :en)
|
||||
# message = I18n.translate(:"errors.messages.mini_magick_processing_error", :e => e, :default => default)
|
||||
# raise CarrierWave::ProcessingError, message
|
||||
# end
|
||||
|
||||
end
|
||||
|
1
config/unicorn.rb
Normal file
1
config/unicorn.rb
Normal file
@ -0,0 +1 @@
|
||||
rails_env = ENV['RAILS_ENV'] || 'production'
|
@ -15,7 +15,7 @@ namespace :regenerate do
|
||||
end
|
||||
|
||||
task organization_covers: :environment do
|
||||
#Organization.all.each {|m| m.cover.recreate_versions!}
|
||||
puts Rails.configuration.database_configuration[Rails.env].to_json.to_s
|
||||
Organization.all.each {|m| m.cover.recreate_versions!}
|
||||
#puts Rails.configuration.database_configuration[Rails.env].to_json.to_s
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user