shoulda-matchers
shoulda-matchers copied to clipboard
validates_absence_of to validate_absence_of
Spelling fix - validates_absence_of to validate_absence_of i.e validates_* to validate_*
Hi, @prashantham, thank you so much for this contribution!
Would it be possible to fix the README too?
Hi @prashantham, this doesn't seem right to me, although I admit it's a bit confusing.
- The name of the Rails validation ends in
s
(e.g.validates_absence_of
) because it's designed to fit into a sentence (e.g. "The post validates the absence of :name") - The name of the matcher doesn't (e.g.
validate_absence_of
) because it's designed to fit into another sentence ("The post should validate the absence of :name")
So I think what we have here is right unless you've been having issues?
Hi @mcmire , its just a spelling mistake fix. Not a change in code.
Hi @VSPPedro , README.md updated.
@prashantham Right, but I'm not sure the spelling fix is correct. The way you use the validation in a typical model is by saying:
validates_absence_of :something
If you said
validate_absence_of :something
then Rails wouldn't know what you mean. Do you see what I mean? :)
I'm cleaning up the open PRs. I will close this PR. If there is something beyond what has already been discussed feel free to re-open it.