diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2015-03-21 21:51:55 +0100 |
---|---|---|
committer | Lars Kanis <lars@greiz-reinsdorf.de> | 2015-03-25 15:05:23 +0100 |
commit | 1d8d5a74b81b8aab1f5e6d233d509a92525ed4e1 (patch) | |
tree | 6310199303f48857333d34b16041e0c424c5d5b6 /activerecord/lib/active_record/connection_adapters/postgresql/oid | |
parent | 348377da4d623a81b570b2bf46e6ef9e5ee4e12f (diff) | |
download | rails-1d8d5a74b81b8aab1f5e6d233d509a92525ed4e1.tar.gz rails-1d8d5a74b81b8aab1f5e6d233d509a92525ed4e1.tar.bz2 rails-1d8d5a74b81b8aab1f5e6d233d509a92525ed4e1.zip |
PostgreSQL, Fix OID based type casts in C for primitive types.
The type map was introduced in aafee23, but wasn't properly filled.
This mainly adjusts many locations, that expected strings instead of
integers or boolean.
add_pg_decoders is moved after setup of the StatementPool, because
execute_and_clear could potentially make use of it.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb index 9b3de41fab..9d421d6975 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb @@ -19,7 +19,7 @@ module ActiveRecord enums, nodes = nodes.partition { |row| row['typtype'] == 'e' } domains, nodes = nodes.partition { |row| row['typtype'] == 'd' } arrays, nodes = nodes.partition { |row| row['typinput'] == 'array_in' } - composites, nodes = nodes.partition { |row| row['typelem'] != '0' } + composites, nodes = nodes.partition { |row| row['typelem'].to_i != 0 } mapped.each { |row| register_mapped_type(row) } enums.each { |row| register_enum_type(row) } |