Enable add descriptions to cadastres

This commit is contained in:
Paul Chavard 2021-05-25 16:10:01 +02:00
parent daa20b0b6d
commit dfc46a8736
4 changed files with 26 additions and 26 deletions

View file

@ -25,7 +25,7 @@ class Champ < ApplicationRecord
# We declare champ specific relationships (Champs::CarteChamp, Champs::SiretChamp and Champs::RepetitionChamp)
# here because otherwise we can't easily use includes in our queries.
has_many :geo_areas, dependent: :destroy
has_many :geo_areas, -> { order(:created_at) }, dependent: :destroy, inverse_of: :champ
belongs_to :etablissement, optional: true, dependent: :destroy
has_many :champs, -> { ordered }, foreign_key: :parent_id, inverse_of: :parent, dependent: :destroy