active_model_serializers/test
Jo Liss ee3cec3d0c When objects are sideloaded multiple times, serialize them only once
To achieve this, we make the following change when sideloading: Instead
of serializing associations and discarding duplicate *hashes*, we
memorize the *objects* (records) that we have already serialized, and
only serialize those that are new.

This change is mostly transparent, and brings down serialization time
from 3.1 seconds to 1.0 seconds on my set of sample data.

There is one change in the behavior: If you sideload the same object
multiple times, and it yields different hashes, like so:

    embed :ids, include: true
    has_many :comments
    has_many :recent_comments, root: comments, serializer: CommentShortSerializer

then previously, it would be included multiple times, whereas now, the
first hash wins. (I haven't actually tested this.) I don't know that
either option is preferable. It's not covered by the test suite, and I
think it's an edge case that is OK to ignore entirely.
2012-10-29 23:15:32 +01:00
..
association_test.rb When objects are sideloaded multiple times, serialize them only once 2012-10-29 23:15:32 +01:00
generators_test.rb Fix the tests 2012-06-05 10:18:05 +02:00
no_serialization_scope_test.rb Allows serialization_scope to be disabled with serialization_scope nil 2012-06-05 12:37:09 -04:00
serialization_test.rb Fix assertion for Ruby 1.8.7 2012-09-21 16:57:51 +02:00
serializer_support_test.rb Revert "clean up lazy loading of serialization support for 2012-10-17 19:28:02 +02:00
serializer_test.rb When objects are sideloaded multiple times, serialize them only once 2012-10-29 23:15:32 +01:00
test_helper.rb match method should not be used for routes; instead, a specific HTTP method should be used 2012-09-20 21:17:07 -04:00