FineLinePrototyping/angularjs-rails-resource — pull request #134 by tuvistavie (2014-08-18 01:06:38+00:00)
Title: Fix edge case when unwrapping objects.

Hi, I got a little problem this with the unwrapping logic.
It is an edge case, but I think the behavior is a little broken here.

I had a `Comment` class, with a relation called `comments`,
representing the replies to the given comment.

The behavior was the following,

```coffee
class Comment extends RailsResource
@configure name: 'comment', url: '/comments'

foo = new Comment(id: 4, comments: [])
foo.id # undefined
```

which is not really what we want here.

I changed the unwrapping process to avoid using the plural name of the resource,
which will normally contain an array, when we are sure we want an object, like
in the constructor of a class.