Class: Solidus::UpdateGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Solidus::UpdateGenerator
- Defined in:
- lib/generators/solidus/update/update_generator.rb
Constant Summary collapse
Instance Method Summary collapse
Instance Method Details
#create_new_defaults_initializer ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/generators/solidus/update/update_generator.rb', line 45 def create_new_defaults_initializer previous_version_prompt = [:previous_version_prompt] return if previous_version_prompt && !yes?(<<~MSG, :red) The default preferences update process is only supported if you are coming from version #{FROM}. If this is not the case, please, skip it and update your application to use Solidus #{FROM} before retrying. If you are confident you want to upgrade from a previous version, you must rerun the generator with the "--from={OLD_VERSION}" argument. Are you sure you want to continue? (y/N) MSG from = [:from] to = [:to] @from = from @core_changes = core_changes_template(from, to) @frontend_changes = frontend_changes_template(from, to) @backend_changes = backend_changes_template(from, to) @api_changes = api_changes_template(from, to) template 'config/initializers/new_solidus_defaults.rb.tt', File.join([:initializer_directory], "#{[:initializer_basename]}.rb") end |
#install_migrations ⇒ Object
65 66 67 68 69 70 |
# File 'lib/generators/solidus/update/update_generator.rb', line 65 def install_migrations return unless [:install_migrations] say_status :copying, "migrations" rake 'spree:install:migrations' end |
#print_message ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/generators/solidus/update/update_generator.rb', line 72 def say <<~MSG *********************************************************************** Other tasks may be needed to update to the new Solidus version. Please, check https://github.com/solidusio/solidus/blob/v#{[:to]}/CHANGELOG.md for details. Thanks for using Solidus! *********************************************************************** MSG end |