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
1
Merge Requests
1
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
nexedi
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/models/project.rb
app/models/project.rb
+5
-0
spec/models/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