Skip to content
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

soften dependendy on search_state_class for app generation #5808

Merged
merged 2 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/generators/hyrax/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ def inject_routes
end
end

def catalog_controller
copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb"
end

# Add behaviors to the SolrDocument model
def inject_solr_document_behavior
file_path = 'app/models/solr_document.rb'
Expand Down Expand Up @@ -126,6 +122,10 @@ def inject_hyrax_application_controller_behavior
end
end

def catalog_controller
copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb"
end

def copy_helper
copy_file 'hyrax_helper.rb', 'app/helpers/hyrax_helper.rb'
end
Expand Down
2 changes: 1 addition & 1 deletion lib/hyrax/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Engine < ::Rails::Engine

# Force CatalogController to use our SearchState class, which has an important
# work-around for some highly suspect SPARQL-gem monkeypatching.
CatalogController.search_state_class = Hyrax::SearchState if CatalogController.search_state_class == Blacklight::SearchState
CatalogController.search_state_class = Hyrax::SearchState if CatalogController.try(:search_state_class) == Blacklight::SearchState
end

initializer 'requires' do
Expand Down