Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bytea

Inherits:
Type::Binary show all
Defined in:
activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Type::Value

#limit, #precision, #scale

Instance Method Summary collapse

Methods inherited from Type::Binary

#binary?, #changed_in_place?, #type, #type_cast, #type_cast_for_database

Methods inherited from Type::Value

#==, #binary?, #changed?, #changed_in_place?, #hash, #initialize, #klass, #number?, #text?, #type, #type_cast_for_database, #type_cast_for_schema, #type_cast_from_user

Constructor Details

This class inherits a constructor from ActiveRecord::Type::Value

Instance Method Details

#type_cast_from_database(value) ⇒ Object


6
7
8
9
10
# File 'activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb', line 6

def type_cast_from_database(value)
  return if value.nil?
  return value.to_s if value.is_a?(Type::Binary::Data)
  PGconn.unescape_bytea(super)
end