ruckus / quickbooks-ruby

Quickbooks Online REST API V3 - Ruby
MIT License
374 stars 302 forks source link

gsub/NoMethodError Issue with queries using numbers #520

Closed jethrodaniel closed 4 years ago

jethrodaniel commented 4 years ago

If you pass a number to the query builder, you'll get a no method error.

For example, this code will blow up with a NoMethodError.

util = Quickbooks::Util::QueryBuilder.new
clause = util.clause('Id', '=', 4)

https://github.com/ruckus/quickbooks-ruby/blob/654effc06366dcb07e2a142cff3303b7a6e06912/lib/quickbooks/util/query_builder.rb#L12-L25

We should be calling #to_s here to ensure the gsub doesn't fail.

ruckus commented 4 years ago

Good call. Thanks for the heads up

jethrodaniel commented 4 years ago

adding a pr and test, one sec