Changeset 8825
- Timestamp:
- 02/09/08 08:24:35 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/lib/active_record/validations.rb
r8802 r8825 478 478 # method, proc or string should return or evaluate to a true or false value. 479 479 # 480 # === Warning481 # Validate the presence of the foreign key, not the instance variable itself.482 # Do this:483 # validates_presence_of :invoice_id484 #485 # Not this:486 # validates_presence_of :invoice487 #488 # If you validate the presence of the associated object, you will get489 # failures on saves when both the parent object and the child object are490 # new.491 480 def validates_presence_of(*attr_names) 492 481 configuration = { :message => ActiveRecord::Errors.default_error_messages[:blank], :on => :save }