Skip to content

Commit bc6c5df

Browse files
committed
Remove original_exception from ActiveRecord::StatementInvalid
1 parent 5973a98 commit bc6c5df

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

activerecord/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
* Remove deprecated `original_exception` argument in `ActiveRecord::StatementInvalid#initialize`
2+
and `ActiveRecord::StatementInvalid#original_exception`.
3+
4+
*Rafael Mendonça França*
5+
16
* `#tables` and `#table_exists?` and returns only tables and not views.
27

38
All the deprecations on those methods were removed.

activerecord/lib/active_record/errors.rb

+1-11
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,9 @@ def initialize(message = nil, record = nil)
9595
#
9696
# Wraps the underlying database error as +cause+.
9797
class StatementInvalid < ActiveRecordError
98-
def initialize(message = nil, original_exception = nil)
99-
if original_exception
100-
ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \
101-
"Exceptions will automatically capture the original exception.", caller)
102-
end
103-
98+
def initialize(message = nil)
10499
super(message || $!.try(:message))
105100
end
106-
107-
def original_exception
108-
ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller)
109-
cause
110-
end
111101
end
112102

113103
# Defunct wrapper class kept for compatibility.

activerecord/lib/active_record/tasks/sqlite_database_tasks.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def drop
2121

2222
FileUtils.rm(file)
2323
rescue Errno::ENOENT => error
24-
raise NoDatabaseError.new(error.message, error)
24+
raise NoDatabaseError.new(error.message)
2525
end
2626

2727
def purge

0 commit comments

Comments
 (0)