discourse/plugins/automation/app/serializers/discourse_automation/field_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
300 B
Ruby
Raw Normal View History

# 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