Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2019-01-29 19:46:04 +0300
committerFatih Acet <acetfatih@gmail.com>2019-01-31 01:18:20 +0300
commit58cd21c2ad802c1652311f025c599e0df604669c (patch)
tree0b0ed65bc247bc3d8dfdcd1bfa477ee57a58faff /app/services/issuable_base_service.rb
parenta3a847f8624b5f5b10d5665725df2090a1f631ba (diff)
Use the sourcepos attribute for finding tasks
Diffstat (limited to 'app/services/issuable_base_service.rb')
-rw-r--r--app/services/issuable_base_service.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb
index 5719a4778f0..2835d598311 100644
--- a/app/services/issuable_base_service.rb
+++ b/app/services/issuable_base_service.rb
@@ -262,16 +262,16 @@ class IssuableBaseService < BaseService
# Handle the `update_task` event sent from UI. Attempts to update a specific
# line in the markdown and cached html, bypassing any unnecessary updates or checks.
- def update_task_event(issue)
+ def update_task_event(issuable)
update_task_params = params.delete(:update_task)
return unless update_task_params
- toggler = TaskListToggleService.new(issue.description, issue.description_html,
+ toggler = TaskListToggleService.new(issuable.description, issuable.description_html,
line_source: update_task_params[:line_source],
line_number: update_task_params[:line_number],
currently_checked: !update_task_params[:checked],
index: update_task_params[:index],
- sourcepos: false)
+ sourcepos: !issuable.legacy_markdown?)
if toggler.execute
# by updating the description_html field at the same time,
@@ -282,9 +282,9 @@ class IssuableBaseService < BaseService
# since we're updating a very specific line, we don't care whether
# the `lock_version` sent from the FE is the same or not. Just
# make sure the data hasn't changed since we queried it
- params[:lock_version] = issue.lock_version
+ params[:lock_version] = issuable.lock_version
- update_task(issue)
+ update_task(issuable)
else
# if we make it here, the data is much newer than we thought it was - fail fast
raise ActiveRecord::StaleObjectError