6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/move-to-go/model_helpers.rb', line 6
def set_custom_value(integration_id, value)
@custom_values = [] if @custom_values == nil
if value.nil?
return
end
valueAsString = value.to_s
if valueAsString.length == 0
return
end
field = CustomFieldReference.new({:integration_id => integration_id})
custom_value = CustomValue.new
custom_value.value = valueAsString
custom_value.field = field
index = @custom_values.find_index do |custom_value|
custom_value.field.same_as?(field)
end
if index
@custom_values.delete_at index
end
@custom_values.push custom_value
return custom_value
end
|