Permalink
Browse files

Remove original_exception from ActiveRecord::StatementInvalid

  • Loading branch information...
rafaelfranca committed Dec 29, 2016
1 parent 5973a98 commit bc6c5df4699d3f6b4a61dd12328f9e0f1bd6cf46
@@ -1,3 +1,8 @@
* Remove deprecated `original_exception` argument in `ActiveRecord::StatementInvalid#initialize`
and `ActiveRecord::StatementInvalid#original_exception`.
*Rafael Mendonça França*
* `#tables` and `#table_exists?` and returns only tables and not views.
All the deprecations on those methods were removed.
@@ -95,19 +95,9 @@ def initialize(message = nil, record = nil)
#
# 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.
@@ -21,7 +21,7 @@ def drop
FileUtils.rm(file)
rescue Errno::ENOENT => error
raise NoDatabaseError.new(error.message, error)
raise NoDatabaseError.new(error.message)
end
def purge

0 comments on commit bc6c5df

Please sign in to comment.