Skip to content

Commit

Permalink
Merge pull request #357 from bmic-development/sj-document_upload_erro…
Browse files Browse the repository at this point in the history
…r_message

Sj document upload error message
  • Loading branch information
Stuart-Johnson committed Jun 26, 2017
2 parents 9dd2c2c + 466bc15 commit d8da492
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Document < ApplicationRecord
has_and_belongs_to_many :sub_service_requests
belongs_to :protocol
has_attached_file :document #, :preserve_files => true
validates_attachment :document, :content_type => {:content_type => %w(application/zip application/force-download text/plain image/jpeg image/jpg image/png application/vnd.ms-excel application/vnd.ms-excel.sheet.macroenabled.12 application/vnd.ms-excel.template.macroenabled.12 application/vnd.ms-excel.addin.macroenabled.12 application/vnd.ms-excel.sheet.binary.macroenabled.12 text/csv application/pdf application/msword application/vnd.ms-office application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)}
do_not_validate_attachment_file_type :document

validates :doc_type, :document, presence: true
validates :doc_type_other, presence: true, if: Proc.new { |doc| doc.doc_type == 'other' }
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ en:
attributes:
content:
blank: "Content can't be blank"
messages:
spoofed_media_type: "has formatting errors. Try re-saving file as a different format, and retrying."
attributes:
arm:
name: "Arm Name"
Expand Down

0 comments on commit d8da492

Please sign in to comment.