This project is archived and is in readonly mode.

validates_uniqueness , accepting white space
Reported by John | July 20th, 2009 @ 09:47 AM | in 3.x
Hy
I Know this is not a bug , but i face this issue's , like when i
add validates_uniqueness :user , so it means it will not accepted
blank user name by default allow_blank is set false ,same way there
should be parameter for striping ...
for this i added a parameter allow_strip => true , by default
it will false ,
i write a patch for this , may i posted here.
Let me know your opinion ,
Thanks
John
Comments and changes to this ticket
- 
         
- 
         Dan Pickett May 9th, 2010 @ 06:57 PM- Tag changed from validates_uniqueness to bugmash, validates_uniqueness
- Assigned user cleared.
 
- 
         Josh Kalderimis May 9th, 2010 @ 08:48 PM-1 I do not agree with this change, adding striping to validates_uniqueness_of does not seem consistent when compared to presence_of and other validators. Stripping is separate issue which should be individual of the validators. 
- 
         Ryan Bigg May 14th, 2010 @ 12:55 AM- State changed from new to open
 -1 This is not a wide enough use-case to be a patch to rails. You should make this a plugin. 
- 
         Dan Pickett May 15th, 2010 @ 03:01 AM-1 bloat for an isolated use case - a custom validator and even a gem/plugin should be a cinch to roll with some of the new functionality in Rails 3 
- 
         Rohit Arondekar May 15th, 2010 @ 04:41 AM-1 This feature would be better implemented separately, maybe as a plugin/gem. Removing whitespace should not be the job of validates_uniqueness. 
- 
            
         Anil Wadghule May 15th, 2010 @ 07:26 AM-1 Not needed along with validates_uniqueness. Custom validator/plugin/gem would be helpful. 
- 
         Jeff Kreeftmeijer May 15th, 2010 @ 09:43 AM-1 As said, would be cool as a plugin. Let's let validates_uniqueness_ofjust validate uniqueness :)
- 
         Ryan Bigg May 15th, 2010 @ 10:29 AM- State changed from open to wontfix
 I think that's enough -1s. Please make it a plugin. 
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
 Jeremy Kemper
      Jeremy Kemper
 John
      John
 Michael Koziarski
      Michael Koziarski
 Ryan Bigg
      Ryan Bigg