Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.svn
lib
test
CHANGELOG
LICENSE
README
Rakefile
init.rb
validates_as_date_time.gemspec

README

ValidatesAsDateTime
===================
This Ruby on Rails gem/plugin implements an ActiveRecord validation helper called
validates_as_date_time which validates U.S. dates, times, or date-times.

Installation:
=============
gem sources -a http://gems.github.com

Install the gem(s):
sudo gem install gbdev-validates_as_date_time

Add to environment.rb initializer block:
config.gem 'gbdev-validates_as_date_time', :version => '>=0.5.0', :lib => 'validates_as_date_time', :source => 'http://gems.github.com'

Usage:
======
In your model file do something like:

class MyClass < ActiveRecord::Base
  validates_as_date_time :my_birth_date, :year_range => 1980..2005, :allow_nil => false
  validates_as_date :her_birth_date, :allow_nil => false, :on => :create
  validates_as_time :his_birth_date, :allow_nil => false, :on => :update

end

Tests:
======
Some tests have been added.

License:
========
See the LICENSE file.
Something went wrong with that request. Please try again.