Tuesday, April 29, 2014

Observers and Migratios

The past day we created a model migration and then added an observer for the model after the migration. Surprisingly, the observer (now added in the application.rb file) was loaded first by environment which then checks for the model and tries to fire a DB query for columns.

This fails and therefore the migration does not go through.

So for future reference, always migrate first and then add the observer!