File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
activerecord/lib/active_record Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def collecting_queries_for_explain # :nodoc:
5252 # Makes the adapter execute EXPLAIN for the tuples of queries and bindings.
5353 # Returns a formatted string ready to be logged.
5454 def exec_explain ( queries ) # :nodoc:
55- queries && queries . map do |sql , bind |
55+ str = queries && queries . map do |sql , bind |
5656 [ ] . tap do |msg |
5757 msg << "EXPLAIN for: #{ sql } "
5858 unless bind . empty?
@@ -62,6 +62,12 @@ def exec_explain(queries) # :nodoc:
6262 msg << connection . explain ( sql , bind )
6363 end . join ( "\n " )
6464 end . join ( "\n " )
65+
66+ # overriding inspect to be more human readable
67+ def str . inspect
68+ self
69+ end
70+ str
6571 end
6672
6773 # Silences automatic EXPLAIN logging for the duration of the block.
You can’t perform that action at this time.
0 commit comments