aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-13 10:20:47 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-13 10:57:22 -0700
commitbc35631dc7d67ec9c918ec1967c708a5388a76e4 (patch)
treeaaa524649f259c9b43f058928419ac0ba444360a /activerecord
parent2b22d1240be90a75c3f35b7a774d5efc9c4ac68f (diff)
downloadrails-bc35631dc7d67ec9c918ec1967c708a5388a76e4.tar.gz
rails-bc35631dc7d67ec9c918ec1967c708a5388a76e4.tar.bz2
rails-bc35631dc7d67ec9c918ec1967c708a5388a76e4.zip
use constants instead of magic numbers. meow
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index dd623def2e..4baf99610e 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -433,7 +433,7 @@ module ActiveRecord
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 @@ module ActiveRecord
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.