Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot patch boolean to false when using postgresql #56

Open
nohponex opened this issue Nov 11, 2016 · 0 comments
Open

Cannot patch boolean to false when using postgresql #56

nohponex opened this issue Nov 11, 2016 · 0 comments

Comments

@nohponex
Copy link
Member

{
      "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);
    }
@nohponex nohponex added this to the Release 1.x (INVALID) milestone Nov 11, 2016
@nohponex nohponex added the bug label Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant