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
55f9ecbe
Commit
55f9ecbe
authored
Jul 29, 2011
by
Felix Schäfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove double initial WikiContentJournals. #542
parent
894911f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
20110729125454_remove_double_initial_wiki_content_journals.rb
...0729125454_remove_double_initial_wiki_content_journals.rb
+10
-0
No files found.
db/migrate/20110729125454_remove_double_initial_wiki_content_journals.rb
0 → 100644
View file @
55f9ecbe
class
RemoveDoubleInitialWikiContentJournals
<
ActiveRecord
::
Migration
def
self
.
up
# Remove the newest initial WikiContentJournal (the one erroneously created by a former migration) if there are more than one
WikiContentJournal
.
find
(
:all
,
:conditions
=>
{
:version
=>
1
}).
group_by
(
&
:journaled_id
).
select
{
|
k
,
v
|
v
.
size
>
1
}.
each
{
|
k
,
v
|
v
.
max_by
(
&
:created_at
).
delete
}
end
def
self
.
down
# noop
end
end
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