Class: Blacklight::ModelsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/blacklight/models_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_routesObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/generators/blacklight/models_generator.rb', line 27

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 do
concerns :exportable

collection do
  delete 'clear'
end
  end
  EOF
end

#copy_migrationsObject

Setup the database migrations



23
24
25
# File 'lib/generators/blacklight/models_generator.rb', line 23

def copy_migrations
  rake "blacklight:install:migrations"
end

#create_configuration_filesObject

Copy all files in templates/config directory to host config



18
19
20
# File 'lib/generators/blacklight/models_generator.rb', line 18

def create_configuration_files
  copy_file "config/blacklight.yml", "config/blacklight.yml"
end