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

15 lines
333 B
Ruby

class Champ < ActiveRecord::Base
belongs_to :dossier
belongs_to :type_de_champ
delegate :libelle, :type_champ, :order_place, :mandatory, 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