From 971a08c92a3fdb7b5c38f33aa2e6d04a2e994645 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 31 Oct 2018 13:28:39 +0100 Subject: [PATCH] Add expose legacy carto api flag --- app/models/dossier.rb | 4 ++++ app/models/procedure.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index f6efdcdbf..fa3d11d7d 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -249,6 +249,10 @@ class Dossier < ApplicationRecord procedure.use_legacy_carto? end + def expose_legacy_carto_api? + procedure.expose_legacy_carto_api? + end + def user_geometry if json_latlngs.present? UserGeometry.new(json_latlngs) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 75f69af7b..2ad171a4c 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -135,6 +135,10 @@ class Procedure < ApplicationRecord module_api_carto.use_api_carto? && !module_api_carto.migrated? end + def expose_legacy_carto_api? + module_api_carto.use_api_carto? && module_api_carto.migrated? + end + # Warning: dossier after_save build_default_champs must be removed # to save a dossier created from this method def new_dossier