class WarpEngine::Generators::InstallGenerator
rails g warp_engine:install: copies the initializer, the host image library (model, controller, migration) and the engine’s migration into the host application.
Public Class Methods
# File lib/generators/warp_engine/install/install_generator.rb, line 17 def self.next_migration_number(dirname) ActiveRecord::Generators::Base.next_migration_number(dirname) end
Returns the next migration timestamp for dirname.
Public Instance Methods
Source
# File lib/generators/warp_engine/install/install_generator.rb, line 28 def copy_image_library template "image.rb", "app/models/image.rb" template "images_controller.rb", "app/controllers/api/images_controller.rb" migration_template "create_images.rb", "db/migrate/create_images.rb" end
Writes the image model, Api::ImagesController and the migration creating the images table.
Source
# File lib/generators/warp_engine/install/install_generator.rb, line 22 def copy_initializer template "initializer.rb", "config/initializers/warp_engine.rb" end
Writes config/initializers/warp_engine.rb.
Source
# File lib/generators/warp_engine/install/install_generator.rb, line 35 def copy_migration migration_template "create_warp_engine_tables.rb", "db/migrate/create_warp_engine_tables.rb" end
Writes the migration creating the engine’s tables.
Source
# File lib/generators/warp_engine/install/install_generator.rb, line 40 def show_readme say <<~MSG WarpEngine telepítve. Következő lépések: 1. rails db:migrate 2. mount WarpEngine::Engine => "/" a config/routes.rb végére 3. a képkönyvtár a hosztod: a routes.rb-be namespace :api do get "image/:id", to: "images#show" end 4. állítsd be a config/initializers/warp_engine.rb-t MSG end
Prints the next steps of the installation.