2015-11-03 15:27:49 +01:00
|
|
|
class Champ < ActiveRecord::Base
|
2015-11-03 10:48:40 +01:00
|
|
|
belongs_to :dossier
|
2015-11-05 11:21:44 +01:00
|
|
|
belongs_to :type_de_champ
|
2016-03-15 17:17:56 +01:00
|
|
|
|
2016-06-09 14:18:28 +02:00
|
|
|
delegate :libelle, :type_champ, :order_place, :mandatory, :description, to: :type_de_champ
|
2016-03-15 17:17:56 +01:00
|
|
|
|
|
|
|
def mandatory?
|
|
|
|
mandatory
|
|
|
|
end
|
2016-06-09 12:08:18 +02:00
|
|
|
|
|
|
|
def data_provide
|
|
|
|
return 'datepicker' if type_champ == 'datetime'
|
|
|
|
return 'typeahead' if type_champ == 'address'
|
|
|
|
end
|
2015-11-03 10:48:40 +01:00
|
|
|
end
|