Skip to content

Commit

Permalink
Merge pull request #2141 from DFE-Digital/remove-upload-default
Browse files Browse the repository at this point in the history
Don't set a default upload filename
  • Loading branch information
thomasleese authored Apr 11, 2024
2 parents ee78795 + 6809e82 commit 3249594
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/models/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Table name: uploads
#
# id :bigint not null, primary key
# filename :string default(""), not null
# filename :string not null
# malware_scan_result :string default("pending"), not null
# translation :boolean not null
# created_at :datetime not null
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240410151207_change_upload_filename_default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChangeUploadFilenameDefault < ActiveRecord::Migration[7.1]
def change
change_column_default :uploads, :filename, from: "", to: nil
end
end
4 changes: 2 additions & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions lib/tasks/uploads.rake

This file was deleted.

2 changes: 1 addition & 1 deletion spec/factories/uploads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Table name: uploads
#
# id :bigint not null, primary key
# filename :string default(""), not null
# filename :string not null
# malware_scan_result :string default("pending"), not null
# translation :boolean not null
# created_at :datetime not null
Expand Down
Binary file removed spec/fixtures/files/translation_upload.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion spec/models/upload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Table name: uploads
#
# id :bigint not null, primary key
# filename :string default(""), not null
# filename :string not null
# malware_scan_result :string default("pending"), not null
# translation :boolean not null
# created_at :datetime not null
Expand Down

0 comments on commit 3249594

Please sign in to comment.