为carrierwave设置动态上传器

时间:2014-05-06 21:21:00

标签: ruby-on-rails ruby carrierwave

我希望根据对象属性动态设置上传器。

#Something like this in the user.rb
mount_uploader :avatar, Avatar2Uploader,:if => Proc.new{|p| p.migrated == false }
mount_uploader :avatar, Avatar1Uploader,:if => Proc.new{|p| p.migrated == true }

有没有办法实现这个目标?

0 个答案:

没有答案