This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Sun May 04 17:25:28 -0700 2008 | [joshsusser] |
| |
README.markdown | Sun May 04 17:25:28 -0700 2008 | [joshsusser] |
| |
Rakefile | Sun May 04 17:25:28 -0700 2008 | [joshsusser] |
| |
init.rb | Sun May 04 17:25:28 -0700 2008 | [joshsusser] |
| |
lib/ | Sun May 04 17:25:28 -0700 2008 | [joshsusser] |
README.markdown
ValidatesExistence
This plugin adds a new validates_existence_of method to ActiveRecord::Base.
The validates_existence_of validator checks that a foreign key in a belongs_to
association points to an existing record. If :allow_nil => true, then the key
itself may be nil. A non-nil key requires that the foreign object must exist.
Works with polymorphic belongs_to.
The default error message is "does not exist".
Example
class Person < ActiveRecord::Base
belongs_to :address
validates_existence_of :address
end
Note that this validation performs a query to see if the record in question exists.
Copyright (c) 2007-2008 Josh Susser. Released under the MIT license.




