aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/oid/bytea.rb
blob: 6bd1b8ecaec54c8fd1e622882759e056e1a7cd82 (plain) (tree)
1
2
3
4
5
6
7
8
9



                           
                                            

                                            
                                                                
                                        





             
module ActiveRecord
  module ConnectionAdapters
    module PostgreSQL
      module OID # :nodoc:
        class Bytea < Type::Binary # :nodoc:
          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
        end
      end
    end
  end
end