aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-12-29 11:08:34 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-12-29 17:53:04 -0500
commitbc6c5df4699d3f6b4a61dd12328f9e0f1bd6cf46 (patch)
treec1e397a73c44fda84882aa99bbe5fec451484c43 /activerecord/lib/active_record/errors.rb
parent5973a984c369a63720c2ac18b71012b8347479a8 (diff)
downloadrails-bc6c5df4699d3f6b4a61dd12328f9e0f1bd6cf46.tar.gz
rails-bc6c5df4699d3f6b4a61dd12328f9e0f1bd6cf46.tar.bz2
rails-bc6c5df4699d3f6b4a61dd12328f9e0f1bd6cf46.zip
Remove original_exception from ActiveRecord::StatementInvalid
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index c812a05101..18fac5af1b 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -95,19 +95,9 @@ module ActiveRecord
#
# Wraps the underlying database error as +cause+.
class StatementInvalid < ActiveRecordError
- def initialize(message = nil, original_exception = nil)
- if original_exception
- ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \
- "Exceptions will automatically capture the original exception.", caller)
- end
-
+ def initialize(message = nil)
super(message || $!.try(:message))
end
-
- def original_exception
- ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller)
- cause
- end
end
# Defunct wrapper class kept for compatibility.