demarches-normaliennes/app/serializers/dossiers_serializer.rb

19 lines
310 B
Ruby
Raw Normal View History

class DossiersSerializer < ActiveModel::Serializer
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
object.old_state_value
end
2017-04-04 15:27:04 +02:00
end