Commit 4bc5bc9f authored by Felix Schäfer's avatar Felix Schäfer

Avoid touching journaled objects on backdated journal creation.

parent 5015ca48
......@@ -28,6 +28,12 @@ class BuildInitialJournalsForActsAsJournalized < ActiveRecord::Migration
[Message, Attachment, Document, Changeset, Issue, TimeEntry, News].each do |p|
say_with_time("Building initial journals for #{p.class_name}") do
# avoid touching the journaled object on journal creation
p.journal_class.class_exec {
def touch_journaled_after_creation
end
}
activity_type = p.activity_provider_options.keys.first
# Create initial journals
......
......@@ -18,6 +18,12 @@ class MergeWikiVersionsWithJournals < ActiveRecord::Migration
WikiContent.const_set("Version", Class.new(ActiveRecord::Base))
end
# avoid touching WikiContent on journal creation
WikiContentJournal.class_exec {
def touch_journaled_after_creation
end
}
WikiContent::Version.find_by_sql("SELECT * FROM wiki_content_versions").each do |wv|
journal = WikiContentJournal.create!(:journaled_id => wv.wiki_content_id, :user_id => wv.author_id,
:notes => wv.comments, :created_at => wv.updated_on, :activity_type => "wiki_edits")
......
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