Project

General

Profile

« Previous | Next » 

Revision a1e75a0b

Added by Tomer Brisker over 8 years ago

Fixes #10133 - Prevent deadlocks when fixing counter_cache

(cherry picked from commit 7fad1fa0e253e793511df1cde24d8b1885d640c4)

View differences:

app/models/concerns/counter_cache_fix.rb
extend ActiveSupport::Concern
included do
after_update :update_counter_caches
after_commit :update_counter_caches
def update_counter_caches
self.changes.each do |key, (old_value, new_value)|

Also available in: Unified diff