Add type de champ repetition models (with row)
This commit is contained in:
parent
3977294613
commit
5d1c24f3d8
18 changed files with 132 additions and 19 deletions
|
@ -10,12 +10,13 @@ class Champ < ApplicationRecord
|
|||
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
|
||||
delegate :libelle, :type_champ, :order_place, :mandatory?, :description, :drop_down_list, :exclude_from_export?, :exclude_from_view?, to: :type_de_champ
|
||||
|
||||
scope :updated_since?, -> (date) { where('champs.updated_at > ?', date) }
|
||||
scope :public_only, -> { where(private: false) }
|
||||
scope :private_only, -> { where(private: true) }
|
||||
scope :ordered, -> { includes(:type_de_champ).order('types_de_champ.order_place') }
|
||||
scope :ordered, -> { includes(:type_de_champ).order(:row, 'types_de_champ.order_place') }
|
||||
scope :root, -> { where(parent_id: nil) }
|
||||
|
||||
def public?
|
||||
!private?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue