Moved register of activerecord out of class