Class: SpreeSurrogateKey::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SpreeSurrogateKey::Generators::InstallGenerator
- Defined in:
- lib/generators/spree_surrogate_key/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_migrations ⇒ Object
11 12 13 |
# File 'lib/generators/spree_surrogate_key/install/install_generator.rb', line 11 def add_migrations run 'bundle exec rake railties:install:migrations FROM=spree_surrogate_key' end |
#copy_default_configuration_file ⇒ Object
7 8 9 |
# File 'lib/generators/spree_surrogate_key/install/install_generator.rb', line 7 def copy_default_configuration_file copy_file "config/fastly.yml" end |
#run_migrations ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/generators/spree_surrogate_key/install/install_generator.rb', line 15 def run_migrations run_migrations = [:migrate] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]')) if run_migrations run 'bundle exec rails db:migrate' else puts 'Skipping rails db:migrate, don\'t forget to run it!' end end |