i have following code.
for i in 0..sold.length-1 duplicate = sold[i] print duplicate.check_duplicates print \" \" print sold[i].lotnumber + \
You can try using something called uniq!, here is a link to the API.
http://www.ruby-doc.org/core-2.0.0/Array.html#method-i-uniq-21