Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
4496a747
Commit
4496a747
authored
Apr 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve migration AddLastActivityColumnIntoProject to use real last activity date if present
parent
ae2233b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
db/migrate/20130403003950_add_last_activity_column_into_project.rb
...e/20130403003950_add_last_activity_column_into_project.rb
+7
-1
No files found.
db/migrate/20130403003950_add_last_activity_column_into_project.rb
View file @
4496a747
...
@@ -4,7 +4,13 @@ class AddLastActivityColumnIntoProject < ActiveRecord::Migration
...
@@ -4,7 +4,13 @@ class AddLastActivityColumnIntoProject < ActiveRecord::Migration
add_index
:projects
,
:last_activity_at
add_index
:projects
,
:last_activity_at
Project
.
find_each
do
|
project
|
Project
.
find_each
do
|
project
|
project
.
update_attribute
(
:last_activity_at
,
project
.
last_activity_date
)
last_activity_date
=
if
project
.
last_activity
project
.
last_activity
.
created_at
else
project
.
updated_at
end
project
.
update_attribute
(
:last_activity_at
,
last_activity_date
)
end
end
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