Skip to content

Commit

Permalink
Replace stray replacement of id_field (#3827)
Browse files Browse the repository at this point in the history
Blocks a pending test as it fails locally but not in CCI.  Requires futher exploration to determine why it fails.  But since this test is pending, it doesn’t make sense to spend time on it until it is ready to be live.
  • Loading branch information
elrayle authored and hackartisan committed Jun 20, 2019
1 parent e463056 commit 293a62b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/presenters/hyrax/member_presenter_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def file_set_ids
@file_set_ids ||= begin
Hyrax::SolrService.query("{!field f=has_model_ssim}FileSet",
rows: 10_000,
fl: ActiveFedora.id_field,
fl: Hyrax.config.id_field,
fq: "{!join from=ordered_targets_ssim to=id}id:\"#{id}/list_source\"")
.flat_map { |x| x.fetch(Hyrax.config.id_field, []) }
end
Expand Down
9 changes: 6 additions & 3 deletions app/services/hyrax/versioning_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def record_committer(content, user_key)
Hyrax::VersionCommitter.create(version_id: version_id, committer_login: user_key)
end

# TODO: Copied from valkyrie6 branch. Need to explore whether this is needed?
# TODO: WINGS - Copied from valkyrie6 branch. Need to explore whether this is needed?
# # @param [FileSet] file_set
# # @param [Wings::FileNode] content
# # @param [String] revision_id
Expand All @@ -42,7 +42,7 @@ def record_committer(content, user_key)

private

# # TODO: Should we create and use indexing adapter for persistence? This is what was used in branch valkyrie6.
# # TODO: WINGS - Should we create and use indexing adapter for persistence? This is what was used in branch valkyrie6. See issue #3800.
# def indexing_adapter
# Valkyrie::MetadataAdapter.find(:indexing_persister)
# end
Expand All @@ -57,12 +57,15 @@ def perform_create_through_active_fedora(content, user)
end

def perform_create_through_valkyrie(content, user)
return # TODO: WINGS - Just return for now. This method won't work until #indexing_adapter method is complete. See issue #3800.
# rubocop:disable Lint/UnreachableCode
new_version = content.new(id: nil)
new_version.label = "version#{content.member_ids.length + 1}"
# new_version = indexing_adapter.persister.save(resource: new_version)
new_version = indexing_adapter.persister.save(resource: new_version)
content.member_ids = content.member_ids + [new_version.id]
content = indexing_adapter.persister.save(resource: content)
record_committer(content, user) if user
# rubocop:enable Lint/UnreachableCode
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/actors/hyrax/actors/file_actor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class FileSetWithExtras < FileSet
end
end

it 'uses the provided mime_type' do
xit 'uses the provided mime_type' do
pending 'implementation of Wings::Valkyrie::Persister #save_file_node'
allow(fixture).to receive(:content_type).and_return('image/gif')
expect(Hyrax::VersioningService).to receive(:create).with(Wings::FileNode, user)
Expand All @@ -196,6 +196,7 @@ class FileSetWithExtras < FileSet
end

before do
# TODO: WINGS - When #ingest_file works, these should be uncommented.
# expect(Hyrax::VersioningService).to receive(:create).with(Wings::FileNode, user)
# expect(Hyrax::VersioningService).to receive(:create).with(Wings::FileNode, user2)
# expect(CharacterizeJob).to receive(:perform_later)
Expand Down

0 comments on commit 293a62b

Please sign in to comment.