demarches-normaliennes/app/models/drop_down_list.rb
2020-06-25 13:14:17 +02:00

8 lines
200 B
Ruby

class DropDownList < ApplicationRecord
belongs_to :type_de_champ
def options
result = value.split(/[\r\n]|[\r]|[\n]|[\n\r]/).reject(&:empty?)
result.blank? ? [] : [''] + result
end
end