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.

proc support for validates_numericality_of

#3049
  class Person < ActiveRecord::Base
    validates_numericality_of :width, :less_than => Proc.new { |person| person.height }
  end

Reported by Kane · August 13th, 2009 @ 07:26 PM

State: resolved
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. José Valim
    José Valim

    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
    

    August 16th, 2009 @ 08:55 AM

  2. Kane
  3. Kane
    Kane
    • Assigned user set to josh

    August 25th, 2009 @ 12:04 AM

  4. Repository
    Repository
    • State changed from new to resolved

    August 31st, 2009 @ 07:35 PM