Skip to content

Commit

Permalink
Fixing bug where single-selection custom multi select fields would in…
Browse files Browse the repository at this point in the history
…correctly be parsed
  • Loading branch information
iloveitaly committed Jul 15, 2021
1 parent 04105ca commit 3377c97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/netsuite/records/custom_field_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ def extract_custom_field(custom_field_data)
if type == "platformCore:SelectCustomFieldRef"
attrs[:value] = CustomRecordRef.new(custom_field_data[:value])
elsif type == 'platformCore:MultiSelectCustomFieldRef'
attrs[:value] = custom_field_data[:value].map do |entry|
# if there is only a single selection, `:value` will be hash not an array
attrs[:value] = if custom_field_data[:value].is_a?(Array)
custom_field_data[:value]
else
[custom_field_data[:value]]
end.map do |entry|
CustomRecordRef.new(entry)
end
end
Expand Down

0 comments on commit 3377c97

Please sign in to comment.