use Date.current in readme example

This commit is contained in:
Adam Meehan 2010-10-14 19:00:53 +11:00
parent 423eb96ecf
commit f2d0be0032

View File

@ -71,14 +71,14 @@ To validate a model with a date, time or datetime attribute you just use the
validation method
class Person < ActiveRecord::Base
validates_date :date_of_birth, :on_or_before => lambda { Date.today }
validates_date :date_of_birth, :on_or_before => lambda { Date.current }
# or
validates :date_of_birth, :timeliness => {:on_or_before => lambda { Date.today }, :type => :date}
validates :date_of_birth, :timeliness => {:on_or_before => lambda { Date.current }, :type => :date}
end
# or even on a specific record, per ActiveModel API.
@person.validates_date :date_of_birth, :on_or_before => lambda { Date.today }
@person.validates_date :date_of_birth, :on_or_before => lambda { Date.current }
The list of validation methods available are as follows: