aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-08-18 13:57:52 +0900
committerGitHub <noreply@github.com>2017-08-18 13:57:52 +0900
commit893ccb3d37c64b28c27c0f7a5790a69c6dc159ba (patch)
tree47882f3734c96af4c5828e902307a5825bf1d01f /activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
parente9ba12f746b3d149bba252df84957a9c26ad170b (diff)
downloadrails-893ccb3d37c64b28c27c0f7a5790a69c6dc159ba.tar.gz
rails-893ccb3d37c64b28c27c0f7a5790a69c6dc159ba.tar.bz2
rails-893ccb3d37c64b28c27c0f7a5790a69c6dc159ba.zip
Restore `to_sql` to return only SQL (#29945)
Because `to_sql` is public API. I introduced `to_sql_and_binds` internal API to return SQL and binds.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
index 0dd4aac463..8db2a645af 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
@@ -5,8 +5,7 @@ module ActiveRecord
module PostgreSQL
module DatabaseStatements
def explain(arel, binds = [])
- sql, binds = to_sql(arel, binds)
- sql = "EXPLAIN #{sql}"
+ sql = "EXPLAIN #{to_sql(arel, binds)}"
PostgreSQL::ExplainPrettyPrinter.new.pp(exec_query(sql, "EXPLAIN", binds))
end