Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Boolean must be compared to true or false #58

Open
eygraber opened this issue Aug 26, 2015 · 3 comments
Open

Boolean must be compared to true or false #58

eygraber opened this issue Aug 26, 2015 · 3 comments

Comments

@eygraber
Copy link

If I have a rule that says:

!next.some_boolean

blaze outputs:

!newData.child('some_boolean').val()

but when I try to add that to my forge's rules I get an error saying:

! only operates on booleans.
@mckoss
Copy link

mckoss commented Aug 26, 2015

I think the issue is that .val() can return any type - not just known boolean values. As a work around, you could write:

next.some_boolean != true

which would translate to:

newData.child('some_boolean').val() != true

@eygraber
Copy link
Author

I've been using :

next.some_boolean == true

and :

next.some_boolean == false

but it seems a bit clunky

@mckoss
Copy link

mckoss commented Aug 26, 2015

Agreed. It's a bug...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants