demarches-normaliennes/app/serializers/dossiers_serializer.rb

23 lines
363 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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.depose_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