labml
labml copied to clipboard
HEREDOC parse error & warning on SQL string with no substitution
: parse error on value "<<" (tLSHFT) | Could not parse /Users/[etc]
Furthermore, this SQL string has no substitutions. def specialquery query =<<~SQL.gsub(/[\s\t]\n/, ' ').strip select i., pi., p., p.id as "product_id"
from product_ingredients pi
join ingredients i on pi.ingredient_id = i.id
join products p on pi.product_id = p.id
order by
p.description,
pi.product_id,
i.name
SQL
@report = Ingredient.find_by_sql(query)
Hi Richard,
The <<~ syntax is not supported yet: https://github.com/seattlerb/ruby_parser/issues/218
If there is a parsing error on the <<~ heredoc, then Brakeman can't be warning about it, and I was not able to reproduce a warning using the <<- syntax.
Please provide the warning message.
Going to close this. Please re-open if you can provide more information.