An exercise in understanding Rails by rebuilding Active Record