2006/4/3, Pat M. email@example.com:
I have validates_uniqueness_of on one of my model’s attributes. I’d
like to make it so that I can set the attribute to something, and if
it clashes with an existing record, automatically append a number to
it. I’m not really sure of the best way to go about this - any
look into adding a before_validation hook. Do your unique query in
there, and append your number, until you are satisfied it’s ok, or you
hit a specified limit.
Hope that helps !