diff --git a/HISTORY.md b/HISTORY.md index e689e70de..f603896f4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,7 @@ ### Fixed * Revert recent proxy changes which breaks proxy usage by @andrewdicken-stripe in https://github.com/NetSweet/netsuite/pull/579 +* Fix incompatibility with Nori v2.7+ after it removed `Object#blank?` monkey patch (#607) ### Breaking Changes diff --git a/lib/netsuite/actions/delete_list.rb b/lib/netsuite/actions/delete_list.rb index 2b42292be..1700966a6 100644 --- a/lib/netsuite/actions/delete_list.rb +++ b/lib/netsuite/actions/delete_list.rb @@ -53,7 +53,7 @@ def response_list end def success? - @success ||= response_errors.blank? + @success ||= (response_errors.nil? || response_errors.empty?) end def response_errors @@ -105,4 +105,4 @@ def delete_list(options = { }, credentials={}) end end end -end \ No newline at end of file +end diff --git a/lib/netsuite/configuration.rb b/lib/netsuite/configuration.rb index 011509bea..427ab1318 100644 --- a/lib/netsuite/configuration.rb +++ b/lib/netsuite/configuration.rb @@ -202,7 +202,7 @@ def soap_header(headers = nil) end def auth_header(credentials={}) - if !credentials[:consumer_key].blank? || !consumer_key.blank? + if !credentials[:consumer_key].to_s.empty? || !consumer_key.to_s.empty? token_auth(credentials) else user_auth(credentials) diff --git a/spec/netsuite/actions/delete_list_spec.rb b/spec/netsuite/actions/delete_list_spec.rb index 24a1d653a..7011b8f7e 100644 --- a/spec/netsuite/actions/delete_list_spec.rb +++ b/spec/netsuite/actions/delete_list_spec.rb @@ -76,6 +76,9 @@ it 'constructs error objects' do response = NetSuite::Actions::DeleteList.call([klass, :list => customer_list_with_error]) + + expect(response).to_not be_success + expect(response.errors.keys).to match_array(customer_with_error.internal_id) expect(response.errors[customer_with_error.internal_id].first.code).to eq('USER_EXCEPTION') expect(response.errors[customer_with_error.internal_id].first.message).to eq('Invalid record: type=event,id=100015,scompid=TSTDRV96')