2017-07-15 02:01:39 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base
|
|
|
|
def self.default_key_transform
|
|
|
|
:camel_lower
|
|
|
|
end
|
|
|
|
|
|
|
|
def serializable_hash(options = nil)
|
|
|
|
options = serialization_options(options)
|
2017-08-08 20:52:15 +01:00
|
|
|
serialized_hash = { '@context': ActivityPub::TagManager::CONTEXT }.merge(ActiveModelSerializers::Adapter::Attributes.new(serializer, instance_options).serializable_hash(options))
|
2017-07-15 02:01:39 +01:00
|
|
|
self.class.transform_key_casing!(serialized_hash, instance_options)
|
|
|
|
end
|
|
|
|
end
|