Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Implemented strict validation concept
In order to deliver debug information to dev team instead of display error message to end user Implemented strict validation concept that suppose to define validation that always raise exception when fails
- Loading branch information
Showing
with
75 additions
and 6 deletions.
- +7 −1 activemodel/lib/active_model/errors.rb
- +2 −0 activemodel/lib/active_model/validations/acceptance.rb
- +2 −0 activemodel/lib/active_model/validations/confirmation.rb
- +2 −0 activemodel/lib/active_model/validations/exclusion.rb
- +2 −0 activemodel/lib/active_model/validations/format.rb
- +2 −0 activemodel/lib/active_model/validations/inclusion.rb
- +2 −0 activemodel/lib/active_model/validations/length.rb
- +2 −0 activemodel/lib/active_model/validations/numericality.rb
- +2 −0 activemodel/lib/active_model/validations/presence.rb
- +15 −3 activemodel/lib/active_model/validations/validates.rb
- +4 −2 activemodel/lib/active_model/validations/with.rb
- +33 −0 activemodel/test/cases/validations_test.rb
The message is not enough here. We also need the attribute name, otherwise we get stuff like:
With no mention at all of the attribute that failed.