I added Rails.application.eager_load! above to load all the application's models.