technoweenie/faraday — pull request #97 by russ (2011-12-15 01:39:08+00:00)
Title: Recursively check for files in has_multipart?

has_multipart? does not dig into inner hashes to check for files.

When I'm trying to upload a file that is nested in a format that Rails supports, the file comes through as a string object. has_multipart? returns false

Here is an example of how the data came through to Rails.

{"package"=>{"name"=>"newplugin", "summary"=>"A short summary.", "description"=>"A longer description.", "versions_attributes"=>[{"number"=>"0.0.1", "authors"=>"Who wrote this?", "website"=>"URL for this plugin.", "documentation"=>"URL for the documentation.", "packaged_file"=>"#"}]}

I'm not sure if the code that I've attached is the right way to go about it, but it is working on my end.