Forum: Ruby on Rails how to validate composites ?

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.
Rick S. (Guest)
on 2007-03-02 20:08
(Received via mailing list)
Let's take the example from AWDWR where a Customer object is compose_of
a Name object.

And let's say that the lastname and firstname can not be null.

How would I use validates_presence_of ?

Would it be something like:

class Customer
  composed of :name, ...
  validates_presence_of name.lastname, name.firstname
end
This topic is locked and can not be replied to.