Converting ActiveRecord objects to json

I have an ActiveRecord model with a boolean attribute. If I call
to_json on an instance of this model, a get something like the
following:

“{attributes : { my_boolean : "0" } }”
or
“{attributes : { my_boolean : "1" } }”

why is my boolean attribute being converted to a string?

if i call my_model_obj.attributes.to_json i get: “{ my_boolean :
false }” or “{ my_boolean : true }”, which are both valid JSON
representation according to the grammar specified at
http://www.json.org,
and definitely the preferred representation when testing for truth in
javascript

json_str = “{attributes : { my_boolean : "0" } }”
obj = eval(json_str)
if(obj.attributes.my_boolean) {
// shouldn’t execute this bc my_boolean is false
}

can anyone tell me why this is? or what i might be doing wrong?