mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-30 08:54:31 +08:00
16 lines
466 B
Ruby
16 lines
466 B
Ruby
# frozen_string_literal: true
|
|
|
|
class FormFieldValueSerializer < ActiveModel::Serializer
|
|
include Canaid::Helpers::PermissionsHelper
|
|
|
|
attributes :id, :form_field_id, :type, :value, :submitted_at, :submitted_by_full_name,
|
|
:unit, :not_applicable, :selection, :datetime, :datetime_to
|
|
|
|
def submitted_by_full_name
|
|
object.submitted_by.full_name
|
|
end
|
|
|
|
def submitted_at
|
|
I18n.l(object.submitted_at, format: :full) if object.submitted_at
|
|
end
|
|
end
|