Say I have the following situation:
class Client < ActiveRecord::Base
class Order < ActiveRecord::Base
How can I validate that an order that is inputted at generation of a client
is valid? I have a form where you can create new clients and input a
comma-separated list of orders by name (named orders) .
I'm trying to put something like this in the validate method of the client
errors.add("Invalid order") unless orders.each(valid?)
How should I do that?