BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e7393191
Commit
e7393191
authored
Mar 18, 2018
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace public_send calls.
parent
fb6d6fce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
atomic_internal_id.rb
app/models/concerns/atomic_internal_id.rb
+3
-3
No files found.
app/models/concerns/atomic_internal_id.rb
View file @
e7393191
...
...
@@ -27,12 +27,12 @@ module AtomicInternalId
module
ClassMethods
def
has_internal_id
(
column
,
scope
:,
init
:)
# rubocop:disable Naming/PredicateName
before_validation
(
on: :create
)
do
if
self
.
public_send
(
column
).
blank?
# rubocop:disable GitlabSecurity/PublicSend
scope_attrs
=
{
scope
=>
self
.
public_send
(
scope
)
}
# rubocop:disable GitlabSecurity/PublicSend
if
read_attribute
(
column
).
blank?
scope_attrs
=
{
scope
=>
association
(
scope
).
reader
}
usage
=
self
.
class
.
table_name
.
to_sym
new_iid
=
InternalId
.
generate_next
(
self
,
scope_attrs
,
usage
,
init
)
self
.
public_send
(
"
#{
column
}
="
,
new_iid
)
# rubocop:disable GitlabSecurity/PublicSend
write_attribute
(
column
,
new_iid
)
end
end
...
...
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