Hyrax v3.0 ( branch: )

Roundtrip conversion changes attr’s single value into a multi-value array

See Issue #4556 for more information.


Changeset fails to save with Ldp:NotFound when adding 2nd of multiple child works one at a time

CAUSED BY: created parent work through valkyrie_create passing in the id for the parent.

SOLUTION: When the id was removed and the factory generated the id, the error went away. I did not explore deeper why this happens.

Seems like you should be able to pass in the id.

It works when…

  • you apply the above solution
  • you only add one child
  • you add all children by passing in an array of member_ids
  • you don’t use changesets

solr docs not an exact match

The solr documents generated by Valkyrie resource indexers do not exactly match those generated by ActiveFedora.

See Issue #4487 for more information.


Can’t display resource in Hyrax app after creating it

The new form displays and allows for setting field values. It saves and appears to create all the structures needed in Fedora and Solr. But when it forwards to the display page for the resource, it raises an exception.

See Issue #4559 for more information.


resource requires a special process to create in tests

Because resources do not respond to the save method, there needed to be a different strategy for saving resources on :create. This is already written and you can use it in your tests.

Simply use valkyrie_create in place of create.

let(:resource) valkyrie_create(:my_resource_work_factory)

NOTE: You can still use build when you don’t need to save the resource.


no reload of resources – impacts testing

If reload is called in application code, it should be refactored.

Testing does have the need to ‘reload’ when the resource changes in the setup process after it was created. There are several ways to this. The simplest is to use the query service at the start of the test to load the resource.

let(:resource) valkyrie_create(:my_resource_work_factory)
# some other setup happens that changes `resource`
it 'tests something' do
  resource = Hyrax.query_service.find_by(id: resource.id)
  # expect tests
end