Fix SQL condition to work on PostgreSQL
Fix SQL condition to work on PostgreSQL

Conditions like this:

  ["(permissions & ?)", CAN_REVIEW]

resulted in the following error on PostgreSQL:

  argument of AND must be type boolean, not type integer

MySQL is forgiving and interprets the expression as a boolean, but we
have to be explicit for PostgreSQL. We do this with "!= 0", which
makes the result a boolean.

balcom/gitorious,vymiheev/Gitorious-OpenStack,spencerwp/mainline,tigefa4u/gitorious-mainline,grjones/gitorious-submodule-dependencies,vymiheev/Gitorious-OpenStack,SamuelMoraesF/Gitorious,gitorious/mainline,spencerwp/mainline,cynipe/gitorious,victori/gitorious-jruby,rae/gitorious-mainline,altrair/gitorious-openstack,feniix/gitorious,njall/wel-gitorious,Gitorious-backup/yousource,Gitorious-backup/mainline,feniix/gitorious,Gitorious-backup/mainline,adg29/asi.gitorious,njall/wel-gitorious,tigefa4u/gitorious-mainline,adg29/asi.gitorious,Gitorious-backup/yousource,elcom/gitorious,ericbutters/eric-gitorious,cynipe/gitorious,SamuelMoraesF/Gitorious,victori/gitorious-jruby,deld/gitorious,deld/gitorious,grjones/gitorious-submodule-dependencies,tigefa4u/gitorious-mainline,rae/gitorious-mainline,ericbutters/eric-gitorious,vymiheev/Gitorious-OpenStack,ericbutters/eric-gitorious,gitorious/mainline,elcom/gitorious,elcom/gitorious,spencerwp/mainline,adg29/asi.gitorious,njall/wel-gitorious,gitorious/mainline,adg29/asi.gitorious,grjones/gitorious-submodule-dependencies,feniix/gitorious,Gitorious-backup/mainline,Gitorious-backup/mainline,Gitorious-backup/yousource,balcom/gitorious,elcom/gitorious,tigefa4u/gitorious-mainline,altrair/gitorious-openstack,deld/gitorious,rae/gitorious-mainline,altrair/gitorious-openstack,spencerwp/mainline,cynipe/gitorious,balcom/gitorious,gitorious/mainline,SamuelMoraesF/Gitorious,victori/gitorious-jruby,rae/gitorious-mainline,Gitorious-backup/yousource,SamuelMoraesF/Gitorious