diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-09-26 21:04:36 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-09-26 21:04:36 +0000 |
commit | 0f276de5127a1ede5232026ffed36bae086e6aec (patch) | |
tree | fe2912923e81097d13d398a6f8bfd08981962ad6 /activerecord | |
parent | b54560600b06112723adf286141a9cd7ed67b638 (diff) | |
download | rails-0f276de5127a1ede5232026ffed36bae086e6aec.tar.gz rails-0f276de5127a1ede5232026ffed36bae086e6aec.tar.bz2 rails-0f276de5127a1ede5232026ffed36bae086e6aec.zip |
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
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index d1929f74e4..fe48d1f807 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -61,17 +61,17 @@ module ActiveRecord 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 |