app/helpers/record_helper.rb
# This is based on rails 6, deep_transform_values!
# This will remove quotes(") from values in the hash, as when converting to json, the value's can't have quotes in them.
This is based on rails 6, deep_transform_values.
This will remove quotes(") from values in the hash, as when converting to json, the value's can't have quotes in them.
This is based on rails 6 deep_transform_values . This will remove quotes ( " ) from values in the hash as when converting to json the value ' s can ' t have quotes in them .
def remove_quotes_from_all_values!(object)
    case object
    when Hash
      object.transform_values! { |value| remove_quotes_from_all_values!(value) }
    when Array
      object.map! { |e| remove_quotes_from_all_values!(e) }
    else
      remove_quotes_from_value(object)
    end
  end
def remove_quotes_from_all_values! ( object ) case object when Hash object . transform_values! { | value | remove_quotes_from_all_values! ( value ) } when Array object . map! { | e | remove_quotes_from_all_values! ( e ) } else remove_quotes_from_value ( object ) end end
This is based on rails 6, deep_transform_values!
This is based on rails 6 deep_transform_values!
object
<not_specific>