As we're validating filename with validates_presence_of, which doesn't allow blanks, ensure_filename! should populate a default filename on a blank filename, as well as on nil.