about summary refs log tree commit diff
path: root/app/serializers/rest/encrypted_message_serializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/rest/encrypted_message_serializer.rb')
-rw-r--r--app/serializers/rest/encrypted_message_serializer.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/serializers/rest/encrypted_message_serializer.rb b/app/serializers/rest/encrypted_message_serializer.rb
new file mode 100644
index 000000000..61ebc74fa
--- /dev/null
+++ b/app/serializers/rest/encrypted_message_serializer.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class REST::EncryptedMessageSerializer < ActiveModel::Serializer
+  attributes :id, :account_id, :device_id,
+             :type, :body, :digest, :message_franking
+
+  def id
+    object.id.to_s
+  end
+
+  def account_id
+    object.from_account_id.to_s
+  end
+
+  def device_id
+    object.from_device_id
+  end
+end