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

Filter where boolean values #87

Closed
kenjiqq opened this issue Jul 2, 2014 · 3 comments
Closed

Filter where boolean values #87

kenjiqq opened this issue Jul 2, 2014 · 3 comments
Assignees

Comments

@kenjiqq
Copy link

kenjiqq commented Jul 2, 2014

Noticed an inconsistency issue with the default filter method. If you want to filter by a field that is a boolean value this does not work where it does work for numbers and strings:

DS.filter('resource', {
  where: {
    field: false
  }
});

but this do work:

DS.filter('resource', {
  where: {
    field: {
      '===': false
    }
  }
});
@jmdobry
Copy link
Member

jmdobry commented Jul 2, 2014

Does it work for 0 and empty strings?
On Jul 2, 2014 5:54 AM, "Ken Viktil" notifications@github.com wrote:

Noticed an inconsistency issue with the default filter method. If you want
to filter by a field that is a boolean value this does not work where it
does work for numbers and strings:

DS.filter('resource', {
where: {
field: false
}
});

but this do work:

DS.filter('resource', {
where: {
field: {
'===': false
}
}
});


Reply to this email directly or view it on GitHub
#87.

@jmdobry jmdobry added 3 - Done and removed 3 - Done labels Jul 2, 2014
@jmdobry jmdobry self-assigned this Jul 2, 2014
@kenjiqq
Copy link
Author

kenjiqq commented Jul 2, 2014

I'm not sure, i will have to check that at work tomorrow

@jmdobry jmdobry closed this as completed in acffdef Jul 2, 2014
@kenjiqq
Copy link
Author

kenjiqq commented Jul 3, 2014

It looks like it works just for for 0 and empty strings. As in it returns all elements that has the field with the value of an empty string or 0

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

No branches or pull requests

2 participants