samvera / hydra-works

A ruby gem implementation of the PCDM Works domain model based on the Samvera software stack
Other
24 stars 14 forks source link

Allow adding File to GenericFile without saving #147

Open flyingzumwalt opened 9 years ago

flyingzumwalt commented 9 years ago

I'm pretty sure this actually percolates down to the implementation of directly_contains in ActiveFedora.

There are lots of places where the tests were using generic_file.add_file in the setup (which adds the file object to #attached_files in memory) and then never saving the parent. Now I have to save both the parent and the contained file.

If you search for add_file within this diff of sufia-core you'll see a lot of examples of where I had to save the GenericFile: https://github.com/projecthydra-labs/sufia-core/compare/before_cc...projecthydra-labs:migrate_to_curation_concerns

Here's one example: https://github.com/projecthydra-labs/sufia-core/compare/before_cc...projecthydra-labs:migrate_to_curation_concerns#diff-32a50de6ae2d35fbe4b024d452d3a274R11

flyingzumwalt commented 9 years ago

@jcoyne @elrayle

grosscol commented 8 years ago

At least for testing purposes there is now a file_set_helper: https://github.com/projecthydra-labs/hydra-works/blob/master/spec/support/file_set_helper.rb

The use is demonstrated here: https://github.com/projecthydra-labs/hydra-works/blob/master/spec/hydra/works/services/characterization_service_spec.rb

jrgriffiniii commented 6 years ago

Blocked by #146