Commit b6821ff4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rs-remove-task-states' into 'master'

Remove unused `task_[un]check` states from Update services

These were left over from the old Task handling.

See merge request !942
parents 43e410ad 8a148793
module Issues
class UpdateService < Issues::BaseService
def execute(issue)
state = params[:state_event]
case state
case params.delete(:state_event)
when 'reopen'
Issues::ReopenService.new(project, current_user, {}).execute(issue)
when 'close'
Issues::CloseService.new(project, current_user, {}).execute(issue)
when 'task_check'
issue.update_nth_task(params[:task_num].to_i, true)
when 'task_uncheck'
issue.update_nth_task(params[:task_num].to_i, false)
end
params[:assignee_id] = "" if params[:assignee_id] == IssuableFinder::NONE
......@@ -20,8 +14,7 @@ module Issues
filter_params
old_labels = issue.labels.to_a
if params.present? && issue.update_attributes(params.except(:state_event,
:task_num))
if params.present? && issue.update_attributes(params)
issue.reset_events_cache
if issue.labels != old_labels
......
......@@ -11,17 +11,11 @@ module MergeRequests
params.except!(:target_project_id)
params.except!(:source_branch)
state = params[:state_event]
case state
case params.delete(:state_event)
when 'reopen'
MergeRequests::ReopenService.new(project, current_user, {}).execute(merge_request)
when 'close'
MergeRequests::CloseService.new(project, current_user, {}).execute(merge_request)
when 'task_check'
merge_request.update_nth_task(params[:task_num].to_i, true)
when 'task_uncheck'
merge_request.update_nth_task(params[:task_num].to_i, false)
end
params[:assignee_id] = "" if params[:assignee_id] == IssuableFinder::NONE
......@@ -30,9 +24,7 @@ module MergeRequests
filter_params
old_labels = merge_request.labels.to_a
if params.present? && merge_request.update_attributes(
params.except(:state_event, :task_num)
)
if params.present? && merge_request.update_attributes(params)
merge_request.reset_events_cache
if merge_request.labels != old_labels
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment