This might help you Including the id in the filename on create may not be possible, since the filename is stored in the database but the id isn't available yet. An (admittedly rather extreme) workaround would be to use a temporary value on create, and then after_commit on: :create, move the file and change the name in the database. It may be possible to optimize this with an after_create, but I'll leave that up to you. (This is where carrierwave actually uploads the file.)
Carrierwave is appending the store_dir when referencing filename
help you fix your problem As model is the ActiveRecord instance that mounts the uploader you should be able to use the ActiveRecord associations. Since you state that Document belongs_to a Request (and I assume that Document is the ActiveRecord that mounts the uploader) you can get the Request's id with model.request_id (or model.request.id).