Small refactor for activerecord task.

waiting for travis.