discourse/plugins/automation/app/serializers/discourse_automation/field_serializer.rb
Osama Sayegh 3d4faf3272
FEATURE: Merge discourse-automation (#26432)
Automation (previously known as discourse-automation) is now a core plugin.
2024-04-03 18:20:43 +03:00

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