don't use ConnectionSwitcher in generic code

pull/6827/head
Tim Felgentreff 14 years ago
parent 72459437a8
commit c86adf1f58
  1. 2
      lib/report/sql_statement.rb

@ -74,7 +74,7 @@ class Report::SqlStatement
# FIXME I'm ugly
@sql ||= begin
sql = "\n-- BEGIN #{desc}\n" \
"-- DB: #{ConnectionSwitcher.config_name}\n" \
"-- DB: #{ActiveRecord::Base.connection.current_database}\n" \
"SELECT\n#{select.map { |e| "\t#{e}" }.join ",\n"}" \
"\nFROM\n\t#{from.gsub("\n", "\n\t")}" \
"\n\t#{joins.map { |e| e.gsub("\n", "\n\t") }.join "\n\t"}" \

Loading…
Cancel
Save