From 299e5f9c5758866ba4e580349da323fdda22c670 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 4 Jan 2015 07:07:35 +0900 Subject: `sql_type` has been determined already when quoting defaults No need to call `type_to_sql` again. --- .../active_record/connection_adapters/abstract/schema_creation.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb index 18ff869ea6..db20b60d60 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb @@ -28,8 +28,8 @@ module ActiveRecord end def visit_ColumnDefinition(o) - sql_type = type_to_sql(o.type, o.limit, o.precision, o.scale) - column_sql = "#{quote_column_name(o.name)} #{sql_type}" + o.sql_type = type_to_sql(o.type, o.limit, o.precision, o.scale) + column_sql = "#{quote_column_name(o.name)} #{o.sql_type}" add_column_options!(column_sql, column_options(o)) unless o.type == :primary_key column_sql end @@ -98,9 +98,7 @@ module ActiveRecord end def quote_default_expression(value, column) - column.sql_type ||= type_to_sql(column.type, column.limit, column.precision, column.scale) value = type_for_column(column).type_cast_for_database(value) - @conn.quote(value) end -- cgit v1.2.3