Permalink
Browse files

r3597@asus: jeremy | 2005-09-26 17:39:23 -0700

 Minor improvement to SQLite adapter blob escaping.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2351 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b545606 commit 0f276de5127a1ede5232026ffed36bae086e6aec @jeremy jeremy committed Sep 26, 2005
Showing with 5 additions and 5 deletions.
  1. +5 −5 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -61,17 +61,17 @@ def parse_config!(config)
module ConnectionAdapters #:nodoc:
class SQLiteColumn < Column #:nodoc:
def string_to_binary(value)
- value.gsub(/(\0|\%)/) do
- case $1
+ value.gsub(/\0|\%/) do |b|
+ case b
when "\0" then "%00"
- when "%" then "%25"
+ when "%" then "%25"
end
end
end
def binary_to_string(value)
- value.gsub(/(%00|%25)/) do
- case $1
+ value.gsub(/%00|%25/) do |b|
+ case b
when "%00" then "\0"
when "%25" then "%"
end

0 comments on commit 0f276de

Please sign in to comment.