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.

This project is archived and is in readonly mode.

Validates Format is NOT Case Sensitive

#5369

Using "validates :name, :format => { :with => /[a-z]+/ }" matches abc and ABC. It should only match abc whereas /[a-z]+/i should match it all.

Reported by Robert Wünsch · August 12th, 2010 @ 10:36 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Srinivas Aki
    Srinivas Aki

    Robert,

    I could not reproduce the issue. Can you elaborate a little bit on what you were trying to do.

    Thanks
    Srini

    August 14th, 2010 @ 11:30 PM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to needs-more-info
    • Importance changed from to Low

    I could not reproduce this on the 3-0-stable branch.

    I did the following:

    • Create a new app
    • Create a Post scaffold with title field
    • Add the validation: validates :title, :format => { :with => /[a-z]+/ }
    • Try the following in console
    ruby-1.9.2-p0 > p = Post.new :title => 'ABC'
     => #<Post id: nil, title: "ABC", created_at: nil, updated_at: nil> 
    ruby-1.9.2-p0 > p.save
     => false 
    ruby-1.9.2-p0 > p.errors
     => {:title=>["is invalid"]} 
    
    ruby-1.9.2-p0 > valid_p = Post.new :title => 'abc'
     => #<Post id: nil, title: "abc", created_at: nil, updated_at: nil> 
    ruby-1.9.2-p0 > valid_p.save
     => true
    

    Are there any other steps that need to be followed to reproduce this issue?

    August 26th, 2010 @ 04:03 AM

  3. Robert Wünsch
    Robert Wünsch

    After updating to Rails 3.0 release candidate 2 the problem no longer occurs.

    August 26th, 2010 @ 11:26 AM

  4. Rohit Arondekar
    Rohit Arondekar
    • State changed from needs-more-info to invalid

    August 26th, 2010 @ 11:33 AM