This project is archived and is in readonly mode.

#552 ✓wontfix
k776

Nested validations

Reported by k776 | July 5th, 2008 @ 10:30 PM | in 2.x

Rails 2.1 lacks support for easy nested validations so that multiple validations on the same field dont all show up at once.

It would be nice to have something like this for example.

validates_presence_of :username do

validates_format_of :username, :with => /[A-Za-z0-9]+/ do

validates_uniqueness_of :username, :case_sensitive => false

end

end

In this case, uniqueness would only be run if format validates, which would only be run if username is present.

Comments and changes to this ticket

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>

Pages