class PIM::Migration

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method PIM::MigrationDiscriminator::new
# File pim.rb, line 10514
def initialize options = {}, &block
  super
  raise "'block' must be specified" if block.nil?
  @block = block
end

Public Instance Methods

execute(context) click to toggle source
# File pim.rb, line 10520
def execute context
  begin
    return @block.call(context)
  rescue Exception => e
    PIM.log_error("Could not execute migration from #{context.from} to #{context.to} on '#{context.type}'", e)
    return nil
  end
end