def import_errors(name, model)
      return unless model.respond_to?(:validate)
      return if model.validate(validation_context)
      model.errors.each do |field, error|
        errors.add("#{name}[#{field}]", error)
      end
    end
def import_errors(name, model)
      return unless model.respond_to?(:validate)
      return if model.validate(validation_context)
      model.errors.each do |field, error|
        errors.add("#{name}[#{field}]", error)
      end
    end
Merge associated errors using the current validation context.