From: Sebastian Hungerecker Date: 2009-04-26T20:37:52+09:00 Subject: Re: Overriding eql? and hash César Díaz wrote: > def hash >     StringUtils.nice_slug(self.name, "false").hash > >   end > >   def eql?(other) >     equal = false >     if StringUtils.nice_slug(self.name, "false").downcase.eql? > StringUtils.nice_slug(other.name, "false").downcase >       equal = true >     end >     equal >   end If two strings are equal except for case your eql? method will return true. Or at least it would if it ever got called. But since you don't call downcase in the hash method, those two objects will have different hash values and Set will never bother to call eql? on them. In other words: call downcase in the hash method as well and you'll be fine. HTH, Sebastian