Why does yaml.dump add quotes this key-value pair
- by jason gagne
I'm trying to write a new entry to a rails database.yml and for some reason I'm getting quotes around this entry
db_yml = {'new_env' = {'database' = 'database_name', '<<' = '*defaults' }}
File.open("#{RAILS_ROOT}/config/database.yml", "a") {|f| YAML.dump(db_yml, f)}
returns
---
new_env:
database: database_name
"<<": "*defaults"
I don't know why the "---" and the quotes around the defaults are returned, any thoughts on how to prevent?
thanks!