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
4ce376c0
Commit
4ce376c0
authored
Feb 26, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename chronic_duration_attribute* to chronic_duration_attr*
parent
c21e817a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
app/models/ci/runner.rb
app/models/ci/runner.rb
+1
-1
app/models/concerns/chronic_duration_attribute.rb
app/models/concerns/chronic_duration_attribute.rb
+5
-5
No files found.
app/models/ci/build.rb
View file @
4ce376c0
...
@@ -91,7 +91,7 @@ module Ci
...
@@ -91,7 +91,7 @@ module Ci
after_commit
:update_project_statistics_after_save
,
on:
[
:create
,
:update
]
after_commit
:update_project_statistics_after_save
,
on:
[
:create
,
:update
]
after_commit
:update_project_statistics
,
on: :destroy
after_commit
:update_project_statistics
,
on: :destroy
chronic_duration_attr
ibute
_reader
:used_timeout_user_readable
,
:used_timeout
chronic_duration_attr_reader
:used_timeout_user_readable
,
:used_timeout
class
<<
self
class
<<
self
# This is needed for url_for to work,
# This is needed for url_for to work,
...
...
app/models/ci/runner.rb
View file @
4ce376c0
...
@@ -52,7 +52,7 @@ module Ci
...
@@ -52,7 +52,7 @@ module Ci
cached_attr_reader
:version
,
:revision
,
:platform
,
:architecture
,
:contacted_at
,
:ip_address
cached_attr_reader
:version
,
:revision
,
:platform
,
:architecture
,
:contacted_at
,
:ip_address
chronic_duration_attr
ibute
:maximum_job_timeout_user_readable
,
:maximum_job_timeout
chronic_duration_attr
:maximum_job_timeout_user_readable
,
:maximum_job_timeout
# Searches for runners matching the given query.
# Searches for runners matching the given query.
#
#
...
...
app/models/concerns/chronic_duration_attribute.rb
View file @
4ce376c0
...
@@ -2,19 +2,19 @@ module ChronicDurationAttribute
...
@@ -2,19 +2,19 @@ module ChronicDurationAttribute
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
class_methods
do
class_methods
do
def
chronic_duration_attr
ibute
(
virtual_attribute
,
source_attribute
)
def
chronic_duration_attr
(
virtual_attribute
,
source_attribute
)
chronic_duration_attr
ibute
_reader
(
virtual_attribute
,
source_attribute
)
chronic_duration_attr_reader
(
virtual_attribute
,
source_attribute
)
chronic_duration_attr
ibute
_writer
(
virtual_attribute
,
source_attribute
)
chronic_duration_attr_writer
(
virtual_attribute
,
source_attribute
)
end
end
def
chronic_duration_attr
ibute
_reader
(
virtual_attribute
,
source_attribute
)
def
chronic_duration_attr_reader
(
virtual_attribute
,
source_attribute
)
define_method
(
virtual_attribute
)
do
define_method
(
virtual_attribute
)
do
value
=
self
.
send
(
source_attribute
)
# rubocop:disable GitlabSecurity/PublicSend
value
=
self
.
send
(
source_attribute
)
# rubocop:disable GitlabSecurity/PublicSend
ChronicDuration
.
output
(
value
,
format: :short
)
unless
value
.
nil?
ChronicDuration
.
output
(
value
,
format: :short
)
unless
value
.
nil?
end
end
end
end
def
chronic_duration_attr
ibute
_writer
(
virtual_attribute
,
source_attribute
)
def
chronic_duration_attr_writer
(
virtual_attribute
,
source_attribute
)
define_method
(
"
#{
virtual_attribute
}
="
)
do
|
value
|
define_method
(
"
#{
virtual_attribute
}
="
)
do
|
value
|
new_value
=
ChronicDuration
.
parse
(
value
).
to_i
new_value
=
ChronicDuration
.
parse
(
value
).
to_i
self
.
send
(
"
#{
source_attribute
}
="
,
new_value
)
# rubocop:disable GitlabSecurity/PublicSend
self
.
send
(
"
#{
source_attribute
}
="
,
new_value
)
# rubocop:disable GitlabSecurity/PublicSend
...
...
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