Fix includes on api queries
This commit is contained in:
parent
80189def98
commit
6706b9004f
3 changed files with 5 additions and 3 deletions
|
@ -5,6 +5,11 @@ class Champ < ApplicationRecord
|
|||
has_one_attached :piece_justificative_file
|
||||
has_one :virus_scan
|
||||
|
||||
# We declare champ specific relationships (Champs::CarteChamp and Champs::SiretChamp)
|
||||
# here because otherwise we can't easily use includes in our queries.
|
||||
has_many :geo_areas, dependent: :destroy
|
||||
belongs_to :etablissement, dependent: :destroy
|
||||
|
||||
delegate :libelle, :type_champ, :order_place, :mandatory?, :description, :drop_down_list, to: :type_de_champ
|
||||
|
||||
scope :updated_since?, -> (date) { where('champs.updated_at > ?', date) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue