mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
readme and generator comments
This commit is contained in:
parent
d450ab7c06
commit
247e157708
@ -73,7 +73,7 @@ validation method
|
|||||||
class Person < ActiveRecord::Base
|
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.today }
|
||||||
# or
|
# or
|
||||||
validates :date_of_birth, :timeliness => {:on_or_before => lambda { Date.today }, :type => date}
|
validates :date_of_birth, :timeliness => {:on_or_before => lambda { Date.today }, :type => :date}
|
||||||
end
|
end
|
||||||
|
|
||||||
# or even on a specific record, per ActiveModel API.
|
# or even on a specific record, per ActiveModel API.
|
||||||
|
|||||||
@ -2,9 +2,6 @@ ValidatesTimeliness.setup do |config|
|
|||||||
# Extend ORM/ODMs for full support (:active_record, :mongoid).
|
# Extend ORM/ODMs for full support (:active_record, :mongoid).
|
||||||
# config.extend_orms = [ :active_record ]
|
# config.extend_orms = [ :active_record ]
|
||||||
#
|
#
|
||||||
# User the plugin date/time parser which is stricter and extendable
|
|
||||||
# config.use_plugin_parser = false
|
|
||||||
#
|
|
||||||
# Set the dummy date part for a time type values.
|
# Set the dummy date part for a time type values.
|
||||||
# config.dummy_date_for_time_type = [ 2000, 1, 1 ]
|
# config.dummy_date_for_time_type = [ 2000, 1, 1 ]
|
||||||
#
|
#
|
||||||
@ -23,6 +20,9 @@ ValidatesTimeliness.setup do |config|
|
|||||||
# :today => lambda { Date.today }
|
# :today => lambda { Date.today }
|
||||||
# )
|
# )
|
||||||
#
|
#
|
||||||
|
# Use the plugin date/time parser which is stricter and extendable
|
||||||
|
# config.use_plugin_parser = false
|
||||||
|
#
|
||||||
# Add one or more formats making them valid. e.g. add_formats(:date, 'd(st|rd|th) of mmm, yyyy')
|
# Add one or more formats making them valid. e.g. add_formats(:date, 'd(st|rd|th) of mmm, yyyy')
|
||||||
# config.parser.add_formats()
|
# config.parser.add_formats()
|
||||||
#
|
#
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user