aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/core.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/core.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/core.rb')
-rw-r--r--activerecord/lib/active_record/core.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index 1fbe374ade..878d87638d 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -194,7 +194,7 @@ module ActiveRecord
name, primary_key, id)
end
record
- rescue RangeError
+ rescue ::RangeError
raise RecordNotFound.new("Couldn't find #{name} with an out of range value for '#{primary_key}'",
name, primary_key)
end
@@ -223,7 +223,7 @@ module ActiveRecord
statement.execute(hash.values, self, connection).first
rescue TypeError
raise ActiveRecord::StatementInvalid
- rescue RangeError
+ rescue ::RangeError
nil
end
end