class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::Bytea

def type_cast(value)

def type_cast(value)
  return if value.nil?
  PGconn.unescape_bytea value
end