DavyJonesLocker / DavyJonesLocker/client_side_validations
Numericality validator against other fields doesn't work as expected
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
When using numericality: greater_than with other model attributes, if i remove 1 of the fields, it doesn't show any messages anymore, but when i try to submit, i'm getting server validation fail. I suppose it's better to reproduce server side behaviour for that case
validates :maximum_players,
allow_nil: true,
numericality: { only_integer: true, less_than_or_equal_to: 2147483647, greater_than_or_equal_to: :minimum_players }
validates :minimum_players,
allow_nil: true,
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: :maximum_players }
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
No file or test is named in the issue. Reproduce the two-field model validation shown, focusing on numericality comparisons against the other attribute when one field is removed, then compare client-side messages with the server validation result. Done means the client-side behavior matches the server-side failure case, with coverage for both fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100