aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-06-01 04:00:05 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-12-06 21:30:25 +0900
commit49edce37f92b1dcad4b67b3eb35922e7cec88726 (patch)
treeeaf97037eb42a02eceefef408cfc13418e67cc47 /activerecord/lib/active_record/errors.rb
parentcf6c2948d5e0e0d40a03f6858179a659a0a6ed7a (diff)
downloadrails-49edce37f92b1dcad4b67b3eb35922e7cec88726.tar.gz
rails-49edce37f92b1dcad4b67b3eb35922e7cec88726.tar.bz2
rails-49edce37f92b1dcad4b67b3eb35922e7cec88726.zip
Translate numeric value out of range to the specific exception
Raise `ActiveRecord::RangeError` when values that executed are out of range.
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index 507615a222..c812a05101 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -159,6 +159,10 @@ module ActiveRecord
class ValueTooLong < StatementInvalid
end
+ # Raised when values that executed are out of range.
+ class RangeError < StatementInvalid
+ end
+
# Raised when number of bind variables in statement given to +:condition+ key
# (for example, when using {ActiveRecord::Base.find}[rdoc-ref:FinderMethods#find] method)
# does not match number of expected values supplied.