rikas / zoho_hub

Zoho CRM API V2 Wrapper
MIT License
25 stars 30 forks source link

Make a recursive call to get all records. #37

Closed tsukaby closed 11 months ago

tsukaby commented 4 years ago

If the recursive argument is set to true, all records can be retrieved.

[tsukaby@tsukamac zoho_hub]% bin/console
Refreshing token...
[1] pry(main)> class Contact < ZohoHub::BaseRecord;attributes(:id, :email);end
=> [:id, :email]
[2] pry(main)> Contact.all.count
=> 200
[3] pry(main)> Contact.all(recursive: true).count
=> 502
[4] pry(main)> Contact.where(params: {criteria: 'Email:starts_with:user'}).count
=> 200
[5] pry(main)> Contact.where(params: {criteria: 'Email:starts_with:user'}, recursive: true).count
=> 502

I am not a native English speaker. If the English text is strange, it would be helpful if you taught me the correct text.