Commit 0daa081d authored by Eric Davis's avatar Eric Davis

[#475] Set the activity_type on the initial journals

parent 67dbd016
...@@ -17,6 +17,8 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration ...@@ -17,6 +17,8 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration
say_with_time("Building initial journals for #{p.class_name}") do 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| p.find(:all).each do |o|
# Create initial journals # Create initial journals
new_journal = o.journals.build new_journal = o.journals.build
...@@ -36,6 +38,7 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration ...@@ -36,6 +38,7 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration
end end
new_journal.changes = creation_changes new_journal.changes = creation_changes
new_journal.version = 1 new_journal.version = 1
new_journal.activity_type = activity_type
if o.respond_to?(:author) if o.respond_to?(:author)
new_journal.user = o.author new_journal.user = o.author
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment