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
0daa081d
Commit
0daa081d
authored
Jun 17, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#475] Set the activity_type on the initial journals
parent
67dbd016
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
20100714111653_build_initial_journals_for_acts_as_journalized.rb
...4111653_build_initial_journals_for_acts_as_journalized.rb
+3
-0
No files found.
db/migrate/20100714111653_build_initial_journals_for_acts_as_journalized.rb
View file @
0daa081d
...
@@ -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
...
...
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