Skip to content

Commit

Permalink
Remove dependence on Object#blank? monkey patch
Browse files Browse the repository at this point in the history
Nori patched `Object` to implement a `blank?` method, however it was
removed in v2.7 (February 2024), so uses within this gem were now
breaking without the method being implemented.

Nori commit:
savonrb/nori@780d01d

CI was passing for Ruby < 3, since Nori v2.7 requires Ruby 3, however
Ruby >= 3 was failing once it started using Nori v2.7.
  • Loading branch information
cgunther committed Mar 6, 2024
1 parent dd693a3 commit faa792a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
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

0 comments on commit faa792a

Please sign in to comment.