Changed orm to activerecord