Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the upgrade task and point to additional steps from the update generator #4157

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions core/lib/generators/solidus/update/update_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ def create_new_defaults_initializer
File.join(options[:initializer_directory], "#{options[:initializer_basename]}.rb")
end

def print_message
say <<~MSG
***********************************************************************
Other tasks may be needed to update to the new Solidus version. Please,
check https://github.com/solidusio/solidus/blob/v#{options[:to]}/CHANGELOG.md
for details.
Thanks for using Solidus!
***********************************************************************
MSG
end

private

def core_changes_template(from, to)
Expand Down
13 changes: 0 additions & 13 deletions core/lib/tasks/migrations/delete_prices_with_nil_amount.rake

This file was deleted.

8 changes: 8 additions & 0 deletions core/lib/tasks/solidus/delete_prices_with_nil_amount.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

namespace :solidus do
desc "Delete Spree::Price records which amount field is NULL"
task delete_prices_with_nil_amount: :environment do
Spree::Price.where(amount: nil).delete_all
end
end
22 changes: 0 additions & 22 deletions core/lib/tasks/upgrade.rake

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

require 'rails_helper'

path = Spree::Core::Engine.root.join('lib/tasks/migrations/delete_prices_with_nil_amount.rake')
path = Spree::Core::Engine.root.join('lib/tasks/solidus/delete_prices_with_nil_amount.rake')

RSpec.describe 'solidus:migrations:delete_prices_with_nil_amount' do
describe 'up' do
RSpec.describe 'solidus' do
describe 'delete_prices_with_nil_amount' do
include_context(
'rake',
task_path: path,
task_name: 'solidus:migrations:delete_prices_with_nil_amount:up'
task_name: 'solidus:delete_prices_with_nil_amount'
)

it 'removes all prices which amount column is NULL' do
Expand Down