Just leave the value out:
product_four:
id: 4
application_id: 1
title: "oldtitle"
deleted_at:
For example:
> {:k => ''}.to_yaml
=> "--- \n:k: \"\"\n"
> {:k => nil}.to_yaml
=> "--- \n:k: \n"
> YAML.load({:k => nil}.to_yaml)
=> {:k=>nil}
Note that k:
means that k
has a nil
value whereas k: ""
means that k
has an empty string as its value.
You could also use an explicit null
if all your parsers are aware of the latest YAML spec:
product_four:
id: 4
application_id: 1
title: "oldtitle"
deleted_at: null
For example:
> YAML.load("--- \n:k: null\n")
=> {:k=>nil}