[#4184] Load the YAML inside of #migrate.

This commit is contained in:
Eric Davis committed 2010-07-19 09:54:25 -07:00
1 parent 0ac27c0d3b
commit e2aabeec8c
2 files changed
+4 -3

No files matched your search

@@ -33,9 +33,10 @@ module RedmineContracts
def self.migrate_contracts def self.migrate_contracts
::Engines.plugins['redmine_contracts'].migrate ::Engines.plugins['redmine_contracts'].migrate
end end
# * old_data - YAML string of deliverables to migrate
def self.migrate(old_data) def self.migrate(old_data)
@@data = old_data @@data = YAML.load(old_data)
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
@@data.each do |old_deliverable| @@data.each do |old_deliverable|
@@ -6,7 +6,7 @@ class BudgetPluginMigrationTest < ActionController::IntegrationTest
end end
def load_test_fixture def load_test_fixture
YAML.load(File.read(File.expand_path(File.dirname(__FILE__)) + "/../fixtures/budget_plugin_migration/budget.yml")) File.read(File.expand_path(File.dirname(__FILE__)) + "/../fixtures/budget_plugin_migration/budget.yml")
end end
context "migrate" do context "migrate" do