mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 04:31:56 +08:00
b58867b6e9
Includes support for flags, reviewable users and queued posts, with REST API backwards compatibility. Co-Authored-By: romanrizzi <romanalejandro@gmail.com> Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
41 lines
674 B
Ruby
41 lines
674 B
Ruby
class ReviewablePerformResultSerializer < ApplicationSerializer
|
|
|
|
attributes(
|
|
:success,
|
|
:transition_to,
|
|
:transition_to_id,
|
|
:created_post_id,
|
|
:created_post_topic_id,
|
|
:remove_reviewable_ids,
|
|
:version
|
|
)
|
|
|
|
def success
|
|
object.success?
|
|
end
|
|
|
|
def transition_to_id
|
|
Reviewable.statuses[transition_to]
|
|
end
|
|
|
|
def version
|
|
object.reviewable.version
|
|
end
|
|
|
|
def created_post_id
|
|
object.created_post.id
|
|
end
|
|
|
|
def include_created_post_id?
|
|
object.created_post.present?
|
|
end
|
|
|
|
def created_post_topic_id
|
|
object.created_post_topic.id
|
|
end
|
|
|
|
def include_created_post_topic_id?
|
|
object.created_post_topic.present?
|
|
end
|
|
end
|