Validates Existence plugin

Plugin details

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 exisiting 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.

Repositoryhttp://svn.hasmanythrough.com/public/plugins/validates_existence Author Josh Susser Tags validation LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.hasmanythrough.com/public/plugins/validates_existence

Example

class Person < ActiveRecord::Base
    belongs_to :address
    validates_existence_of :address
end

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: Guest, about 1 year ago