demarches-normaliennes/app/serializers/commentaire_serializer.rb
2018-10-31 11:43:48 +01:00

14 lines
234 B
Ruby

class CommentaireSerializer < ActiveModel::Serializer
attributes :email,
:body,
:created_at,
:attachment
def created_at
object.created_at&.in_time_zone('UTC')
end
def attachment
object.file_url
end
end