FineLinePrototyping/angularjs-rails-resource — pull request #81 by tuvistavie (2013-10-22 16:23:51+00:00)
Title: Fix mapped name behavior when using serializer default exclusion.

During serialization, when using `only` in combination with `nestedAttribute`, the behavior seems a little strange.

I would expect

```javascript
railsSerializer(function() {
this.nestedAttribute('foo');
this.only('foo');
});
```

to serialize `foo` as `foo_attributes`. However it does not get serialize. Neither it does when using `this.only('foo_attributes');` instead.
After looking a little around the source code, I found at that

```javascript
railsSerializer(function() {
this.nestedAttribute('foo');
this.only('foo', 'foo_attributes');
});
```

would give the wanted result. However, I do not think this is how we really want `only` to behave.

I fixed the serialization process so that when using default exclusion, if either the attribute name or the mapped name is accepted, the attribute get serialized. I also provided a basic unit test for the above case.
This should not change anything about the behavior when `only` is not used.