add module api carto in api procedure

This commit is contained in:
Tanguy PATTE 2016-01-12 15:11:42 +01:00
parent 3ea381413f
commit c04627431c
4 changed files with 29 additions and 6 deletions

View file

@ -9,4 +9,7 @@ class ProcedureDecorator < Draper::Decorator
return 'logo-tps.png' if logo.blank?
logo
end
def geographic_information
module_api_carto
end
end

View file

@ -0,0 +1,7 @@
class ModuleApiCartoSerializer < ActiveModel::Serializer
attributes :use_api_carto,
:quartiers_prioritaires,
:cadastre
end

View file

@ -1,11 +1,16 @@
class ProcedureSerializer < ActiveModel::Serializer
attribute :libelle, key: :label
attribute :lien_demarche, key: :link
attributes :id,
:libelle,
:description,
:organisation,
:direction,
:lien_demarche,
:archived
:archived,
:geographic_information
has_one :geographic_information, serializer: ModuleApiCartoSerializer
has_many :types_de_champ, serializer: TypeDeChampSerializer
has_many :types_de_piece_justificative, serializer: TypeDePieceJustificativeSerializer
end