123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ByteaDecodeDetection

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

Instance Method Summary

Instance Method Details

#unescape_bytea(string)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 1258

def unescape_bytea(string)
  if string.instance_variable_get(:@ar_pg_bytea_decoded) == true
    ActiveRecord.deprecator.warn(<<~MSG.squish)
      unescape_bytea called on a query result value that has already been
      automatically unescaped due to `config.active_record.postgresql_adapter_decode_bytea`.
      In a future Rails release, this will double-unescape the value as
      instructed, which could cause data corruption.
    MSG

    result = string.dup
    result.remove_instance_variable(:@ar_pg_bytea_decoded)
    return result
  end

  super
end