diff --git a/app/controllers/api/v1/procedures_controller.rb b/app/controllers/api/v1/procedures_controller.rb index 4bca4d565..8e2d8a1a5 100644 --- a/app/controllers/api/v1/procedures_controller.rb +++ b/app/controllers/api/v1/procedures_controller.rb @@ -2,7 +2,7 @@ class API::V1::ProceduresController < APIController before_action :fetch_procedure_and_check_token def show - render json: { procedure: ProcedureSerializer.new(@procedure.decorate).as_json } + render json: { procedure: ProcedureSerializer.new(@procedure).as_json } end private diff --git a/app/decorators/procedure_decorator.rb b/app/decorators/procedure_decorator.rb index c9b310fc0..6b1fc43c3 100644 --- a/app/decorators/procedure_decorator.rb +++ b/app/decorators/procedure_decorator.rb @@ -22,8 +22,4 @@ class ProcedureDecorator < Draper::Decorator end end end - - def geographic_information - module_api_carto - end end diff --git a/app/serializers/procedure_serializer.rb b/app/serializers/procedure_serializer.rb index 263874369..6982cfd84 100644 --- a/app/serializers/procedure_serializer.rb +++ b/app/serializers/procedure_serializer.rb @@ -31,4 +31,8 @@ class ProcedureSerializer < ActiveModel::Serializer def state object.aasm_state end + + def geographic_information + object.module_api_carto + end end diff --git a/spec/decorators/procedure_decorator_spec.rb b/spec/decorators/procedure_decorator_spec.rb index c6bef231d..8fba48bba 100644 --- a/spec/decorators/procedure_decorator_spec.rb +++ b/spec/decorators/procedure_decorator_spec.rb @@ -26,11 +26,4 @@ describe ProcedureDecorator do subject { super().logo_img } it { is_expected.to match(/http.*#{ActionController::Base.helpers.image_url("marianne.svg")}/) } end - - describe 'geographic_information' do - subject { super().geographic_information } - it { expect(subject.use_api_carto).to be_falsey } - it { expect(subject.quartiers_prioritaires).to be_falsey } - it { expect(subject.cadastre).to be_falsey } - end end