You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handling an apostrophe in a Customer name in Ruby 3.0.7
With Ruby 2.6, to find a customer such as O'shea, we had to gsub like this:
escaped_name = (family.qb_display_name || "").gsub("'", "\\\\'")
Having just upgraded to Ruby 3.0.7, I found that searching raised this error:
Error parsing query: QueryParserError: Encountered " "s "" at line 1, column 59. Was expecting one of: ... "iterator" ... "maxresults" ... ... "order" ... "orderby" ... "startposition" ...
To overcome the problem, I used
escaped_name = (family.qb_display_name || "").gsub("'", "\'")