Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sj document upload error message #357

Merged
merged 2 commits into from
Jun 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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