From 0daa081d192b64c3c744bd64466d40de347e066a Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Fri, 17 Jun 2011 10:50:11 -0700 Subject: [PATCH] [#475] Set the activity_type on the initial journals --- ...714111653_build_initial_journals_for_acts_as_journalized.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb b/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb index 327bcfbe..a5bf8e16 100644 --- a/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb +++ b/db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb @@ -17,6 +17,8 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration say_with_time("Building initial journals for #{p.class_name}") do + activity_type = p.activity_provider_options.keys.first + p.find(:all).each do |o| # Create initial journals new_journal = o.journals.build @@ -36,6 +38,7 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration end new_journal.changes = creation_changes new_journal.version = 1 + new_journal.activity_type = activity_type if o.respond_to?(:author) new_journal.user = o.author