Ruby 角度为空的轨道值更改为0
当我用空值更新某个字段时,将显示0。DB:Postgres 角度放码请求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
------WebKitFormBoundarygQGLt12slBC759GB
Content-Disposition: form-data; name="product[gender]"
null
该领域:
:gender, 'integer USING CAST(gender AS integer)', {default: nil, null: true}
结果:
看起来您正在将值强制转换为整数,这意味着插入时nil被强制转换为0。我可以更改此行为吗?