Skip to content

Commit

Permalink
Merge pull request #4157 from nebulab/waiting-for-dev/remove_upgrade_…
Browse files Browse the repository at this point in the history
…task

Remove the upgrade task and point to additional steps from the update generator
  • Loading branch information
kennyadsl authored Sep 9, 2021
2 parents 0d61702 + 516879a commit 15a561c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 39 deletions.
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

0 comments on commit 15a561c

Please sign in to comment.