Displaying 1 result from an estimated 1 matches for "home_town".
2007 Jan 20
0
[PLUGIN] instance_validations
...ons
===================
ActiveRecord lets you define validations at the class level. This
plugin lets you define validations for ActiveRecord instances. Take
the following ActiveRecord class:
class Chicken < ActiveRecord::Base
include InstanceValidations
# Has two columns, name and home_town. Only validate name
validates_presence_of :name
end
All instances of Chicken will require a name in order to be valid. If
you don''t define any instance validations, you''ll get the expected
behavior:
chicken = Chicken.new
chicken.valid? => false, will have an e...