Skip to content

Commit 2fb186d

Browse files
committed
Remove deprecated support to define explain in the connection adapter with 2 arguments
1 parent dca35bb commit 2fb186d

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

activerecord/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated support to define `explain` in the connection adapter with 2 arguments.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove deprecated `ActiveRecord::ActiveJobRequiredError`.
26

37
*Rafael Mendonça França*

activerecord/lib/active_record/explain.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def exec_explain(queries, options = []) # :nodoc:
2424
msg << binds.map { |attr| render_bind(attr) }.inspect
2525
end
2626
msg << "\n"
27-
msg << connection_explain(sql, binds, options)
27+
msg << connection.explain(sql, binds, options)
2828
end.join("\n")
2929

3030
# Overriding inspect to be more human readable, especially in the console.
@@ -58,17 +58,5 @@ def build_explain_clause(options = [])
5858
"EXPLAIN for:"
5959
end
6060
end
61-
62-
def connection_explain(sql, binds, options)
63-
if connection.method(:explain).parameters.size == 2
64-
ActiveRecord.deprecator.warn(<<~MSG.squish)
65-
The current database adapter, #{connection.adapter_name}, does not support explain options.
66-
To remove this warning, the adapter must implement `build_explain_clause(options = [])`.
67-
MSG
68-
connection.explain(sql, binds)
69-
else
70-
connection.explain(sql, binds, options)
71-
end
72-
end
7361
end
7462
end

guides/source/7_2_release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
121121

122122
* Remove deprecated `ActiveRecord::ActiveJobRequiredError`.
123123

124+
* Remove deprecated support to define `explain` in the connection adapter with 2 arguments.
125+
124126

125127
### Deprecations
126128

0 commit comments

Comments
 (0)