jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

Setting nullable fields to zero or false #156

Open humaninternals opened 14 years ago

humaninternals commented 14 years ago

Setting a NULL-able field to '0'/false is treated as setting them to NULL, because of the empty() test used in set().

This makes it impossible to set the value to '0'/false, or read those values from a database. Do note that Postgres, for example, does have 'real' booleans and that my Postgres driver does allow me to set columns to FALSE (and not 1/0 as being done in MySQL).

I can suggest two possible solutions:

jonathangeiger commented 14 years ago

Are you using master or unstable? A lot of this stuff has been cleaned up and improved in unstable.

humaninternals commented 14 years ago

I'm on master (0.9.6.2), and haven't tested it on unstable yet. I'll check that and report back. Thanks