finish activerecord