I have a model with a binary field that contains a file. I'd like to save this file to disk as part of a process I need to do. For some reason, I can't find anything on how to do this.
The model contains a filename field and a file_contents field. I'd like to do something like this:
model = SomeModel.find :first
model.file_contents.save_to_file(model.filename)
Any help would be appreciated!