mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
use Date.current in readme example
This commit is contained in:
parent
423eb96ecf
commit
f2d0be0032
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user