luckyframework / luckyframework/avram
How to handle when the starting field value is present and an invalid param is sent
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 183
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Let's say you have an `age : Int32` field.
You have a record with `age` as `32`. You then fill out an HTML form and set age to `thirty two`. Avram will correctly say that this is invalid. The problem is that because it is invalid `age.value` will be the old value `32`. I wonder what we should do? Is this correct behavior? We can't set it to `"thirty two"` because it is the wrong type. Maybe it should be `nil`? Or maybe this is just a weird edge case where there is no "correct" way to handle it
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
Start with the Int32 age field and the HTML form submission described in the issue, then trace how an invalid parameter affects the existing value. No file or test is named; the work is done when the project has an agreed behavior for age.value after invalid input and that behavior is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100