Permalink
Browse files

use constants instead of magic numbers. meow

  • Loading branch information...
1 parent 2b22d12 commit bc35631dc7d67ec9c918ec1967c708a5388a76e4 @tenderlove tenderlove committed Jul 13, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -433,7 +433,7 @@ def result_as_array(res) #:nodoc:
unescape_col = []
res.nfields.times do |j|
# unescape string passed BYTEA field (OID == 17)
- unescape_col << ( res.ftype(j)==17 )
+ unescape_col << ( res.ftype(j) == BYTEA_COLUMN_TYPE_OID )
end
ary = []
@@ -889,6 +889,8 @@ def translate_exception(exception, message)
private
# The internal PostgreSQL identifier of the money data type.
MONEY_COLUMN_TYPE_OID = 790 #:nodoc:
+ # The internal PostgreSQL identifier of the BYTEA data type.
+ BYTEA_COLUMN_TYPE_OID = 17 #:nodoc:
# Connects to a PostgreSQL server and sets up the adapter depending on the
# connected server's characteristics.

0 comments on commit bc35631

Please sign in to comment.