Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid mutating options passed to us since this makes nesting calls within NetSuite::Utilities.backoff very confusing #613

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/netsuite/actions/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Search < AbstractAction

def initialize(klass, options = { })
@klass = klass
@options = options
@options = options.dup
end

def class_name
Expand Down Expand Up @@ -42,7 +42,7 @@ def request_body

# columns is only needed for advanced search results
columns = @options[:columns] || {}
criteria = @options[:criteria] || @options
criteria = @options[:criteria].dup || @options

# TODO find cleaner solution for pulling the namespace of the record, which is a instance method
namespace = if @klass.respond_to?(:search_class_namespace)
Expand Down Expand Up @@ -114,6 +114,7 @@ def request_body

# https://github.com/NetSweet/netsuite/commit/54d7b011d9485dad33504135dfe8153c86cae9a0#commitcomment-8443976
if NetSuite::Configuration.api_version < "2013_2"
h[element_name][:attributes!]['platformCore:customField'] = h[element_name][:attributes!]['platformCore:customField'].dup
h[element_name][:attributes!]['platformCore:customField']['internalId'] = h[element_name][:attributes!]['platformCore:customField'].delete('scriptId')
end

Expand Down
Loading