Commit Graph

853 Commits

Author SHA1 Message Date
Robin Daugherty
2a1d9346f6 Test to cover serialization_options 2014-10-12 19:25:38 -04:00
Robin Daugherty
341d552ae0 Make sure serialization_options is never nil 2014-10-12 13:08:45 -04:00
Robin Daugherty
f385ab05fb Make options param optional 2014-10-12 12:01:01 -04:00
Robin Daugherty
57f1c1b1f9 Fix serialization_options for array serialization 2014-10-12 02:29:50 -04:00
Robin Daugherty
d39a99d770 Add serialization_options
Prior to 0.9, @options was used to see the options passed to to_json. For some reason, with 0.9 the options were no longer passed and were entirely inaccessible within a Serializer.

This restores the access by placing it in an attribute named serializer_options.
2014-10-12 01:08:47 -04:00
Steve Klabnik
784eccd5bc Merge pull request #674 from tricknotes/support-rails4.2-for-ams0.9
Support Rails 4.2.0 with AMS 0.9
2014-10-09 12:38:57 -04:00
Ryunosuke SATO
447d96923f Support Rails 4.2.0 with AMS 0.9
This patch is the same fixes as #655 and #663 for 0-9-stable branch.
2014-10-10 00:53:56 +09: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
Gauthier Delacroix
226cbc4160 Unsuffixed association keys doc 2014-10-08 16:31:09 +02:00
Gauthier Delacroix
4ac07de799 Unsuffixed association keys tests 2014-10-08 16:20:49 +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
Steve Klabnik
e41eedd4dd Merge pull request #630 from sachse/readme-fix
README: Change :embed_key to :key
2014-09-25 19:41:50 -04:00
Steve Klabnik
c19a254154 Merge pull request #632 from gauthier-delacroix/Default_namespace_inheritance
Default namespace option
2014-09-25 19:41:33 -04:00
Steve Klabnik
21fe89e9bb Merge pull request #634 from craiglittle/fix-meta-documentation
Fix meta_key/meta documentation for v0.9.x series
2014-09-25 19:39:22 -04:00
Steve Klabnik
a84837280c Merge pull request #665 from andreychernih/fix-each-serializer-option
Make sure `render json: ..., each_serializer: ...` is working with Enumerables
2014-09-25 19:33:46 -04: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
40d53aaa16 Merge pull request #642 from AlexParamonov/patch-1
Add note for serialization usage outside of ActionController::Base
2014-09-20 17:46:46 -04:00
Steve Klabnik
ff01ba2ced Merge pull request #647 from gauthier-delacroix/Fix-embed_in_root_key-merging
Fix embed_in_root_key merging
2014-09-20 17:45:45 -04:00
Steve Klabnik
da81c97e59 Merge pull request #651 from gauthier-delacroix/Plural-default-root
Add plural_default_root config option
2014-09-20 17:44:58 -04:00
Gauthier Delacroix
efa22d9d44 Add plural_default_root config option 2014-09-12 18:56:51 +02:00
Steve Klabnik
40d6655c24 Merge pull request #645 from gauthier-delacroix/Fix-namespaced-serializers-reloading
Fix namespaced serializers reloading
2014-09-09 18:59:31 -04:00
Gauthier Delacroix
a862929f81 Fix embed_in_root_key merging 2014-09-09 11:27:08 +02:00
Gauthier Delacroix
e273fc5854 Fix namespaced serializers reloading 2014-09-08 13:59:50 +02:00
Alexander
1d95ad889e Add note for serialization usage outside of ActionController::Base
Applicable to rails-api gem.
2014-09-08 00:40:16 +03:00
Gauthier Delacroix
6f4f30cda6 Allow JSONAPI unsuffixed associations keys
As shown here :
https://github.com/json-api/json-api/blob/gh-pages/format/index.md#resource-relationships-
2014-09-05 18:46:08 +02:00
Craig Little
e9008439d3 Fix meta_key/meta documentation
This updates the documentation to reflect the behavior implemented by
the v0.9.x series. Note that this behavior differs from that of the
v0.8.x series, which is reflected by the current documentation.

Consideration should be given to patching the v0.9.x series to revert
back to the v0.8.x behavior since I'm not entirely sure if this slight
change was intentional, but for the time being, this at least documents
the existing behavior correctly.
2014-09-03 14:02:57 -07:00
Gauthier Delacroix
5ae536cd7b typo 2014-09-03 15:24:49 +02:00
Gauthier Delacroix
d00fb27e04 Changelog: Default serializer option 2014-09-03 15:02:06 +02:00
Gauthier Delacroix
adc3fc9742 Default serializer tests
Based on namespace serializer tests except namespace is set in
default_serializer_options
2014-09-03 14:58:22 +02:00
Gauthier Delacroix
4d3d234dda Fix default serializer option 2014-09-03 14:57:00 +02:00
Gauthier Delacroix
8514528db7 Allow default namespace inheritance 2014-09-03 12:41:30 +02:00
Kristoffer
5075436673 Change :embed_key to :key 2014-09-03 08:46:44 +02:00
Steve Klabnik
605408005f Merge pull request #628 from sachse/readme-fix
Readme typo fixes
2014-09-02 16:34:15 -04:00
Kristoffer
d6735749b3 Fix another symbol related typo 2014-09-02 22:29:22 +02:00
Kristoffer
4abcd3209e String to symbol 2014-09-02 22:23:58 +02: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
Theodore Konukhov
0292940ab4 typo 2014-08-29 19:51:32 +02:00
Theodore Konukhov
095bae31d4 fix for ruby 1.9. 2014-08-29 19:38:53 +02: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
e3bd56f73a changelog 2014-08-29 06:23:54 +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
Steve Klabnik
d5a993e193 Merge pull request #611 from gauthier-delacroix/Fix-0d31e72
Fix #0d31e72 regression
2014-08-26 11:41:03 -04:00
Steve Klabnik
a04ae2c2e2 Merge pull request #609 from polmiro/feature/support_polymorphic_associations_v2
Feature/support polymorphic associations v2
2014-08-26 11:38:16 -04:00
Gauthier Delacroix
5c4121432c Fix #0d31e72 regression
0d31e72d22
2014-08-26 17:17:42 +02:00