Migrate existing journals so version 1 is open for the initial journal

This commit is contained in:
Eric Davis 2011-06-16 19:18:50 -07:00
parent 8b13992c0a
commit 2ff9711fc7
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class UpdateJournalsForActsAsJournalized < ActiveRecord::Migration
klass_name = "#{j.journalized_type}Journal"
j = j.becomes(klass_name.constantize)
j.type = klass_name
j.version = idx + 1
j.version = idx + 2 # initial journal should be 1
# FIXME: Find some way to choose the right activity here
j.activity_type = j.journalized_type.constantize.activity_provider_options.keys.first
j.save(false)