Skip to content

Cannot patch boolean to false when using postgresql #56

@nohponex

Description

@nohponex
{
      "data": {
      	"id": "42",
        "type": "article",
        "attributes": {
          "useful": false
        }
      }
    }

Using bypass

     /**
     * Override patch, to "hack" boolean behaviour
     * @param mixed  $id
     * @param object $attributes
     * @return int
     */
    public static function patch($id, $attributes)
    {
        if (isset($attributes['useful']) && $attributes['useful'] === false) {
            $attributes['useful'] = 0;
        }

        return parent::patch($id, $attributes);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions