The callback that quietly doubled our database
A Rails after_save callback silently duplicated database rows: how the symptom appeared, why the obvious suspect was innocent, and the real root cause.
A Rails after_save callback silently duplicated database rows: how the symptom appeared, why the obvious suspect was innocent, and the real root cause.
How ActiveRecord's unscope method selectively removes where and order conditions from default scopes, with examples and alternatives like merge and unscoped.