A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on Hydra::Works) and providing a generator for defining object types with custom workflows, views, access controls, etc.
Other
15
stars
27
forks
source link
Make assign_visibility work with symbol hash keys #1046
However, because the hash keys are compared as strings in the private method assign_visibility, this example fails to match and thus visibility is always inherited from the parent rather than assigned. Initially, I considered changing the comparison to just compare symbols, %i{} but there are other tests that fail because there are other occasions where hash keys are passed as Strings.
Changes proposed in this pull request:
allow assign_visibility and thus create_metadata to accept both strings and symbols as hash keys.
create_metadata
may ignore file_set_paramsI would expect to be able to set the visibility of a file_set as followes
However, because the hash keys are compared as strings in the private method
assign_visibility
, this example fails to match and thus visibility is always inherited from the parent rather than assigned. Initially, I considered changing the comparison to just compare symbols,%i{}
but there are other tests that fail because there are other occasions where hash keys are passed as Strings.Changes proposed in this pull request:
assign_visibility
and thuscreate_metadata
to accept both strings and symbols as hash keys.@projecthydra/sufia-code-reviewers