aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-10 16:06:39 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-10 16:06:39 -0800
commitc50cb4aa393f2cee30ad85b32db532eb955f6637 (patch)
treeae9e5dd63249a6875a458174c0827995b95433a8 /activerecord/lib/active_record/connection_adapters/postgresql
parentfa6cda53ebc7fd186a91fd0983dc9ddf20e9d39a (diff)
downloadrails-c50cb4aa393f2cee30ad85b32db532eb955f6637.tar.gz
rails-c50cb4aa393f2cee30ad85b32db532eb955f6637.tar.bz2
rails-c50cb4aa393f2cee30ad85b32db532eb955f6637.zip
PG column consults oid types when typecasting
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
index 8e1348a38d..c82afc232c 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
@@ -20,7 +20,7 @@ module ActiveRecord
class Bytea < Type
def type_cast(value)
- PGconn.unescape_bytea value if value
+ PGconn.unescape_bytea value
end
end
@@ -180,7 +180,6 @@ module ActiveRecord
h[k] = OID::Identity.new
}
-
# Register an OID type named +name+ with a typcasting object in
# +type+. +name+ should correspond to the `typname` column in
# the `pg_type` table.
@@ -207,6 +206,8 @@ module ActiveRecord
register_type 'text', OID::Identity.new
alias_type 'varchar', 'text'
alias_type 'char', 'text'
+ alias_type 'bpchar', 'text'
+ alias_type 'xml', 'text'
# FIXME: why are we keeping these types as strings?
alias_type 'tsvector', 'text'