omit_nil fixed for rails mode
@@ -1284,6 +1284,9 @@ hash_cb(VALUE key, VALUE value, Out out) {
long size;
int rtype = rb_type(key);
+ if (out->omit_nil && Qnil == value) {
+ return ST_CONTINUE;
+ }
if (rtype != T_STRING && rtype != T_SYMBOL) {
key = rb_funcall(key, oj_to_s_id, 0);
rtype = rb_type(key);
