zhangjingl02 / activejdbc

Automatically exported from code.google.com/p/activejdbc
0 stars 0 forks source link

Convert should turn "1" to true #191

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Model.getBoolean(String attribute) was always returning false for me.  I found 
that the value that it was trying to convert was a String with a value of "1".

Convert.toBoolean(Object value) only handles 'y', 't', 'true' or 'yes'.  Would 
it be possible to modify it to accept '1'? 

Original issue reported on code.google.com by augustin...@gmail.com on 26 Mar 2013 at 9:55

GoogleCodeExporter commented 9 years ago
this is really not a defect, rather request for enhancement, since the class 
works according to the docs. 
Unfortunately have to reject this, because the string with value "1" has no 
semantic meaning. 
In addition to this, if this is implemented, it has a potential to break 
existing projects. (think backwards compatibility).
I can only suggest to make convert the string value before it is passed to this 
methid

sorry

Original comment by i...@polevoy.org on 27 Mar 2013 at 6:33