title: ‘How to use models in your migrations (without killing kittens) - Gem Session:
ruby on rails’
- web development
—>Fortunately, there is a way to use ActiveRecord magic in your migrations and still get the girl. By inlining classes you decouple your migration from any future changes in your models.
I’ve used this technique before, but here it is taken to an extra level. Worth reading if you’ve got a lot of migrations.