demarches-normaliennes/app/serializers/avis_serializer.rb

23 lines
378 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2019-05-02 16:24:24 +02:00
class AvisSerializer < ActiveModel::Serializer
attributes :answer,
2019-05-02 16:24:24 +02:00
:introduction,
2023-03-06 12:44:46 +01:00
:question_label,
:question_answer,
2019-05-02 16:24:24 +02:00
:created_at,
:answered_at
def email
object.expert.email
2019-05-02 16:24:24 +02:00
end
def created_at
object.created_at&.in_time_zone('UTC')
end
def answered_at
object.updated_at&.in_time_zone('UTC')
end
end