Class: Georgia::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Georgia::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/georgia/install/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #copy_templates ⇒ Object
- #create_admin_user ⇒ Object
- #mount_engine ⇒ Object
- #run_migrations ⇒ Object
- #show_readme ⇒ Object
Class Method Details
.next_migration_number(number) ⇒ Object
27 28 29 |
# File 'lib/generators/georgia/install/install_generator.rb', line 27 def self.next_migration_number(number) ActiveRecord::Generators::Base.next_migration_number(number) end |
Instance Method Details
#copy_templates ⇒ Object
41 42 43 44 |
# File 'lib/generators/georgia/install/install_generator.rb', line 41 def copy_templates template "config/initializers/georgia.rb" template "app/controllers/pages_controller.rb" end |
#create_admin_user ⇒ Object
36 37 38 39 |
# File 'lib/generators/georgia/install/install_generator.rb', line 36 def create_admin_user say("You're almost done. You need an admin user to get started.", :yellow) rake "georgia:seed" end |
#mount_engine ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/generators/georgia/install/install_generator.rb', line 18 def mount_engine # Must be in reverse order to keep priorities route "get '*request_path', to: 'pages#show', as: :page" route "root to: 'pages#show', request_path: 'home'" route "resources :messages, only: [:create]" route "mount Ckeditor::Engine => '/ckeditor'" route "mount Georgia::Engine => '/admin'" end |
#run_migrations ⇒ Object
31 32 33 34 |
# File 'lib/generators/georgia/install/install_generator.rb', line 31 def run_migrations rake "railties:install:migrations" rake "db:migrate" end |
#show_readme ⇒ Object
46 47 48 |
# File 'lib/generators/georgia/install/install_generator.rb', line 46 def show_readme readme "README" end |