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

undefined method `results_in_batches' #300

Open
obarth opened this issue Nov 18, 2016 · 1 comment
Open

undefined method `results_in_batches' #300

obarth opened this issue Nov 18, 2016 · 1 comment

Comments

@obarth
Copy link
Contributor

obarth commented Nov 18, 2016

If one defines the page_size of a result set smaller than 5 of gets the following error message:
NoMethodError: undefined method `results_in_batches' for false:FalseClass

Example:

search = NetSuite::Records::Location.search({
  preferences: {
    page_size: 14,       # <---------- you get the error if you put a number <5 here
  }
})
search.results_in_batches do |batch|
  @ids = batch.map(&:internal_id)
  ap @ids ;
end

Sometimes I get the same error also on page_sizes that are larger than the result set would be.
For example if I set the page_size to 50 but the result set only contains 20 entries. But the error does not show up every time. Only for number smaller 5 it fails every time.

@iloveitaly
Copy link
Member

@obarth good catch! Can you submit a PR to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants