Closed szymonlipka closed 4 years ago
That's interesting because the model is showing 33: https://github.com/ruckus/quickbooks-ruby/blob/49f495bf77063648267bec89c61551b422d58afa/lib/quickbooks/model/item.rb#L13
If you try it outside of the batch does it give you a different result?
@drewish ok, I tried and it works when I don't use batch. I don't have to use batches so good enough for me, but I think the issue is still there and should be fixed for batches.
I was trying to overwrite this MINORVERSION variable to 41 but it still didn't work, so unfortunately solution isn't so simple.
Thanks for the update. Yeah, having the MINORVERSION
specified at the model is not the best solution. Or at least there should be a facility to default to that but allow the user to over-ride at query-time.
This should be doable by overriding each service url_for_query
or fetch_by_id
and reading it from the options
hash. I don't know if there could be a more general way to do it
Before now I had not fully looked at the minor version documentation:
It suggests you can apply a minorversion query param to all requests globally. That is, it doesn't need to be specified per request.
This would suggest we could do:
minorversion=X
query param at the base of all GET
requestsQuickbooks.platform_minor_version = 42
Thoughts?
Agree. I think one, configurable minor version for all would be really nice. In my opinion it's a bit misleading that there is possibility that gem in one endpoint uses different version than in other.
Ah yeah I realized what I'd been doing for this was setting the query param for the whole batch with the version:
options = { query: { requestid: SecureRandom.uuid, minorversion: 4 } }
connection.quickbooks.execute_with_retries(logger: logger) do
connection.quickbooks.service(:batch).make_request(request, options)
end
Having it as a client level could be nice. Is there every a reason to want to downgrade the version?
@drewish @szymonlipka I worked on this in a branch/PR: https://github.com/ruckus/quickbooks-ruby/pull/518
Basically you can set
Quickbooks.minorversion = X
as needed. The library defaults to the current highest number (47 as of now).
Anyone want to take a look?
Pushed gem version 1.0.9
with support for this global minorversion
Hey, I'm trying to create item with "Category" type and I'm getting error "Invalid Type : CATEGORY is supported only in minorVersion >= 4". I'm doing something like this:
I'm wondering if I'm doing something wrong or maybe type "Category" isn't really allowed for Items and the gem shouldn't allow it?