accounting for activerecord