Compare:
1.
def filename
"something.#{model.image.file.extension}"
end
#<CarrierWave::SanitizedFile:0x0000000337bc68 @file="../public/uploads/
post/image/10/something.jpg", @original_filename=nil,
@content_type=nil>
NO PROBLEM renaming all thumbs and accessing in views, though
@content_type turns up nil still
2.
def filename
"#{model.randomstring}.#{model.image.file.extension}"
end
#<CarrierWave::SanitizedFile:0x000000032c4ea0 @file="../public/uploads/
post/image/11/.jpg", @original_filename=nil, @content_type=nil>
Problem. Is this a bug or me learning? I've tried various ways of
escaping and formatting model.randomstring and in the above but
santized file scrubs the basename leaving "(dot)extension"
model.randomstring is simply this
'Digest::SHA1.hexdigest([Time.zone.now.utc, rand].join).to_s' in the
model which should be benign and accessible.