- 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
18 lines
554 B
Ruby
18 lines
554 B
Ruby
# frozen_string_literal: true
|
|
|
|
# This is an ActiveModel::Serializer based class which uses DiasporaFederation::Entity JSON serialization
|
|
# features in order to serialize local DB objects. To determine a type of entity class to use the same routines
|
|
# are used as for federation messages generation.
|
|
class FederationEntitySerializer < ActiveModel::Serializer
|
|
include SerializerPostProcessing
|
|
|
|
private
|
|
|
|
def modify_serializable_object(hash)
|
|
hash.merge(entity.to_json)
|
|
end
|
|
|
|
def entity
|
|
Diaspora::Federation::Entities.build(object)
|
|
end
|
|
end
|