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
b106d0da
Commit
b106d0da
authored
Feb 04, 2022
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move traversal_ids update to the end of transaction
parent
10d7c554
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
app/models/namespaces/traversal/linear.rb
app/models/namespaces/traversal/linear.rb
+4
-1
No files found.
app/models/namespaces/traversal/linear.rb
View file @
b106d0da
...
...
@@ -43,8 +43,11 @@ module Namespaces
included
do
before_update
:lock_both_roots
,
if:
->
{
sync_traversal_ids?
&&
parent_id_changed?
}
after_create
:sync_traversal_ids
,
if:
->
{
sync_traversal_ids?
}
after_update
:sync_traversal_ids
,
if:
->
{
sync_traversal_ids?
&&
saved_change_to_parent_id?
}
# hack: This uses rails internal API before_commit to sync traversal ids on namespace create, right before transaction commit.
# This is to be move to after_commit callback once projects and namespaces(groups) are consolidated and users will only be
# creating namespaces.
before_commit
:sync_traversal_ids
,
on:
[
:create
],
if:
->
{
sync_traversal_ids?
}
end
def
sync_traversal_ids?
...
...
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