提交 bc35631d 编写于 作者: A Aaron Patterson

use constants instead of magic numbers. meow

上级 2b22d124
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册