Workaround for CarrierWave multiple file upload using sqlite3 in development

369 Views Asked by At

In my team development environment, we are using sqlite3 which comes default in Rails.

However, carrierwave's implementation of multi files upload require database that supports array/json datatype.

Are there any workaround so that it will work on our development environment without installing other database such as postgres?

I'm following the instructions over here https://github.com/carrierwaveuploader/carrierwave#multiple-file-uploads

1

There are 1 best solutions below

0
On BEST ANSWER

The only possible workaround would be to create a separate model for the uploads:

class ImagesContainer
  has_many :uploads
end

class Upload
  mount_uploader :image, ImageUploader

  belongs_to ImagesContainer
end