Fixed #12030 -- Validate integer field range at the model level.

Thanks to @timgraham for the review.