Carrierwave::EncrypterDecrypter.configure do |config|
config.encryption_type = :aes
config.key_size = 256
end
class ScreenshotUploader < CarrierWave::Uploader::Base
storage :file
after :store, :encrypt_file
def encrypt_file(file)
Carrierwave::EncrypterDecrypter::Uploader.encrypt(self)
end
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
end
However, files are being stored in their original form, not as .enc files. The only difference I can think of between the suggested setup and my own setup is that I'm using Mongoid as db. I don't suppose that makes any difference though.
I am using the standard setup:
However, files are being stored in their original form, not as
.enc
files. The only difference I can think of between the suggested setup and my own setup is that I'm using Mongoid as db. I don't suppose that makes any difference though.Any idea how to approach this?