New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActiveRecord valid? should includes ActiveModel validation for integer type column #37256
Comments
Your example app doesn't have any validations in it, is this expected? If you need to validate this, though, |
Yeah I agree that I can add that validation, but should we have this validation shows when you check |
This is a problem of database constraints vs app validations, take a read through https://thoughtbot.com/blog/validation-database-constraint-or-both. It is a tough problem but I'm not sure if rails has a precedent for this. |
Looks to be the same issue as #37283 |
This is not an issue but like a proposal. |
Steps to reproduce
https://gist.github.com/baoqchau/1ee3f2a1d11b4a006f1f2ab70451be62
Expected behavior
post.valid?
should return false.Actual behavior
post.valid?
return true and then when you save it (post.save!
) it will return theActiveModel error. is out of range for ActiveModel::Type::Integer with limit 4 bytes
,System configuration
Rails version:
6.0.0
Ruby version:
2.6.3
The text was updated successfully, but these errors were encountered: