activerecord does magic