PERF: don't count all likes twice on like

This commit is contained in:
Sam 2015-06-25 17:19:32 +10:00
parent 8252f4e110
commit 1edb5919fa
1 changed files with 6 additions and 3 deletions

View File

@ -280,9 +280,12 @@ SQL
end
# agree with other flags
PostAction.agree_flags!(post, user) if staff_took_action
# update counters
post_action.try(:update_counters)
if staff_took_action
PostAction.agree_flags!(post, user)
# update counters
post_action.try(:update_counters)
end
post_action
rescue ActiveRecord::RecordNotUnique