Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 2351

Show
Ignore:
Timestamp:
09/26/05 21:04:36 (3 years ago)
Author:
bitsweat
Message:

r3597@asus: jeremy | 2005-09-26 17:39:23 -0700
Minor improvement to SQLite adapter blob escaping.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb

    r2339 r2351  
    6262    class SQLiteColumn < Column #:nodoc: 
    6363      def string_to_binary(value) 
    64         value.gsub(/(\0|\%)/) do 
    65           case $1 
     64        value.gsub(/\0|\%/) do |b| 
     65          case b 
    6666            when "\0" then "%00" 
    67             when "%" then "%25" 
     67            when "%" then "%25" 
    6868          end 
    6969        end                 
     
    7171       
    7272      def binary_to_string(value) 
    73         value.gsub(/(%00|%25)/) do 
    74           case $1 
     73        value.gsub(/%00|%25/) do |b| 
     74          case b 
    7575            when "%00" then "\0" 
    7676            when "%25" then "%"