From adb881979a2ee295368c3500a300b438396a9d0b Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Fri, 23 May 2014 09:33:14 -0700 Subject: Move parsing of PG sql strings for defaults out of column --- .../active_record/connection_adapters/postgresql/schema_statements.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb') 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 c04a1d7178..9e53d10bb4 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -179,7 +179,9 @@ module ActiveRecord # 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, type) - PostgreSQLColumn.new(column_name, default, oid, type, notnull == 'f') + default_value = extract_value_from_default(default) + default_function = extract_default_function(default_value, default) + PostgreSQLColumn.new(column_name, default_value, oid, type, notnull == 'f', default_function) end end -- cgit v1.2.3