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
a7fd4947
Commit
a7fd4947
authored
May 02, 2017
by
Douglas Barbosa Alexandre
Committed by
Robert Speicher
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set last_repository_updated_at to created_at upon project creation
parent
5ffc8ffc
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 @
a7fd4947
...
@@ -56,6 +56,11 @@ class Project < ActiveRecord::Base
...
@@ -56,6 +56,11 @@ class Project < ActiveRecord::Base
update_column
(
:last_activity_at
,
self
.
created_at
)
update_column
(
:last_activity_at
,
self
.
created_at
)
end
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
after_destroy
:remove_pages
# update visibility_level of forks
# update visibility_level of forks
...
...
spec/models/project_spec.rb
View file @
a7fd4947
...
@@ -2340,4 +2340,12 @@ describe Project, models: true do
...
@@ -2340,4 +2340,12 @@ describe Project, models: true do
not_to
raise_error
not_to
raise_error
end
end
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
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