Hi again, I have a problem when I try to validate uniqueness of data entered through text fields in this particular circumstance. Let say that I have a text field which has a validates_uniqueness_of on its respective model. And let say that the user enter for that field the value "Stanley Kubrick" and it is saved without problems.
On the listing I will see the entered value "Stanley Kubrick", as it was supposed to be.
Then I use the same form to enter the value "Stanley Kubrick " (with a blank space at the end) and, obviously, validation will let it pass. The problem begins when the user will see on the listing two "apparently" duplicated records like this:
- Stanley Kubrick - Stanley Kubrick
What I need is a short way to remove those leading blank spaces before the validation that doesn't push me to change a hundred of models in my applications.
Peace!!