Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
4bc5bc9f
Commit
4bc5bc9f
authored
Jul 29, 2011
by
Felix Schäfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid touching journaled objects on backdated journal creation.
parent
5015ca48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
20100714111653_build_initial_journals_for_acts_as_journalized.rb
...4111653_build_initial_journals_for_acts_as_journalized.rb
+6
-0
20100804112053_merge_wiki_versions_with_journals.rb
...grate/20100804112053_merge_wiki_versions_with_journals.rb
+6
-0
No files found.
db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb
View file @
4bc5bc9f
...
...
@@ -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
...
...
db/migrate/20100804112053_merge_wiki_versions_with_journals.rb
View file @
4bc5bc9f
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment