In my rails 5 engine I want to include the installation of the engine's migrations with the custom install generator I have at:
myengine/lib/generators/myengine/install_generator.rb
This generator currently looks like this:
module Myengine
module Generators
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path("../../templates", __FILE__)
desc "Creates a Myengine initializer and copys template files to your application."
def copy_initializer
template "myengine.rb", "config/initializers/myengine.rb"
end
end
end
end
When I add the engine to a rails app, instead of having to call:
rails g myengine:install
then
rails myengine:install:migrations
How can I add the creation of those migrations to the custom generator?