FIX: in rare conditions post timing would miss the user

This commit is contained in:
Sam 2018-05-24 15:38:33 +10:00
parent 70179290f3
commit 53b97b28f0
1 changed files with 4 additions and 1 deletions

View File

@ -622,9 +622,12 @@ class TopicsController < ApplicationController
topic_time = allowed_params[:topic_time].to_i
timings = allowed_params[:timings].to_h || {}
# ensure we capture current user for the block
user = current_user
hijack do
PostTiming.process_timings(
current_user,
user,
topic_id,
topic_time,
timings.map { |post_number, t| [post_number.to_i, t.to_i] },