class Blacklight::ModelsGenerator

Public Instance Methods

add_routes() click to toggle source
# File lib/generators/blacklight/models_generator.rb, line 30
    def add_routes
      route <<-EOF

  concern :exportable, Blacklight::Routes::Exportable.new

  resources :solr_documents, only: [:show], path: '/catalog', controller: 'catalog' do
    concerns :exportable
  end

  resources :bookmarks, only: [:index, :update, :create, :destroy] do
    concerns :exportable

    collection do
      delete 'clear'
    end
  end
      EOF
    end
copy_migrations() click to toggle source

Setup the database migrations

# File lib/generators/blacklight/models_generator.rb, line 26
def copy_migrations
  rake "blacklight:install:migrations"
end
create_configuration_files() click to toggle source

Copy all files in templates/config directory to host config

# File lib/generators/blacklight/models_generator.rb, line 20
def create_configuration_files
  copy_file "config/blacklight.yml", "config/blacklight.yml"
  gsub_file 'config/blacklight.yml', '__VERSION__', Blacklight::VERSION
end