Skip to content

Commit

Permalink
Merge pull request #358 from juananpe/sql
Browse files Browse the repository at this point in the history
Fix escape_for_sql method
  • Loading branch information
urbanadventurer authored Jan 15, 2021
2 parents 3e7d5ee + ea5cc2b commit 982dc2d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/logging/sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ def flatten_elements!(obj)

def escape_for_sql(s)
s = s.to_s
if s.nil?
"''"
else
"'" + s.tr("'", "\'") + "'"
end
"'" + s.gsub("'"){"\\'"} + "'"
end

def create_tables
Expand Down

0 comments on commit 982dc2d

Please sign in to comment.