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

Removing parser ambiguity #122

Merged
merged 1 commit into from
Feb 8, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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