Add RPG carte source

This commit is contained in:
Paul Chavard 2018-10-23 15:38:20 +02:00
parent 7ffbe417f9
commit 5a8a4b393f
12 changed files with 71 additions and 5 deletions

View file

@ -13,14 +13,20 @@ class GeoArea < ApplicationRecord
:code_arr,
:code,
:nom,
:commune
:commune,
:culture,
:code_culture,
:surface,
:bio
]
enum source: {
quartier_prioritaire: 'quartier_prioritaire',
cadastre: 'cadastre'
cadastre: 'cadastre',
parcelle_agricole: 'parcelle_agricole'
}
scope :quartiers_prioritaires, -> { where(source: sources.fetch(:quartier_prioritaire)) }
scope :cadastres, -> { where(source: sources.fetch(:cadastre)) }
scope :parcelles_agricoles, -> { where(source: sources.fetch(:parcelle_agricole)) }
end