David Kimura PRO said almost 7 years ago on In-depth Look into ActiveStorage :

For the filename, it can be handled a few different ways. Let's say you have a user model and the user model has_one_attached :image

If you're manually uploading an image then you can override the filename at the time of attaching it.

uri = URI.parse(URL_OF_IMAGE);
filename = File.basename(uri.path);
io = open(uri);
content_type = io.content_type;
user.image.attach(io: io, filename: filename, content_type: content_type);
user.save;

In this same example with a user and a image, we can get access to the image afterwards.

user.image.blob.filename
=> "whatever.png"
user.image.blob.filename = "newname.png"
user.image.blob.save
=> "newname.png"

For banning a file, I think you're heading in the right direction.

I would have a separate model for files that are uploaded for a user. Something like a User has_many Datei and Datei belongs to User.

The Datei model (german for file because I wouldn't want a model called File) would have a few attributes plus whatever else needed

user_id:integer:index
banned:boolean, default: false

The model would have something like has_one_attached :document.

So now a user can have many files (Datei) and each file has an attached document. You can flag the file as banned (or whatever else params).