diff --git a/lib/generators/hyrax/install_generator.rb b/lib/generators/hyrax/install_generator.rb index c4ef9ae3c9..aa2466fd82 100644 --- a/lib/generators/hyrax/install_generator.rb +++ b/lib/generators/hyrax/install_generator.rb @@ -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' @@ -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 diff --git a/lib/hyrax/engine.rb b/lib/hyrax/engine.rb index f6469e780a..4b041aacca 100644 --- a/lib/hyrax/engine.rb +++ b/lib/hyrax/engine.rb @@ -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