diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-01 10:38:26 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-01 10:38:26 -0800 |
commit | 78d5d6f8688bb7c45ba9a3ef893682231130da3f (patch) | |
tree | 81e654ebd28ea8b94598c29372dd9e3998db1344 /activerecord/lib/active_record | |
parent | 7bfdbeabd26f87d9e6bb6891d6c8dee36d1dfcb1 (diff) | |
parent | 661466824411cc0b3bd6374d65a72122488f305b (diff) | |
download | rails-78d5d6f8688bb7c45ba9a3ef893682231130da3f.tar.gz rails-78d5d6f8688bb7c45ba9a3ef893682231130da3f.tar.bz2 rails-78d5d6f8688bb7c45ba9a3ef893682231130da3f.zip |
Merge pull request #4809 from cfeist/feist-sqlite-binary-corruption
Fix for SQLite binary data corrupter (to master branch)
Diffstat (limited to 'activerecord/lib/active_record')
-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 |