demarches-normaliennes/app/models/champ.rb
2016-06-09 14:18:28 +02:00

15 lines
347 B
Ruby

class Champ < ActiveRecord::Base
belongs_to :dossier
belongs_to :type_de_champ
delegate :libelle, :type_champ, :order_place, :mandatory, :description, to: :type_de_champ
def mandatory?
mandatory
end
def data_provide
return 'datepicker' if type_champ == 'datetime'
return 'typeahead' if type_champ == 'address'
end
end