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

OR statements for handling the WHERE clause #235

Open
mabdullahkhalil opened this issue Sep 9, 2022 · 1 comment
Open

OR statements for handling the WHERE clause #235

mabdullahkhalil opened this issue Sep 9, 2022 · 1 comment
Assignees

Comments

@mabdullahkhalil
Copy link

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
Copy link

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

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

4 participants