Sha256: 5eb5ebe2ca325e50cc1e38b0c6bf4478ae38f9f7c6f16bf0ea73d8817a13cf95

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 Bytes

Contents

module SpreeChannable
  module Generators
    class InstallGenerator < Rails::Generators::Base
      class_option :auto_run_migrations, type: :boolean, default: false

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

      def run_migrations
        run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
        if run_migrations
          run 'bundle exec rake db:migrate'
        else
          puts 'Skipping 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_channable-0.0.24 lib/generators/spree_channable/install/install_generator.rb
spree_channable-0.0.23 lib/generators/spree_channable/install/install_generator.rb
spree_channable-0.0.22 lib/generators/spree_channable/install/install_generator.rb
spree_channable-0.0.21 lib/generators/spree_channable/install/install_generator.rb
spree_channable-0.0.20 lib/generators/spree_channable/install/install_generator.rb
spree_channable-0.0.18.alpha lib/generators/spree_channable/install/install_generator.rb