A validate_associated plugin has been added, for validating associated
objects when validating the current object. This was extracted from the
nested_attributes plugin, and is also used by the delay_add_association
plugin. For example, if you have an albums association and you want to
validate all associated objects before saving the current object, you can
cal validate_associated_object for each object:
def validate
super
reflection = association_reflection(:albums)
associations[:albums].each do |obj|
validate_associated_object(reflection, obj)
end
end