Hi everyone.
I’ve noticed that the documentation on YAML defaults in
Fixtureshttp://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html#label-Support+for+YAML+defaults
seems
to be wrong. The syntax shown is not currently supported at least, if
I’m
not completely mistaken:
DEFAULTS: &DEFAULTS
created_on: <%= 3.weeks.ago.to_s(:db) %>
first:
name: Smurf
*DEFAULTS
second:
name: Fraggle
*DEFAULTS
When using that exact snippet, psych throws a parsing error. If one
changes
“*DEFAULTS” to “<<: *DEFAULTS”, it works. Is the described syntax simply
not supported yet? It seems to have been introduced in YAML
1.2http://www.yaml.org/spec/1.2/spec.html#id2761803
…
Best regards,
Lucas