diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-10 16:06:39 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-10 16:06:39 -0800 |
commit | c50cb4aa393f2cee30ad85b32db532eb955f6637 (patch) | |
tree | ae9e5dd63249a6875a458174c0827995b95433a8 /activerecord/lib/active_record/connection_adapters/postgresql | |
parent | fa6cda53ebc7fd186a91fd0983dc9ddf20e9d39a (diff) | |
download | rails-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.rb | 5 |
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' |