ext/oj/load.c in oj-1.0.2 vs ext/oj/load.c in oj-1.0.3
- old
+ new
@@ -450,10 +450,14 @@
var_id = rb_intern(attr);
*slot = var_id;
}
rb_ivar_set(obj, var_id, val);
} else if (T_HASH == obj_type) {
- rb_hash_aset(obj, key, val);
+ if (Yes == pi->options->sym_key) {
+ rb_hash_aset(obj, rb_str_intern(key), val);
+ } else {
+ rb_hash_aset(obj, key, val);
+ }
if ((CompatMode == pi->options->mode || ObjectMode == pi->options->mode) &&
0 == json_class_name &&
0 != ks && 'j' == *ks && 0 == strcmp("json_class", ks) &&
T_STRING == rb_type(val)) {
json_class_name = StringValuePtr(val);