Add state to ProcedureSerializer
This commit is contained in:
parent
4ebc0b7f4c
commit
2e7a4a4098
2 changed files with 7 additions and 1 deletions
|
@ -10,7 +10,8 @@ class ProcedureSerializer < ActiveModel::Serializer
|
|||
:archived_at,
|
||||
:geographic_information,
|
||||
:total_dossier,
|
||||
:link
|
||||
:link,
|
||||
:state
|
||||
|
||||
has_one :geographic_information, serializer: ModuleApiCartoSerializer
|
||||
has_many :types_de_champ, serializer: TypeDeChampSerializer
|
||||
|
@ -26,4 +27,8 @@ class ProcedureSerializer < ActiveModel::Serializer
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def state
|
||||
object.aasm_state
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,6 +5,7 @@ describe ProcedureSerializer do
|
|||
|
||||
it {
|
||||
is_expected.to include(link: "http://localhost:3000/commencer/#{procedure.path}")
|
||||
is_expected.to include(state: "publiee")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue