Skip to content

Commit

Permalink
Merge pull request #122 from scientist-softserv/fixing-other-oddities
Browse files Browse the repository at this point in the history
Removing parser ambiguity
  • Loading branch information
jeremyf authored Feb 8, 2023
2 parents 048c10c + 83b278d commit c61745d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/iiif_print/data/work_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def original_name(fileset)

def filesets
# file sets with non-nil original file contained:
work.members.select { |m| m.is_a? FileSet && m.original_file }
work.members.select { |m| m.is_a?(FileSet) && m.original_file }
end

def user
Expand Down
4 changes: 2 additions & 2 deletions spec/iiif_print/data/work_files_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
adapter.unassign(adapter.keys[0])
adapter.commit!
expect(adapter.keys.size).to eq 0
expect(work.members.count { |m| m.is_a? FileSet }).to eq 0
expect(work.members.to_a.count { |m| m.is_a? FileSet }).to eq 0
end

context "when it is a new work" do
Expand Down Expand Up @@ -203,7 +203,7 @@
# should refresh the work.members, and by consequence adapter.keys
work.reload
expect(adapter.keys.size).to eq 1
expect(work.members.count { |m| m.is_a? FileSet }).to eq 1
expect(work.members.to_a.count { |m| m.is_a? FileSet }).to eq 1
expect(adapter.names).to include 'ocr_gray.tiff'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def attach_alto(work)
attach_primary_file(work)
attach_alto(work)
work.reload
file_set = work.ordered_members.to_a.find { |m| m.is_a? FileSet) }
file_set = work.ordered_members.to_a.find { |m| m.is_a? FileSet }
service = described_class.new(file_set)
service.create_derivatives('/a/path/here/needed/but/will/not/matter')
coords = JSON.parse(derivatives_of(work).data('json'))
Expand Down

0 comments on commit c61745d

Please sign in to comment.