blob: 5220aa034a55180908e745fe2a53cd4891b1637e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# frozen_string_literal: true
class REST::PreferencesSerializer < ActiveModel::Serializer
attribute :posting_default_privacy, key: 'posting:default:visibility'
attribute :posting_default_sensitive, key: 'posting:default:sensitive'
attribute :posting_default_language, key: 'posting:default:language'
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
attribute :posting_default_manual_publish, key: 'posting:default:manual_publish'
def posting_default_privacy
object.user.setting_default_privacy
end
def posting_default_sensitive
object.user.setting_default_sensitive
end
def posting_default_language
object.user.setting_default_language.presence
end
def reading_default_sensitive_media
object.user.setting_display_media
end
def reading_default_sensitive_text
object.user.setting_expand_spoilers
end
def posting_default_manual_publish
object.user.setting_manual_publish
end
end
|