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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
6a108b8f
Commit
6a108b8f
authored
May 10, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ensure_iid! method override problem
parent
30a6fb64
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/concerns/atomic_internal_id.rb
app/models/concerns/atomic_internal_id.rb
+2
-2
lib/gitlab/ci/pipeline/chain/create.rb
lib/gitlab/ci/pipeline/chain/create.rb
+2
-2
No files found.
app/models/concerns/atomic_internal_id.rb
View file @
6a108b8f
...
...
@@ -26,10 +26,10 @@ module AtomicInternalId
module
ClassMethods
def
has_internal_id
(
column
,
scope
:,
init
:,
presence:
true
)
# rubocop:disable Naming/PredicateName
before_validation
:"ensure_
#{
column
}
!"
,
on: :create
before_validation
:"ensure_
#{
scope
}
_
#{
column
}
!"
,
on: :create
validates
column
,
presence:
presence
,
numericality:
true
define_method
(
"ensure_
#{
column
}
!"
)
do
define_method
(
"ensure_
#{
scope
}
_
#{
column
}
!"
)
do
scope_value
=
association
(
scope
).
reader
if
read_attribute
(
column
).
blank?
&&
scope_value
...
...
lib/gitlab/ci/pipeline/chain/create.rb
View file @
6a108b8f
...
...
@@ -6,8 +6,8 @@ module Gitlab
include
Chain
::
Helpers
def
perform!
#
TODO: a
llocate next IID outside of transaction
pipeline
.
ensure_iid!
#
A
llocate next IID outside of transaction
pipeline
.
ensure_
project_
iid!
::
Ci
::
Pipeline
.
transaction
do
pipeline
.
save!
...
...
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