Class: SolidusTaxCloud::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/solidus_tax_cloud/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_migrationsObject



15
16
17
# File 'lib/generators/solidus_tax_cloud/install/install_generator.rb', line 15

def add_migrations
  run 'bin/rails railties:install:migrations FROM=solidus_tax_cloud'
end

#copy_initializer_fileObject



11
12
13
# File 'lib/generators/solidus_tax_cloud/install/install_generator.rb', line 11

def copy_initializer_file
  template 'ca-bundle.crt', "#{file_name}/lib/ca-bundle.crt"
end

#run_migrationsObject



19
20
21
22
23
24
25
26
# File 'lib/generators/solidus_tax_cloud/install/install_generator.rb', line 19

def run_migrations
  run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]')) # rubocop:disable Metrics/LineLength
  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