def decode_json_if_json(value)
      is_json = (value.start_with?('{') && value.end_with?('}')) ||
        (value.start_with?('[') && value.end_with?(']'))
      return value unless is_json
      ActiveSupport::JSON.decode(value)
    rescue
      value
    end
def decode_json_if_json(value)
      is_json = (value.start_with?('{') && value.end_with?('}')) ||
        (value.start_with?('[') && value.end_with?(']'))
      return value unless is_json
      ActiveSupport::JSON.decode(value)
    rescue
      value
    end
This isn't ideal: how do we know whether each value in an hstore is JSON or a
 string/integer/etc?