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
Léo-Paul Géneau
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
Hide 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
...
@@ -26,10 +26,10 @@ module AtomicInternalId
module
ClassMethods
module
ClassMethods
def
has_internal_id
(
column
,
scope
:,
init
:,
presence:
true
)
# rubocop:disable Naming/PredicateName
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
validates
column
,
presence:
presence
,
numericality:
true
define_method
(
"ensure_
#{
column
}
!"
)
do
define_method
(
"ensure_
#{
scope
}
_
#{
column
}
!"
)
do
scope_value
=
association
(
scope
).
reader
scope_value
=
association
(
scope
).
reader
if
read_attribute
(
column
).
blank?
&&
scope_value
if
read_attribute
(
column
).
blank?
&&
scope_value
...
...
lib/gitlab/ci/pipeline/chain/create.rb
View file @
6a108b8f
...
@@ -6,8 +6,8 @@ module Gitlab
...
@@ -6,8 +6,8 @@ module Gitlab
include
Chain
::
Helpers
include
Chain
::
Helpers
def
perform!
def
perform!
#
TODO: a
llocate next IID outside of transaction
#
A
llocate next IID outside of transaction
pipeline
.
ensure_iid!
pipeline
.
ensure_
project_
iid!
::
Ci
::
Pipeline
.
transaction
do
::
Ci
::
Pipeline
.
transaction
do
pipeline
.
save!
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