Sha256: d501f317c3dc60516b4ea7c32854c78bbaf3395019e8ce5abe3c654110677a93
Contents?: true
Size: 865 Bytes
Versions: 15
Compression:
Stored size: 865 Bytes
Contents
# frozen_string_literal: true module SolidusBactracs module Generators class InstallGenerator < Rails::Generators::Base class_option :auto_run_migrations, type: :boolean, default: false source_root File.expand_path('templates', __dir__) def copy_initializer template 'initializer.rb', 'config/initializers/solidus_bactracs.rb' end def add_migrations run 'bin/rails railties:install:migrations FROM=solidus_bactracs' 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 'bin/rails db:migrate' else puts 'Skipping bin/rails db:migrate, don\'t forget to run it!' # rubocop:disable Rails/Output end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems