diaspora/app/serializers/flat_map_array_serializer.rb
cmrd Senya c6ed850a85
Memory usage optimization for archive export
- Removed posts and non contacts from other's data
- Collections are exported in batches to lower memory footprint
- In base exporters create User object instead of keeping instance because it caches all associations

closes #7627
2017-09-26 04:07:18 +02:00

11 lines
297 B
Ruby

# frozen_string_literal: true
class FlatMapArraySerializer < ActiveModel::ArraySerializer
def serializable_object(options={})
@object.flat_map do |subarray|
subarray.map do |item|
serializer_for(item).serializable_object_with_notification(options)
end
end
end
end