demarches-normaliennes/app/models/drop_down_list.rb

9 lines
200 B
Ruby
Raw Normal View History

2018-03-06 13:44:29 +01:00
class DropDownList < ApplicationRecord
2016-08-09 16:21:39 +02:00
belongs_to :type_de_champ
def options
result = value.split(/[\r\n]|[\r]|[\n]|[\n\r]/).reject(&:empty?)
result.blank? ? [] : [''] + result
end
2016-08-09 16:21:39 +02:00
end