I am getting the database is locked when trying to save my record. I am trying a simple blog in rails. Having an article model, that contains the attribute, title, image and content. I have not encountered this error before. I am using carrierwave as the image uploader gem. Pls, what am I doing wrong?
the image uploader file
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# Create different versions of your uploaded files:
version :full do
process resize_to_fit: [650, 650]
end
version :thumb do
process resize_to_fit: [200, 200]
end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_whitelist
%w(jpg jpeg png)
end
end
Article model
class Article < ApplicationRecord
belongs_to :author, class_name: 'User'
mount_uploader :image, ImageUploader
validates_presence_of :title, :text
end
