-
Notifications
You must be signed in to change notification settings - Fork 256
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
remove dependency in SearchState #1477
remove dependency in SearchState #1477
Conversation
return facet_fields[field] if facet_fields[field] && facet_fields[field].field == field | ||
|
||
# Find the facet field configuration for the solr field, or provide a default. | ||
facet_fields.values.find { |v| v.field.to_s == field.to_s } || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer detect
over find
.
Makes sense to me. We definitely have an overall problem of modules not being properly isolated (anticipating features or dependencies in the includer's context, and not even bothering to check when included whether that is true or not). Can you rebase it? |
…ch is a controller concern, by moving #facet_configuration_for_field into Blacklight::Configuration and delegating
147e5d5
to
0013a6b
Compare
2 similar comments
Thanks for looking at this so quickly! I've rebased this branch with master. |
Looks good to me. 👍 Thanks. @codeforkjeff. @cbeer would you care to take a look? |
Blacklight::Controller
conveniently allows you to override#search_state
to provide your own subclass ofBlacklight::SearchState
. But when I try to create such a subclass, I get an 'uninitialized constant Blacklight::Facet' error, because that's a controller concern that hasn't been loaded yet.This PR removes that dependency, making it possible to subclass SearchState.