How to validate composites?

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs