Method: Array#to_sql
- Defined in:
- lib/sequel_core/core_sql.rb
#to_sql ⇒ Object
Concatenates an array of strings into an SQL string. ANSI SQL and C-style comments are removed, as well as excessive white-space.
52 53 54 55 |
# File 'lib/sequel_core/core_sql.rb', line 52 def to_sql map {|l| ((m = /^(.*)--/.match(l)) ? m[1] : l).chomp}.join(' '). \ gsub(/\/\*.*\*\//, '').gsub(/\s+/, ' ').strip end |