我有我的應用程序一個莫名其妙類似的問題。 雖然我想我知道了,當使用版本時, 將每個'進程'設置爲一個版本是有幫助的...... 否則我已經注意到有些方法'覆蓋其他'... 奇怪。
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
if Rails.env == "production"
storage :aws
else
storage :file
end
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
#this is the 'first' process, 'while you upload', the one that seems to be an issue
process resize_to_fill: [228, 250]
version :industry do
process resize_to_fit: [228, 250]
end
version :portrait do
process resize_to_fill: [360, 200]
end
version :modal do
process resize_to_fill: [330, 300]
end
end
這將繼而成爲::
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
if Rails.env == "production"
storage :aws
else
storage :file
end
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
#i put everything as a version and it sorts the problem out..
version :base do
process resize_to_fill: [228, 250]
end
version :industry do
process resize_to_fit: [228, 250]
end
version :portrait do
process resize_to_fill: [360, 200]
end
version :modal do
process resize_to_fill: [330, 300]
end
end
我希望這是 '真',將是有益的其他用戶
馬林
我面臨着同樣的問題。你修好了嗎?如果你能分享這個解決方案,將會非常感激。謝謝 – svs 2012-02-17 12:34:51
你好,同樣在這裏。我的意思是如果我只指定1個版本,它的工作原理是正確的,但是當多個版本出現時,它只會產生一個版本。這可能是一些版本bug可能? o.O – p1100i 2012-02-26 13:18:11