Commit Graph

37 Commits

Author SHA1 Message Date
Nate Berkopec
577db35824 Revert "Make sure render json: ..., each_serializer: ... is working with Enumerables"
This reverts commit 90343cea4d.
2015-01-13 17:12:02 -05:00
Kevin Bullaughey
34d684ee9a added failing spec to show how both symbol and string keys are causing problems 2014-10-22 10:31:18 -04:00
Steve Klabnik
5acd98e61b Merge pull request #639 from gauthier-delacroix/Unsuffixed-default-associations-keys
Allow JSONAPI unsuffixed associations keys
2014-10-08 14:45:46 -04:00
Gauthier Delacroix
a39d08d2ad Cleaner unsuffixed association keys tests 2014-10-08 16:51:44 +02:00
Steve Klabnik
06e3bb77f2 Merge pull request #662 from jastkand/remove-question-sign
Add auto-stripping of question mark for attributes
2014-09-26 10:35:43 -04:00
Andrey Krivko
bded293529 Add auto-stripping of question mark for attributes 2014-09-26 15:42:41 +07:00
Andrey Chernih
90343cea4d Make sure render json: ..., each_serializer: ... is working with Enumerables
If you try to render Enumerable with custom `each_serializer` then it will render with default serializer instead:

```ruby
render json: sequel_scope, each_serializer: CustomSerializer
```

This commit fixes this behaviour. Most likely fixes https://github.com/rails-api/active_model_serializers/issues/664 as well
2014-09-25 16:59:47 +04:00
Steve Klabnik
922dd273c9 Merge pull request #620 from tristandunn/td-notifications
Avoid overwriting notifications for template assertions.
2014-08-31 20:02:08 -04:00
Steve Klabnik
d40f0d67b9 Merge pull request #617 from konukhov/namespaced_serializers-0-9
Namespaced serializers #499
2014-08-31 20:00:47 -04:00
Steve Klabnik
f7f5e29358 Merge pull request #601 from radanskoric/fix-nested-embed-in-root
Fix for nested embed_in_root when serializer used as part of an association
2014-08-31 19:57:27 -04:00
Tristan Dunn
610aeb2e92 Avoid overwriting notifications for template assertions. 2014-08-29 08:18:44 -05:00
Theodore Konukhov
493041fdff sync with upstream 2014-08-29 06:28:13 +02:00
Theodore Konukhov
b297f17e53 test for namespaced associations + bug fixed 2014-08-29 06:11:40 +02:00
Theodore Konukhov
dde1492934 tests for namespaced controlleler 2014-08-26 18:07:31 +02:00
Pol Miro
bb18fc6225 Add tests for has_one polymorphic 2014-08-25 23:32:09 -07:00
Pol Miro
63589f7500 Add tests for has_many polymorphic 2014-08-25 23:32:09 -07:00
Radan Skoric
ddfd8d2c11 embed_in_root works even if serializer is invoked through another serializers' association which itself does not have embed_in_root set 2014-08-23 18:21:24 +02:00
Kyle Fritz
76c8de7b9f root key format 2014-04-14 13:45:12 -04:00
Kyle Fritz
00c54baae3 Support lowerCamel key format 2014-03-30 12:31:21 -04:00
Santiago Pastorino
ed9a5288f9 Revert "Merge branch 'context'"
This reverts commit 1bd8180a94, reversing
changes made to 9bb32331f4.
2014-01-07 15:02:09 -02:00
Adrian Mugnolo and Santiago Pastorino
0d8ef2b165 Nest scope under context option 2014-01-06 15:50:30 -02:00
Santiago Pastorino
60fc55021c Revert "Allow to pass options to associations"
This reverts commit c8cfe94f29.
2014-01-03 19:44:40 -02:00
Santiago Pastorino
c8cfe94f29 Allow to pass options to associations
Closes #331
2014-01-02 19:56:08 -02:00
Santiago Pastorino
67c550f2ee Serialize embedding in root deeply nested associations
Closes #444
2014-01-02 18:34:11 -02:00
Adrian Mugnolo and Santiago Pastorino
e2b7bba626 Stub out comments writer when needed 2013-12-16 17:10:20 -02:00
Arne Brasseur
1db96ec7a9 When using embed: :ids ; embed_in_root: true, and serializing multiple objects,
only the associated objects of the last object in the collection will actually
show up in the serialized data.

For example, if you serialize a collection of two posts, each containing one or
more comments, only the comments of the last post show up. The reason is a
Hash#merge wich overwrites the array rather than appending to it.

This commit fixes this by merging the collection arrays, rather than the top-level
hashes.
2013-11-11 14:30:34 +01:00
Santiago Pastorino
06e4c2c9d6 Test attributes declared as strings
Thanks @mikegee

Closes #380
2013-10-22 11:55:32 -02:00
Arthur Neves
cf8b55ea01 Setting join_table on AR tests 2013-10-18 17:49:22 -02:00
Santiago Pastorino
b9a6dfac2f Do not call send on associated objects, do it through elem.read_attribute_for_serialization 2013-10-18 17:49:21 -02:00
Santiago Pastorino
94a83c1cc0 Make relationship graph of AR integration tests bigger 2013-10-18 17:49:21 -02:00
Santiago Pastorino
61a1669a86 Implement has_many 2013-10-18 17:49:18 -02:00
Santiago Pastorino
fa61314d0e Add AR integration tests 2013-10-18 17:49:18 -02:00
Santiago Pastorino
4c7599cfff Use more meaningful model names for tests 2013-10-18 17:49:18 -02:00
Santiago Pastorino
d756ae4a70 Implement has_one's and serialize_ids 2013-10-18 17:49:17 -02:00
Santiago Pastorino
01bc534976 Remove SerializerSupport 2013-10-18 17:49:17 -02:00
Santiago Pastorino
0c91564101 Remove method redefined warning 2013-10-18 17:49:17 -02:00
Santiago Pastorino
af357619c1 Add AMS support to AR objects 2013-10-18 17:49:17 -02:00