lib/netsuite/support/records.rb in netsuite-0.0.50 vs lib/netsuite/support/records.rb in netsuite-0.1.0

- old
+ new

@@ -8,14 +8,16 @@ attributes.reject { |k,v| self.class.read_only_fields.include?(k) }.inject({}) do |hash, (k,v)| kname = "#{record_namespace}:" kname += k == :klass ? 'class' : k.to_s.lower_camelcase to_attributes!(hash, kname, v) + if Array === v v = v.map { |i| i.respond_to?(:to_record) ? i.to_record : i } - else - v = v.to_record if v.respond_to?(:to_record) + elsif v.respond_to?(:to_record) + v = v.to_record end + hash[kname] = v hash end end