Class: Blacklight::ModelsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Blacklight::ModelsGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/blacklight/models_generator.rb
Instance Method Summary collapse
- #add_routes ⇒ Object
-
#copy_migrations ⇒ Object
Setup the database migrations.
-
#create_configuration_files ⇒ Object
Copy all files in templates/config directory to host config.
Instance Method Details
#add_routes ⇒ Object
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_migrations ⇒ Object
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_files ⇒ Object
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 |