remove duplicates from activerecord