Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jhmoore
Copy link

@jhmoore jhmoore commented Jul 15, 2016

We've encountered a couple cases where a customer's Item query can come back with a string containing an actual % character in a percentage field, which is specified as a float type.

Passing a value of "18.0%" to Float() blows up with a (technically very correct) exception of ArgumentError: invalid value for Float(): "18.0%".

Using "18.0%".to_f instead simply stops parsing when it encounters a non-valid character, and returns 18.0.

Apparently QuickBooks can sometimes return an actual `%` in a percentage field (e.g. "18.0%").  While this is in no way a reasonable float value whatsoever, I guess we should probably not throw an exception when confronted by the capricious whimsies of Intuit data formats.
@jhmoore
Copy link
Author

jhmoore commented Jul 15, 2016

It may also be worth mentioning that at first I tried adding a response fixture to the xml files contained in /spec/support, but they appear to no longer be used (and the rspec tests using them appear to be no longer working).

@jhmoore
Copy link
Author

jhmoore commented Jul 15, 2016

Also the tests pass when run locally, but it looks like the Travis builds are failing when trying to bundle.

Gem::InstallError: activesupport requires Ruby version >= 2.2.2.

@bobby1190
Copy link

@JasonBarnabe JasonBarnabe merged commit f93d594 into qbwc:master Aug 16, 2016
@JasonBarnabe
Copy link
Contributor

This is causing build failures due to an unrelated issue (though one that was exposed by your changes). Looks like some time zone issue.

https://travis-ci.org/qbwc/qbxml/builds/152547688

@naomiajacobs
Copy link

@JasonBarnabe it looks like current master for this is green - do you know when this fix will be released as a new gem version? Thanks!

// cc@bobbby1190 @jhmoore

@naomiajacobs
Copy link

@JasonBarnabe any update on this?

// cc @bobby1190 @jhmoore

@JasonBarnabe
Copy link
Contributor

If you have used or tested the current master and it works, please comment in #22. I have not personally had a chance to test it yet.

@naomiajacobs
Copy link

naomiajacobs commented Dec 16, 2016

@JasonBarnabe we haven't used master since it hasn't been published yet (for various reasons we can't point to the sha, we need the published version). Per #22, will there be no release until you hear from people who have used it?

@JasonBarnabe
Copy link
Contributor

There will be no release until it's tested. Whether it's by me or someone else.

@naomiajacobs
Copy link

Hi @JasonBarnabe, checking in again to see if there are any plans to release the master version as part of the gem? Thanks!

@racerpeter
Copy link

@JasonBarnabe looks like we're going to fork qbxml to get this fix out for one of our customers. We'll let you know when its in production so that you can release it if desired.

@JasonBarnabe
Copy link
Contributor

Yes, I'd be happy to release once I hear it's working properly in the real world.

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

Successfully merging this pull request may close these issues.

5 participants