class SyncUsersCountForShixun < ActiveRecord::Migration[5.2] def change Shixun.find_each do |s| Shixun.reset_counters s.id, :users_count end end end