about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorSurinna Curtis <ekiru.0@gmail.com>2017-09-02 13:10:10 -0500
committerSurinna Curtis <ekiru.0@gmail.com>2017-09-13 21:47:30 -0500
commitaf2d793398343dbd171a093e521ec449aaa0579b (patch)
treec89edc9753022b5f1c003a43d598d8ee45634a41 /app/serializers
parent70592cdaba18f97bc4ba492445b1800033c58619 (diff)
Define a serializer for /api/v1/mutes/details
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/rest/mute_serializer.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/serializers/rest/mute_serializer.rb b/app/serializers/rest/mute_serializer.rb
new file mode 100644
index 000000000..043a2f059
--- /dev/null
+++ b/app/serializers/rest/mute_serializer.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class REST::MuteSerializer < ActiveModel::Serializer
+  include RoutingHelper
+  
+  attributes :id, :account, :target_account, :created_at, :hide_notifications
+
+  def account
+    REST::AccountSerializer.new(object.account)
+  end
+
+  def target_account
+    REST::AccountSerializer.new(object.target_account)
+  end
+end
\ No newline at end of file