lib/generators/spotlight/install_generator.rb in blacklight-spotlight-0.9.2 vs lib/generators/spotlight/install_generator.rb in blacklight-spotlight-0.10.0
- old
+ new
@@ -73,9 +73,19 @@
else
say "Unable to find SolrDocument class; add `include #{options[:solr_update_class]}` to the class manually"
end
end
+ def add_search_builder_mixin
+ if File.exist? 'app/models/search_builder.rb'
+ inject_into_file 'app/models/search_builder.rb', after: "include Blacklight::Solr::SearchBuilderBehavior\n" do
+ "\n include Spotlight::Catalog::AccessControlsEnforcement::SearchBuilder\n"
+ end
+ else
+ say 'Unable to find SearchBuilder class; add `include Spotlight::Catalog::AccessControlsEnforcement::SearchBuilder` to the class manually.'
+ end
+ end
+
def add_example_catalog_controller
copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb'
end
def add_osd_viewer