I think it’s about time we did something about the validate
and validates
methods in ActiveModel.
Having two methods with such similar names that do similar things but in a totally different way is extremely confusing. What’s more, if you do use validate
instead of validates
by mistake, no exceptions are raised and MyModel.valid?
will return true.
I have trouble remembering which one I should be calling, and I’ve been working with Rails for years now. I can’t imagine how confused a novice programmer would be…
Perhaps renaming validate
would be the way to go (with proper deprecation warnings, of course)?
Adapted from a message to the Ruby on Rails: Core mailing list, all constructive discussion should happen there.