README touch ups

This commit is contained in:
Adam Meehan 2012-08-09 11:55:53 +10:00
parent 7bcdea1738
commit fd73c4eccd

View File

@ -1,7 +1,7 @@
= ValidatesTimeliness = ValidatesTimeliness
* Source: http://github.com/adzap/validates_timeliness * Source: http://github.com/adzap/validates_timeliness
* Bugs: http://github.com/adzap/validates_timeliness/issues * Issues: http://github.com/adzap/validates_timeliness/issues
== Description == Description
@ -18,24 +18,19 @@ If you a looking for the old version for Rails 2.x go here[http://github.com/adz
* Only Rails date/time validation plugin offering complete validation (See ORM/ODM support) * Only Rails date/time validation plugin offering complete validation (See ORM/ODM support)
* Adds extensions to fix Rails date/time select issues (See Extensions)
* Uses extensible date/time parser (Using {timeliness gem}[http://github.com/adzap/timeliness]. See Plugin Parser) * Uses extensible date/time parser (Using {timeliness gem}[http://github.com/adzap/timeliness]. See Plugin Parser)
* Adds extensions to fix Rails date/time select issues (See Extensions)
* Supports I18n for the error messages * Supports I18n for the error messages
* Supports Ruby 1.8.x, 1.9.x and Rubinius. * Supports all the Rubies (that any sane person would be using in production).
== Installation == Installation
As plugin (from master)
rails plugin install git://github.com/adzap/validates_timeliness.git
As gem
# in Gemfile # in Gemfile
gem 'validates_timeliness', '~> 3.0.2' gem 'validates_timeliness', '~> 3.0'
# Run bundler # Run bundler
$ bundle install $ bundle install
@ -55,7 +50,7 @@ NOTE: You may wish to enable the plugin parser and the extensions to start. Plea
validates_datetime :occurred_at validates_datetime :occurred_at
validates_date :date_of_birth, :before => lambda { 18.years.ago }, validates_date :date_of_birth, :before => lambda { 18.years.ago },
:before_message => "must be at least 18 years old" :before_message => "must be at least 18 years old"
validates_datetime :finish_time, :after => :start_time # Method symbol validates_datetime :finish_time, :after => :start_time # Method symbol
@ -79,7 +74,7 @@ validation method
validates :date_of_birth, :timeliness => {:on_or_before => lambda { Date.current }, :type => :date} validates :date_of_birth, :timeliness => {:on_or_before => lambda { Date.current }, :type => :date}
end end
# or even on a specific record, per ActiveModel API. or even on a specific record, per ActiveModel API.
@person.validates_date :date_of_birth, :on_or_before => lambda { Date.current } @person.validates_date :date_of_birth, :on_or_before => lambda { Date.current }
@ -298,4 +293,4 @@ To see the generous people who have contributed code, take a look at the {contri
== License == License
Copyright (c) 2008-2010 Adam Meehan, released under the MIT license Copyright (c) 2008 Adam Meehan, released under the MIT license