From 4ca633e4663b62653ee017e5fd02dd86f06d1200 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 1 Feb 2012 10:38:26 -0800 Subject: Merge pull request #4809 from cfeist/feist-sqlite-binary-corruption Fix for SQLite binary data corrupter (to master branch) --- .../active_record/connection_adapters/sqlite_adapter.rb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 55818b3fbf..56ea1a2841 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -6,26 +6,11 @@ module ActiveRecord module ConnectionAdapters #:nodoc: class SQLiteColumn < Column #:nodoc: class << self - def string_to_binary(value) - value.gsub(/\0|\%/n) do |b| - case b - when "\0" then "%00" - when "%" then "%25" - end - end - end - def binary_to_string(value) if value.respond_to?(:force_encoding) && value.encoding != Encoding::ASCII_8BIT value = value.force_encoding(Encoding::ASCII_8BIT) end - - value.gsub(/%00|%25/n) do |b| - case b - when "%00" then "\0" - when "%25" then "%" - end - end + value end end end -- cgit v1.2.3