diff options
author | Chris Feist <feist@teridot.com> | 2012-01-31 00:07:40 -0600 |
---|---|---|
committer | Chris Feist <cfeist@redhat.com> | 2012-01-31 13:45:00 -0600 |
commit | 661466824411cc0b3bd6374d65a72122488f305b (patch) | |
tree | ee97dcf3548eaf886a166bab2b5cfb2e6742dd88 /activerecord/lib | |
parent | 96359d557d8a9902e1338fda74b993d3ce3ee59a (diff) | |
download | rails-661466824411cc0b3bd6374d65a72122488f305b.tar.gz rails-661466824411cc0b3bd6374d65a72122488f305b.tar.bz2 rails-661466824411cc0b3bd6374d65a72122488f305b.zip |
Fixed issue with SQLite adapter corrupting binary data
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 0520fc8b62..6391ea3800 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.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 |