2020-08-06 16:35:45 +02:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: champs
|
|
|
|
#
|
|
|
|
# id :integer not null, primary key
|
|
|
|
# private :boolean default(FALSE), not null
|
|
|
|
# row :integer
|
|
|
|
# type :string
|
|
|
|
# value :string
|
|
|
|
# created_at :datetime
|
|
|
|
# updated_at :datetime
|
|
|
|
# dossier_id :integer
|
|
|
|
# etablissement_id :integer
|
|
|
|
# parent_id :bigint
|
|
|
|
# type_de_champ_id :integer
|
|
|
|
#
|
2018-02-13 18:18:20 +01:00
|
|
|
class Champs::PaysChamp < Champs::TextChamp
|
2020-01-14 18:46:07 +01:00
|
|
|
PAYS = JSON.parse(Rails.root.join('app', 'lib', 'api_geo', 'pays.json').read, symbolize_names: true)
|
|
|
|
|
2018-06-15 14:37:43 +02:00
|
|
|
def self.pays
|
2020-01-14 18:46:07 +01:00
|
|
|
PAYS.pluck(:nom)
|
2018-06-15 14:37:43 +02:00
|
|
|
end
|
2019-04-29 22:55:10 +02:00
|
|
|
|
|
|
|
def self.disabled_options
|
2019-09-12 11:26:22 +02:00
|
|
|
pays.filter { |v| (v =~ /^--.*--$/).present? }
|
2019-04-29 22:55:10 +02:00
|
|
|
end
|
2018-02-13 18:18:20 +01:00
|
|
|
end
|