Sha256: 107f9e539d9668e56a6089d2a7418001bcc14ff8a7c3de21de9e5508c2fd8b71

Contents?: true

Size: 609 Bytes

Versions: 6

Compression:

Stored size: 609 Bytes

Contents

module SpreeCorreiosShipping
  module Generators
    class InstallGenerator < Rails::Generators::Base
      class_option :auto_run_migrations, type: :boolean, default: true

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

      def run_migrations
        if options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
          run 'bundle exec rake db:migrate'
        else
          puts "Skiping rake db:migrate, don't forget to run it!"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_correios_shipping-1.1.4 lib/generators/spree_correios_shipping/install/install_generator.rb
spree_correios_shipping-1.1.3 lib/generators/spree_correios_shipping/install/install_generator.rb
spree_correios_shipping-1.1.2 lib/generators/spree_correios_shipping/install/install_generator.rb
spree_correios_shipping-1.1.1 lib/generators/spree_correios_shipping/install/install_generator.rb
spree_correios_shipping-1.1.0 lib/generators/spree_correios_shipping/install/install_generator.rb
spree_correios_shipping-1.0.0 lib/generators/spree_correios_shipping/install/install_generator.rb