Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
ac6331939c09
Commit
ac633193
authored
May 03, 2017
by
Douglas Barbosa Alexandre
Browse files
Set last_repository_updated_at to created_at upon project creation
parent
b0a7e45eee01
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
ac633193
...
...
@@ -53,6 +53,11 @@
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 @
ac633193
...
...
@@ -1925,4 +1925,12 @@
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
Supports
Markdown
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