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.
37c332966b49eeb1d54eeefd3bc5ce97?d=identicon&s=25 David Corbin (Guest)
on 2006-02-20 00: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
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-02-20 00:24
(Received via mailing list)
In a custom validate method.

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

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