Skip to content

Instantly share code, notes, and snippets.

@VitalySalnikov
Created May 24, 2016 21:40
Show Gist options
  • Save VitalySalnikov/78eb144930e21a656c2b29338bb5f5bc to your computer and use it in GitHub Desktop.
Save VitalySalnikov/78eb144930e21a656c2b29338bb5f5bc to your computer and use it in GitHub Desktop.
MySQLi pretty helper
def to_mysqli_char_concat(str)
"CONCAT(" << str.split(//).map { |c| "CHAR(#{c.ord})" }.join(",") << ")"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment