demarches-normaliennes/app/serializers/dossiers_serializer.rb

21 lines
341 B
Ruby
Raw Normal View History

class DossiersSerializer < ActiveModel::Serializer
2018-11-06 18:46:17 +01:00
include DossierHelper
attributes :id,
2017-10-05 10:50:44 +02:00
:updated_at,
:initiated_at,
:state
def updated_at
object.updated_at&.in_time_zone('UTC')
end
def initiated_at
object.en_construction_at&.in_time_zone('UTC')
end
def state
2018-11-06 18:46:17 +01:00
dossier_legacy_state(object)
end
2017-04-04 15:27:04 +02:00
end