Improve serializers:

* Many nested levels of associations can now insert
  their information alongside the original when
  embed :ids, :include => true is true
* Add support for passing options to serializers
* Fix Array serializers so they don't try to insert
  roots for each child object and so they can be
  provided a root.
* TODO: Array serializers should require a root
* TODO: Make merging associations at the root more
  efficient if possible
This commit is contained in:
Yehuda Katz
2011-12-20 00:03:29 -08:00
parent 8bdb7da272
commit df9ad0ef11
5 changed files with 184 additions and 23 deletions

View File

@@ -38,7 +38,7 @@ module ActionController
def _render_option_json(json, options)
if json.respond_to?(:active_model_serializer) && (serializer = json.active_model_serializer)
json = serializer.new(json, serialization_scope)
json = serializer.new(json, serialization_scope, options)
end
super
end