mirror of
https://github.com/discourse/discourse.git
synced 2024-12-27 09:43:52 +08:00
16 lines
300 B
Ruby
16 lines
300 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module DiscourseAutomation
|
||
|
class FieldSerializer < ApplicationSerializer
|
||
|
attributes :id, :component, :name, :metadata, :is_required
|
||
|
|
||
|
def metadata
|
||
|
object.metadata || {}
|
||
|
end
|
||
|
|
||
|
def is_required
|
||
|
object.template&.dig(:required)
|
||
|
end
|
||
|
end
|
||
|
end
|