backlogs/redmine_backlogs — pull request #924 by awilkins (2013-05-24 14:49:43+00:00)
Title: Fix the problem with the JSON API when returning a single issue

I ran into this

http://forum.redminebacklogs.net/NoMethodError-when-trying-to-get-issues-in-JSON-format-td4025760.html

(I'm not this person)

This is caused by calls to the API that only return a single issue. It works fine for XML because it uses the //issue selector, but JSON has no such thing - when a single issue is returned, it's the top level container, and not a list, so it has no each method.

This patch conditionally wraps such single issue returns in an array so they can be iterated over.