Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid n+1 query on file_metadata delete
Hyrax should avoid looping over ids when it could use a custom query. e.g. we should never be doing `my_resource.member_ids.each` and looking up members instead doing `query_service.find_members(resource: my_resource)`. doing this creates two problems: - it prevents adapters from optimizing n+1 query problems for large sets of ids. - it locks hyrax into modelling details (relationship directionality) that applications may want to avoid. there are probably other places this problem exists, but i'm aware of this one and wanted to get a patch in right away. note that this proposes unceremoniously removing the `property:` step argument. if we need to keep this, we could choose to make in `nil` by default and fall back to the old code if a value is provided. i can't see any reason a caller would want to change the property of this step though, and i strongly doubt anyone downstream is doing so.
- Loading branch information