XeroAPI / xero-ruby

Xero Ruby SDK for OAuth 2.0 generated from XeroAPI/Xero-OpenAPI
http://developer.xero.com/
MIT License
58 stars 91 forks source link

`OR` statements for handling the `WHERE` clause #235

Open mabdullahkhalil opened 2 years ago

mabdullahkhalil commented 2 years ago

where_opts.map { |key, value| parameterize_option(key, value) }.join(' AND ')

This needs to be refactor to incorporate OR statements for handling the WHERE clause

JohnMaguir commented 1 year ago

Until this is completed, anyone looking to use 'OR' statements in 'where' filters, you can pass a filter string directly to query_params example: Get contacts with first_name contains 'joe' OR email_address contains 'joe'

query_string = "FirstName!=null&&FirstName.Contains(\"joe\") OR EmailAddress!=null&&EmailAddress.Contains(\"joe\")"
query_params = { where: query_string }
xero_client.accounting_api.get_contacts(active_tenant_id, query_params: query_params).contacts