validates_associated (ActiveRecord::Validations::ClassMethods)

    # File lib/active_record/validations.rb, line 970
          def validates_associated(*attr_names)
            configuration = { :on => :save }
            configuration.update(attr_names.extract_options!)

            validates_each(attr_names, configuration) do |record, attr_name, value|
              unless (value.is_a?(Array) ? value : [value]).collect { |r| r.nil? || r.valid? }.all?
                record.errors.add(attr_name, :invalid, :default => configuration[:message], :value => value)
              end
            end
          end