Forum: Ruby on Rails Validation relative to other attributes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
David C. (Guest)
on 2006-02-20 01:15
(Received via mailing list)
I have an object O with two 'collections'.  The minimum size for B is
A.length
+ 1.

Also, B has to be a proper subset of A.

What is the correct way to validate B?

David
Tom M. (Guest)
on 2006-02-20 01:24
(Received via mailing list)
In a custom validate method.

http://rails.rubyonrails.com/classes/ActiveRecord/
Validations.html#M000671

--
-- Tom M.
This topic is locked and can not be replied to.