Class: BlacklightOaiProvider::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/blacklight_oai_provider/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#inject_catalog_controller_concernObject



18
19
20
21
22
23
24
25
# File 'lib/generators/blacklight_oai_provider/install_generator.rb', line 18

def inject_catalog_controller_concern
  file_path = "app/controllers/#{controller_name.underscore}.rb"
  if File.exist? file_path
    inject_into_file file_path, after: "include Blacklight::Catalog" do
      "\n  include BlacklightOaiProvider::Controller\n"
    end
  end
end

#inject_solr_document_concernObject



8
9
10
11
12
13
14
15
16
# File 'lib/generators/blacklight_oai_provider/install_generator.rb', line 8

def inject_solr_document_concern
  file_path = "app/models/#{model_name.underscore}.rb"

  if File.exist? file_path
    inject_into_file file_path, after: "include Blacklight::Solr::Document" do
      "\n  include BlacklightOaiProvider::SolrDocument\n"
    end
  end
end