Sha256: 5d5aa953c2f2df3c967e0ec909e661ae38109790623a79a0ea0f28872d85430e

Contents?: true

Size: 622 Bytes

Versions: 1

Compression:

Stored size: 622 Bytes

Contents

module MercuryEngine
  module Generators
    class InstallGenerator < Rails::Generators::Base
      def add_route
        route "mount MercuryEngine::Engine => '/'"
      end

      def add_migrations
        run 'bundle exec rake railties:install:migrations FROM=mercury_engine'
      end

      def run_migrations
         response = ask "Would you like to run the migrations now? [Y/n]"

         if response == "" || response.downcase == "y"
           run 'bundle exec rake db:migrate'
         else
           say "Skipping rake db:migrate, don't forget to run it!", :yellow
         end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mercury_engine-0.0.1 lib/generators/mercury_engine/install_generator.rb