Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 角度为空的轨道值更改为0_Ruby_Database_Web Applications - Fatal编程技术网

Ruby 角度为空的轨道值更改为0

Ruby 角度为空的轨道值更改为0,ruby,database,web-applications,Ruby,Database,Web Applications,当我用空值更新某个字段时,将显示0。DB:Postgres 角度放码请求 ------WebKitFormBoundarygQGLt12slBC759GB Content-Disposition: form-data; name="product[gender]" null 该领域: :gender, 'integer USING CAST(gender AS integer)', {default: nil, null: true} 结果: 看起来您正在将值强制转换为整数,这意味着插入时n

当我用空值更新某个字段时,将显示0。DB:Postgres

角度放码请求

------WebKitFormBoundarygQGLt12slBC759GB
Content-Disposition: form-data; name="product[gender]"
null
该领域:

:gender, 'integer USING CAST(gender AS integer)', {default: nil, null: true}
结果:

看起来您正在将值强制转换为整数,这意味着插入时nil被强制转换为0。我可以更改此行为吗?