class SyncCacheCountForSubjects < ActiveRecord::Migration[5.2] def change Subject.find_each do |s| Subject.reset_counters s.id, :shixuns Subject.reset_counters s.id, :stages end end end