mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 08:04:32 +08:00
3d4faf3272
Automation (previously known as discourse-automation) is now a core plugin.
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
|