diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb new file mode 100644 index 0000000000..89b203d2b1 --- /dev/null +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb @@ -0,0 +1,14 @@ +module ActiveRecord + module ConnectionAdapters + module PostgreSQL + module OID # :nodoc: + class Bytea < Type::Binary + def type_cast_from_database(value) + return if value.nil? + PGconn.unescape_bytea(super) + end + end + end + end + end +end |