Postgres bool issue

It was reported in freedomsponsors repository (https://github.com/freedomsponsors/www.freedomsponsors.org/pull/120). Postgres does not support bool/int comparison without explicit cast.

This pull request solve the issue. I didn't tested it with MySQL, but Travis will do it.