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

Remove dependence on Object#blank? monkey patch #607

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/netsuite/actions/delete_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -105,4 +105,4 @@ def delete_list(options = { }, credentials={})
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/netsuite/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions spec/netsuite/actions/delete_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down