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

Ordered property support #301

Closed
tpendragon opened this Issue Nov 7, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@tpendragon
Collaborator

tpendragon commented Nov 7, 2017

I should be able to define a property as ordered, and every metadata adapter will be forced to return that property in order.

Success Criteria:

class Resource < Valkyrie::Resource
  attribute :ordered_property, Valkyrie::Types::Array, ordered: true
end

resource = Resource.new(ordered_property: ["b", "a", "b"])
output = persister.save(resource: resource)
output.ordered_property # => ["b", "a", "b"]

This should work in every metadata adapter (likely broken right now for Fedora.)

@awead

This comment has been minimized.

Contributor

awead commented Nov 29, 2017

The Postgres adapter already seems to do this by default. If I create a resource with a Valkyrie::Types::Array, its order is preserved in the json that's stored in the orm_resources table. This should be true of Solr as well, but definitely not Fedora.

@escowles escowles added Review and removed in progress labels Aug 10, 2018

@escowles escowles added in progress and removed Review labels Aug 10, 2018

@tpendragon tpendragon removed the in progress label Aug 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment