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
aab679bfc26e
Commit
aab679bf
authored
Oct 01, 2018
by
Mark Chao
Browse files
Combine two updates in one query
parent
cb4e94a4f05e
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
aab679bf
...
...
@@ -95,8 +95,7 @@
unless: :ci_cd_settings
,
if:
proc
{
ProjectCiCdSetting
.
available?
}
after_create
:set_last_activity_at
after_create
:set_last_repository_updated_at
after_create
:set_timestamps_for_create
after_update
:update_forks_visibility_level
before_destroy
:remove_private_deploy_keys
...
...
@@ -2102,13 +2101,8 @@
gitlab_shell
.
exists?
(
repository_storage
,
"
#{
disk_path
}
.git"
)
end
# set last_activity_at to the same as created_at
def
set_last_activity_at
update_column
(
:last_activity_at
,
self
.
created_at
)
end
def
set_last_repository_updated_at
update_column
(
:last_repository_updated_at
,
self
.
created_at
)
def
set_timestamps_for_create
update_columns
(
last_activity_at:
self
.
created_at
,
last_repository_updated_at:
self
.
created_at
)
end
def
cross_namespace_reference?
(
from
)
...
...
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