BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
56db54d3
Commit
56db54d3
authored
May 03, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set last_repository_updated_at to created_at upon project creation
parent
341964da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
project.rb
app/models/project.rb
+5
-0
project_spec.rb
spec/models/project_spec.rb
+8
-0
No files found.
app/models/project.rb
View file @
56db54d3
...
...
@@ -53,6 +53,11 @@ class Project < ActiveRecord::Base
update_column
(
:last_activity_at
,
self
.
created_at
)
end
after_create
:set_last_repository_updated_at
def
set_last_repository_updated_at
update_column
(
:last_repository_updated_at
,
self
.
created_at
)
end
after_destroy
:remove_pages
# update visibility_level of forks
...
...
spec/models/project_spec.rb
View file @
56db54d3
...
...
@@ -1925,4 +1925,12 @@ describe Project, models: true do
not_to
raise_error
end
end
describe
'#last_repository_updated_at'
do
it
'sets to created_at upon creation'
do
project
=
create
(
:empty_project
,
created_at:
2
.
hours
.
ago
)
expect
(
project
.
last_repository_updated_at
.
to_i
).
to
eq
(
project
.
created_at
.
to_i
)
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