ajvargo/data-migrate — pull request #19 by dorner (2014-08-06 20:26:46+00:00)
Title: Store current state of model for running data migrations

The one thing, oddly enough, that this gem does *not* fix is the changing model problem. For example, in your description in the readme of a Post for which the Comment is removed, once the Comment model is gone, you will no longer be able to use it in the data migration! So while this gem organizes the scripts, it doesn't fix the overarching mutability issue.

This pull request creates a secondary file which is included in the data migration. This sets the associations of all used models (using a --classes option) so when they are referenced in the data migration, all the associations will magically work even if the model has been changed or removed in the meantime.