aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-05-22 09:12:23 -0700
committerSean Griffin <sean@thoughtbot.com>2014-05-22 09:14:15 -0700
commitecf4ad7cca206e2cf99ca16e57e17648e726877a (patch)
tree0a8e826707d2b8b2441972e35e6c90f35c8ac1bf /activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
parent110d3d0c0bceddd05cab86c0463f0aa71df815cb (diff)
downloadrails-ecf4ad7cca206e2cf99ca16e57e17648e726877a.tar.gz
rails-ecf4ad7cca206e2cf99ca16e57e17648e726877a.tar.bz2
rails-ecf4ad7cca206e2cf99ca16e57e17648e726877a.zip
Allow additional arguments to be used during type map lookups
Determining things like precision and scale in postgresql will require the given blocks to take additional arguments besides the OID. - Adds the ability to handle additional arguments to `TypeMap` - Passes the column type to blocks when looking up PG types
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
index 539ba38c4a..c04a1d7178 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
@@ -178,7 +178,7 @@ module ActiveRecord
def columns(table_name)
# Limit, precision, and scale are all handled by the superclass.
column_definitions(table_name).map do |column_name, type, default, notnull, oid, fmod|
- oid = get_oid_type(oid.to_i, fmod.to_i, column_name)
+ oid = get_oid_type(oid.to_i, fmod.to_i, column_name, type)
PostgreSQLColumn.new(column_name, default, oid, type, notnull == 'f')
end
end