Permalink
Browse files

Fixed issue with SQLite adapter corrupting binary data

  • Loading branch information...
1 parent 96359d5 commit 661466824411cc0b3bd6374d65a72122488f305b Chris Feist committed with feist Jan 31, 2012
Showing with 1 addition and 16 deletions.
  1. +1 −16 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.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

0 comments on commit 6614668

Please sign in to comment.