You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding a new File, the following error occurs:
NoMethodError: undefined method `[]' for #<Nori::StringIOFile:0x007fdea1cfac88>
from /Users/jordan/projects/netsuite/lib/netsuite/actions/add.rb:82:in `add'
from (irb):4
It appears the Nori to_hash method assumes type="file" is a data type and typecasts it to file object.
class Nori
class XmlUtilityNode
def initialize(options, name, attributes = {})
@options = options
@name = Nori.hash_key(name, options)
if converter = options[:convert_attributes_to]
intermediate = attributes.map {|k, v| converter.call(k, v) }.flatten
attributes = Hash[*intermediate]
end
# leave the type alone if we don't know what it is
@type = self.class.available_typecasts.include?(attributes["type"]) ? attributes.delete("type") : attributes["type"]
@nil_element = false
attributes.keys.each do |key|
if result = /^((.*):)?nil$/.match(key)
@nil_element = attributes.delete(key) == "true"
attributes.delete("xmlns:#{result[2]}") if result[1]
end
attributes.delete(key) if @options[:delete_namespace_attributes] && key[/^(xmlns|xsi)/]
end
@attributes = undasherize_keys(attributes)
@children = []
@text = false
# Treat NetSuite type file as a string
@type = "string" if @type == "file"
end
end
end
When adding a new File, the following error occurs:
It appears the Nori to_hash method assumes
type="file"
is a data type and typecasts it to file object.Response:
The text was updated successfully, but these errors were encountered: