XeroAPI/xero-ruby

`OR` statements for handling the `WHERE` clause

mabdullahkhalil opened this issue · 1 comments

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

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