Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor, use `typtype` instead of `typinput` to segment PG types.

  • Loading branch information...
commit 06082f66d541e581110406bbac3bc395bace3f86 1 parent f7a6b11
@senny senny authored
View
6 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -592,13 +592,13 @@ def initialize_type_map(type_map)
FROM pg_type as t
SQL
end
- ranges, nodes = result.partition { |row| row['typinput'] == 'range_in' }
+ ranges, nodes = result.partition { |row| row['typtype'] == 'r' }
+ enums, nodes = nodes.partition { |row| row['typtype'] == 'e' }
domains, nodes = nodes.partition { |row| row['typtype'] == 'd' }
- leaves, nodes = nodes.partition { |row| row['typelem'] == '0' }
arrays, nodes = nodes.partition { |row| row['typinput'] == 'array_in' }
+ leaves, nodes = nodes.partition { |row| row['typelem'] == '0' }
# populate the enum types
- enums, leaves = leaves.partition { |row| row['typinput'] == 'enum_in' }
enums.each do |row|
type_map[row['oid'].to_i] = OID::Enum.new
end
Please sign in to comment.
Something went wrong with that request. Please try again.