Added the start of a new migration to use the Rate plugin

* Migration 9 will abort with a message if the Rate plugin isn't installed

  #1924
This commit is contained in:
Eric Davis
2009-01-21 14:09:34 -08:00
parent 0f7c630f9c
commit 8a08e654e0
@@ -0,0 +1,21 @@
RateMigrationErrorMessage = "ERROR: The Rate plugin is not installed. Please install the Rate plugin or downgrade to version 0.1.0 of the Budget plugin."
begin
require_dependency 'rate'
rescue LoadError
raise Exception.new(RateMigrationErrorMessage)
end
class ConvertMemberRateToFullRates < ActiveRecord::Migration
def self.up
self.check_that_rate_plugin_is_installed
end
def self.down
self.check_that_rate_plugin_is_installed
end
def self.check_that_rate_plugin_is_installed
raise Exception.new(RateMigrationErrorMessage) unless Object.const_defined?("Rate")
end
end