Class: BlacklightHighlightGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- BlacklightHighlightGenerator
- Defined in:
- lib/generators/blacklight_highlight/blacklight_highlight_generator.rb
Instance Method Summary collapse
Instance Method Details
#inject_catalog_controller_extension ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/generators/blacklight_highlight/blacklight_highlight_generator.rb', line 18 def inject_catalog_controller_extension file_path = "app/controllers/#{controller_name.underscore}.rb" if File.exists? file_path inject_into_file file_path, :after => "include Blacklight::Catalog" do "\n include BlacklightHighlight::ControllerExtension\n" end end end |
#inject_solr_document_extension ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/blacklight_highlight/blacklight_highlight_generator.rb', line 8 def inject_solr_document_extension file_path = "app/models/#{model_name.underscore}.rb" if File.exists? file_path inject_into_file file_path, :after => "include Blacklight::Solr::Document" do "\n include BlacklightHighlight::SolrDocumentExtension\n" end end end |