activerecord to the rescue