Blog

Large blog hero computer frustration

How To Use Models In Your Migrations

Most often, ActiveRecord migrations are used to manage database schema changes. Any migration you write should meet one, steadfast rule:

The code in a migration should be able to run, in sequence, at anytime.

Sometimes, however, the data in the database needs to change as a result of a migration. It is tempting to use models inside a migration to affect the data change. This can be done, but you should consider that when external code (your models) is used in a migration, it ties the migration to code that may and most likely will change over time; violating the above rule.

Read More
Large blog hero nginx passenger ruby2

Local Rails Development With Nginx, Passenger 4, And Ruby 2 On Mac Os X

If you develop software long enough, you'll eventually have to debug mysterious, environment related issues. I found myself in this particular pickle earlier this week while debugging a show-stopping issue on a staging server. These issues can be substantially mitigated by mirroring your local development stack as closely as possible to your production setup.

Read More