Every now and then, I use a web app and it tells me that this or that field is invalid. Generally it’s an email address that doesn’t accept a plus before the @, or a phone number that doesn’t accept well formated international phone numbers (starting with a plus, containing hyphens) or maybe it fails to deal with my name or last name which contain this terrible characters: é and á. Of course, the developed failed here.
Generally I try to have my validations be much better about it, but I’m sure that I’m not inmune to the issue of rejecting valid data. What concerns me is that, unlike exceptions, for which I get an email, I’ll never know about this issues unless a user tells me, and they rarely do.
So, I was thinking, wouldn’t it be nice if Rails automatically saved the attributes of an object to the database when the validations fail? I suppose a gem could do it by monkey-patching validate or something like that and I’m also sure I’m not the first one to think of this.
Does anybody know if that gem already exists? If not, I’ll give it a try. What do you think about this feature? Does it sound useful?