Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

validates_uniqueness , accepting white space

#2924

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

Reported by John · July 20th, 2009 @ 09:47 AM

State: wontfix
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  2. Dan Pickett
    Dan Pickett
    • Tag changed from validates_uniqueness to bugmash, validates_uniqueness
    • Assigned user cleared.

    May 9th, 2010 @ 06:57 PM

  3. Josh Kalderimis
    Josh Kalderimis

    -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.

    May 9th, 2010 @ 08:48 PM

  4. Ryan Bigg
    Ryan Bigg
    • 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.

    May 14th, 2010 @ 12:55 AM

  5. Dan Pickett
    Dan Pickett

    -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

    May 15th, 2010 @ 03:01 AM

  6. Rohit Arondekar
    Rohit Arondekar

    -1 This feature would be better implemented separately, maybe as a plugin/gem. Removing whitespace should not be the job of validates_uniqueness.

    May 15th, 2010 @ 04:41 AM

  7. Anil Wadghule
    Anil Wadghule

    -1 Not needed along with validates_uniqueness. Custom validator/plugin/gem would be helpful.

    May 15th, 2010 @ 07:26 AM

  8. Jeff Kreeftmeijer
    Jeff Kreeftmeijer

    -1

    As said, would be cool as a plugin. Let's let validates_uniqueness_of just validate uniqueness :)

    May 15th, 2010 @ 09:43 AM

  9. Ryan Bigg
    Ryan Bigg
    • State changed from open to wontfix

    I think that's enough -1s.

    Please make it a plugin.

    May 15th, 2010 @ 10:29 AM