-
Notifications
You must be signed in to change notification settings - Fork 124
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
Replace calls to ActiveFedora::Base.where (removes 7 refs to ActiveFedora) #3820
Comments
Checkout PR #3804 which as a first step replaces ActiveFedora::SolrService with Hyrax::SolrService which continues to call ActiveFedora::SolrService. Something similar might make a good first PR for this issue. |
@no-reply The It seems like we we shouldn't replace it (see the |
Previous WorkPR #4910 replace ActiveFedora where with Valkyrized where
This adds service PR #4929 replace AF.where in dashboard_helper_behaviorUses NOTE: PR #4938 Refactor hyrax search query builder to build and execute queriesReplaces See Issue #4946 which addresses the deprecation. NOTE: Remaining work for this issue should use PR #5024 replace calls to deprecated SolrQueryBuilderService with SolrQueryServiceUpdates the same file that was changed in PR #4929, but using SolrQuery Service instead. PR #5023 deprecate FindObjectsViaSolrService replaced by SolrQueryService#get_objectsAdd |
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Remaining Work after PRs #4910, #4929, and #4938searching for ActiveFedora::Base.where return 6 matches in 4 files4 need the equivalent of
2 others should follow the pattern established in #4929 except using
.where applied to ActiveFedora::Relation3 uses of relation.where with relation being an ActiveFedora::Relation that should also follow the pattern established in #4929 except using
The three above were worked around for the postgres case in #6088. This won't work for non-postgres, but that's future scope. a few others that might also be using ActiveFedora where3 that need further investigation
These three got marked off by #6088 as well. This won't work for non-postgres, but that's future scope. ExamplesPR #5024 uses a single
PR #5023 uses chained
|
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Partially addresses Issue #3820 by removing use of `ActiveFedora::Base #where` method when using `#accessible_by` method. See original [`#accessible_by`\(https://github.com/samvera/hydra-head/blob/main/hydra-access-controls/lib/active_fedora/accessible_by.rb) method defined in hydra-access-controls. See Hyrax override of [`#gated_discovery_filters`](https://github.com/samvera/hyrax/blob/b034218b89dde7df534e32d1e5ade9161e129a1d/app/search_builders/hyrax/search_filters.rb#L16-L21).
Prerequisites
This issue cannot be completed until the following issues are completed first...
Descriptive summary
The
ActiveFedora::Base.where
is used to apply a solr query and return instances of Active Fedora objects.It is used to accomplish a few tasks in Hyrax...
current_ability
, and counting the filtered resultsThis issue involves removing references to
ActiveFedora::Base.where
.ActiveFedora code
Active Fedora class being replaced...
Example from app/models/hyrax/collection_type.rb
To locate, search code for
ActiveFedora::Base.where
inapp
. You will also need to search for.where
, but some of these will be for nonActiveFedora::Base
objects (e.g.Users
) and should not be updated as they are usingActiveRecord #where
. The ones forActiveFedora::Base
objects (e.g.AdminSet
,Collection
,Work
,FileSet
) will need to be updated.Replacement code
Pseudocode replacement code...
ActiveFedora::Base.where
- Can existing Hyrax::SolrQueryServiceBuilder be used or expanded as a replacement for building the solr query?Perhaps create a service that performs all these steps that can be used as a direct replacement for #where.
Considerations
where
to find related objects be replaced with calls to one of the custom navigation queries or the standard find_references_by query method?lib/wings
directories.Impact on Testing
Not expected to require test changes. All tests should pass with the replacement code.
The text was updated successfully, but these errors were encountered: