Use this syntax to format raw SQL nicely in ruby code. In some editors it also enables SQL syntax highlighting.
variable = <<-SQL.gsub(/\s+/, ' ') SELECT * FROM your_sql_code_here SQL
The gsub is used to remove whitespace from logs.
gsub
None
Comments