This gem enables automatic limit validation for every ActiveRecord attribute.
Add to your Gemfile:
gem 'validate-limits', '~> 1.0'