Class: Solidus::Migrations::PromotionWithCodeHandlers::DoNothing

Inherits:
Base
  • Object
show all
Defined in:
lib/solidus/migrations/promotions_with_code_handlers.rb

Instance Attribute Summary

Attributes inherited from Base

#migration_context, #promotions

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Solidus::Migrations::PromotionWithCodeHandlers::Base

Instance Method Details

#callObject



54
55
56
57
58
59
60
61
62
# File 'lib/solidus/migrations/promotions_with_code_handlers.rb', line 54

def call
  # This approach will delete all codes without taking any action. At
  # least we could print a message to track what we are deleting.
  #
  promotions.find_each do |promotion|
    migration_context.say "Code '#{promotion.code}' is going to be removed "\
      "from Spree::Promotion with id '#{promotion.id}'"
  end
end