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
df8d472a
Commit
df8d472a
authored
Aug 03, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only update when fields actually changed.
parent
23fee68b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
ee/app/services/epics/update_service.rb
ee/app/services/epics/update_service.rb
+14
-3
No files found.
ee/app/services/epics/update_service.rb
View file @
df8d472a
module
Epics
class
UpdateService
<
Epics
::
BaseService
EPIC_DATE_FIELDS
=
%I[
start_date_fixed
start_date_is_fixed
due_date_fixed
due_date_is_fixed
]
.
freeze
def
execute
(
epic
)
# start_date and end_date columns are no longer writable by users because those
# are composite fields managed by the system.
...
...
@@ -7,9 +14,7 @@ module Epics
update
(
epic
)
if
(
params
.
keys
.
map
(
&
:to_sym
)
&
[
:start_date_fixed
,
:start_date_is_fixed
,
:due_date_fixed
,
:due_date_is_fixed
]).
present?
epic
.
update_start_and_due_dates
end
epic
.
update_start_and_due_dates
if
have_epic_dates_changed?
(
epic
)
epic
end
...
...
@@ -25,5 +30,11 @@ module Epics
todo_service
.
update_epic
(
epic
,
current_user
,
old_mentioned_users
)
end
private
def
have_epic_dates_changed?
(
epic
)
(
epic
.
previous_changes
.
keys
.
map
(
&
:to_sym
)
&
EPIC_DATE_FIELDS
).
present?
end
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