This project is archived and is in readonly mode.
proc support for validates_numericality_of
Reported by Kane | August 13th, 2009 @ 07:26 PM
class Person < ActiveRecord::Base
validates_numericality_of :width, :less_than => Proc.new { |person| person.height }
end
Comments and changes to this ticket
-
José Valim August 16th, 2009 @ 08:55 AM
Proc is a good call, but maybe we could add a symbol as well?
validates_numericality_of :width, :less_than => :height
I'm suggesting this based on validates_timeliness API:
validates_timeliness_of :start_at, :after => proc { Time.now.utc } validates_timeliness_of :end_at, :after => :start_at
-
Kane August 16th, 2009 @ 06:39 PM
- no changes were found...
-
Kane August 25th, 2009 @ 12:04 AM
- Assigned user set to josh
-
Repository August 31st, 2009 @ 07:35 PM
- State changed from new to resolved
(from [cf9f361699d72b5b34a655f8940c024cba0f0e09]) added proc and symbol support to validates_numericality_of [#3049 state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com
http://github.com/rails/rails/commit/cf9f361699d72b5b34a655f8940c02...
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>
People watching this ticket
Attachments
Referenced by
- 3049 proc support for validates_numericality_of (from [cf9f361699d72b5b34a655f8940c024cba0f0e09]) added p...