Class: QueuedPostSerializer
Instance Method Summary
collapse
expire_cache_fragment!, fragment_cache
#include!
Constructor Details
Returns a new instance of QueuedPostSerializer.
21
22
23
24
|
# File 'app/serializers/queued_post_serializer.rb', line 21
def initialize(object, options = {})
Discourse.deprecate("QueuedPostSerializer is deprecated.", drop_from: "3.3.0")
super
end
|
Instance Method Details
#approved_by_id ⇒ Object
38
39
40
|
# File 'app/serializers/queued_post_serializer.rb', line 38
def approved_by_id
post_history.approved.last&.created_by_id
end
|
#can_delete_user ⇒ Object
54
55
56
|
# File 'app/serializers/queued_post_serializer.rb', line 54
def can_delete_user
true
end
|
#include_can_delete_user? ⇒ Boolean
58
59
60
|
# File 'app/serializers/queued_post_serializer.rb', line 58
def include_can_delete_user?
created_by && created_by.trust_level == TrustLevel[0]
end
|
#post_options ⇒ Object
50
51
52
|
# File 'app/serializers/queued_post_serializer.rb', line 50
def post_options
object.payload.except("raw")
end
|
#queue ⇒ Object
26
27
28
|
# File 'app/serializers/queued_post_serializer.rb', line 26
def queue
"default"
end
|
#raw ⇒ Object
46
47
48
|
# File 'app/serializers/queued_post_serializer.rb', line 46
def raw
object.payload["raw"]
end
|
#rejected_by_id ⇒ Object
42
43
44
|
# File 'app/serializers/queued_post_serializer.rb', line 42
def rejected_by_id
post_history.rejected.last&.created_by_id
end
|
#state ⇒ Object
34
35
36
|
# File 'app/serializers/queued_post_serializer.rb', line 34
def state
object.status + 1
end
|
#user_id ⇒ Object
30
31
32
|
# File 'app/serializers/queued_post_serializer.rb', line 30
def user_id
object.created_by_id
end
|