Skip to content

Commit

Permalink
Set thumbnail_id for resources if not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Aug 4, 2017
1 parent 63e42f6 commit 93cb4a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/services/file_appender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def append_to(resource)
resource.file_metadata += file_sets
else
resource.member_ids += file_sets.map(&:id)
resource.thumbnail_id = file_sets.first.id if resource.thumbnail_id.blank?
end
adjust_pending_uploads(resource)
file_sets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@

expect(members.to_a.length).to eq 1
expect(members.first).to be_kind_of FileSet
expect(output.thumbnail_id).to eq [members.first.id]

file_metadata_nodes = members.first.file_metadata
expect(file_metadata_nodes.to_a.length).to eq 2
Expand Down

0 comments on commit 93cb4a4

Please sign in to comment.