Carrierwave mounted to Rails 4 PostgreSQL array attribute -
since rails >= 4.0 adds support postgresql array info types wondering if played carrierwave attachments mounted array attributes instead of bring together tables when model should have multiple attachments.
what got in mind like
class addpicturestouser < activerecord::migration def alter add_column :users, :pictures, :text, array: true end end class user < activerecord::base mount_uploader :pictures, pictureuploader, array: true end
check https://github.com/carrierwaveuploader/carrierwave/issues/1548
switch github version of carrierwave gem
gem 'carrierwave', github: 'carrierwaveuploader/carrierwave'
use mount_uploaders instead of mount_uploader in class described in carrierwave wiki.
mount_uploaders :pictures, pictureuploader
remove the, array:true @ end of mount_uploader.
postgresql ruby-on-rails-4 carrierwave
No comments:
Post a Comment