Coord y is being rendered as 'y' but x is still x
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 597
- Forks
- 223
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 3
Description
I have a rails model with coords, and when dumped to yml the y is rendered incorrectly.
For example,
>> puts Coord.new(x: 13, y: 12).attributes.to_yaml
---
id:
x: 13
"y": 12
instead of the expected
>> puts Coord.new(x: 13, y: 12).attributes.to_yaml
---
id:
x: 13
y: 12
This comes about because of this change ...
https://github.com/ruby/psych/commit/6a1c30634e61967f3d8133b3181b9f301ff7f550
I have commented out those lines and I get the expected coord rendered.
I'm not sure what the solution is because I know that change was added to appease yes/no boolean guff but unfortunately y is a known coordinate also 🤷
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with Coord.new(x: 13, y: 12).attributes.to_yaml and compare the quoted y output with the expected YAML. Read the referenced Psych commit 6a1c30634e61967f3d8133b3181b9f301ff7f550 to understand the boolean-handling change; done means coordinate keys such as y serialize correctly without regressing yes/no handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, yaml
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100