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
50573a63
Commit
50573a63
authored
Nov 14, 2016
by
Ruben Davila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactor.
parent
d2b89ea7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+0
-1
app/models/concerns/time_trackable.rb
app/models/concerns/time_trackable.rb
+3
-1
No files found.
app/models/concerns/issuable.rb
View file @
50573a63
...
...
@@ -38,7 +38,6 @@ module Issuable
has_many
:label_links
,
as: :target
,
dependent: :destroy
has_many
:labels
,
through: :label_links
has_many
:todos
,
as: :target
,
dependent: :destroy
has_many
:timelogs
,
as: :trackable
,
dependent: :destroy
has_one
:metrics
...
...
app/models/concerns/time_trackable.rb
View file @
50573a63
...
...
@@ -12,6 +12,8 @@ module TimeTrackable
attr_reader
:time_spent
alias_method
:time_spent?
,
:time_spent
has_many
:timelogs
,
as: :trackable
,
dependent: :destroy
end
def
spend_time
=
(
args
)
...
...
@@ -32,7 +34,7 @@ module TimeTrackable
private
def
valid_spend_time_args?
(
args
)
return
false
unless
[
:seconds
,
:user
].
all?
{
|
k
|
args
.
key?
(
k
)
}
return
false
if
[
:seconds
,
:user
].
any?
{
|
k
|
args
[
k
].
blank?
}
# time to subtract exceeds the total time spent
seconds
=
args
[
:seconds
]
...
...
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