diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-03 08:08:50 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-03 08:42:07 -0600 |
commit | 74a756a8b43e2eb5e743d32fa4f6089be2246a58 (patch) | |
tree | 38768822ff7931389c62f4658a40c433203d1605 /activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | |
parent | 098bb63ae4acc349826ab84b3e1dff985e38609c (diff) | |
download | rails-74a756a8b43e2eb5e743d32fa4f6089be2246a58.tar.gz rails-74a756a8b43e2eb5e743d32fa4f6089be2246a58.tar.bz2 rails-74a756a8b43e2eb5e743d32fa4f6089be2246a58.zip |
Refactor quoting of binary data to not be based on the column type
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index adf893d7e7..e6163771e8 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -219,10 +219,9 @@ module ActiveRecord # QUOTING ================================================== - def quote(value, column = nil) - if value.kind_of?(String) && column && column.type == :binary - s = value.unpack("H*")[0] - "x'#{s}'" + def _quote(value) # :nodoc: + if value.is_a?(Type::Binary::Data) + "x'#{value.hex}'" else super end |