rails remove duplicates from array code example Example: ruby array remove duplicates array = array.uniq