extract activerecord classes to gem