Skip to content

Commit

Permalink
Default to the Work headers if object type is nil or undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadel committed Sep 28, 2021
1 parent a14a103 commit f5d6698
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/uploaders/zizia/csv_manifest_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,18 @@ def missing_headers
end

def required_headers(object_type = "w")
return work_headers if object_type.nil?
if object_type.casecmp("c").zero? || object_type.casecmp("collection").zero?
['title', 'visibility']
else
['title', 'creator', 'keyword', 'rights statement', 'visibility', 'files', 'deduplication_key']
work_headers
end
end

def work_headers
['title', 'creator', 'keyword', 'rights statement', 'visibility', 'files', 'deduplication_key']
end

def duplicate_headers
duplicates = []
sorted_headers = @transformed_headers.sort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Collection,Collection of fruits,,,,public,,def/234
w,Work on tomatoes,"Tomato, Tommy",fruits|~|tomatoes,http://rightsstatements.org/vocab/InC/1.0/,public,birds.jpg,abc/123
wOrk,Work on cabbages,"Cabbage, Carl",vegetables|~|cabbages,http://rightsstatements.org/vocab/InC/1.0/,public,dog.jpg,abs/234
coLLEction,Collection of legumes,,,,public,,def/345
,Work without object type,"Cabbage, Carl",vegetables|~|cabbages,http://rightsstatements.org/vocab/InC/1.0/,public,dog.jpg,abc/345

0 comments on commit f5d6698

Please sign in to comment.