demarches-normaliennes/app/models/champs/pays_champ.rb

12 lines
281 B
Ruby
Raw Normal View History

2018-02-13 18:18:20 +01:00
class Champs::PaysChamp < Champs::TextChamp
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
PAYS.pluck(:nom)
2018-06-15 14:37:43 +02:00
end
def self.disabled_options
2019-09-12 11:26:22 +02:00
pays.filter { |v| (v =~ /^--.*--$/).present? }
end
2018-02-13 18:18:20 +01:00
end