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

wth - (SPARCRequest & SPARCDashboard) Document Types (.PDF) #1304

Merged
merged 1 commit into from May 9, 2018
Merged
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
28 changes: 14 additions & 14 deletions app/models/document.rb
Expand Up @@ -26,20 +26,20 @@ class Document < ApplicationRecord
belongs_to :protocol
has_attached_file :document #, :preserve_files => true
validates_attachment_file_name :document, matches: [
/\.pdf$/,
/\.docx?$/,
/\.xlsx?$/,
/\.rtf$/,
/\.txt$/,
/\.csv$/,
/\.ppt?$/,
/\.msg$/,
/\.eml$/,
/\.jpg$/,
/\.gif$/,
/\.png$/,
/\.tiff$/,
/\.jpeg$/
/\.pdf$/i,
/\.docx?$/i,
/\.xlsx?$/i,
/\.rtf$/i,
/\.txt$/i,
/\.csv$/i,
/\.ppt?$/i,
/\.msg$/i,
/\.eml$/i,
/\.jpg$/i,
/\.gif$/i,
/\.png$/i,
/\.tiff$/i,
/\.jpeg$/i
]

validates :doc_type, :document, presence: true
Expand Down