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
Number of units is an array of floats: [0.0, 0.0, 0.0, 0.0, 4.0, 0.0, 0.0]
eval error: undefined method `to_hash' for 4.0:Float
def_to_hash(value,downcase: false)ifvalue.is_a?(Array)value.mapdo |v|
v.to_hash(downcase: downcase)# <- the problematic part, because it doesn't check if the value responds to to_hashendelsifvalue.is_a?(Hash){}.tapdo |hash|
value.map{ |k,v| hash[k]=_to_hash(v,downcase: downcase)}endelsifvalue.respond_to?:to_hashvalue.to_hash(downcase: downcase)elsevalueendend
The text was updated successfully, but these errors were encountered:
When calling
to_hash
on a timesheet returned from Xero API, it fails because it attempts to call to_hash on a float.For examlpe, timesheet lines look like this.
Number of units is an array of floats:
[0.0, 0.0, 0.0, 0.0, 4.0, 0.0, 0.0]
The text was updated successfully, but these errors were encountered: