diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2015-01-04 07:07:35 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2015-01-04 07:07:35 +0900 |
commit | 299e5f9c5758866ba4e580349da323fdda22c670 (patch) | |
tree | 17181d2bf2caca22b9ff4ccb0362e269c643a79e | |
parent | 4591b0fc041454f4ba4a83629b9bbca2a851969c (diff) | |
download | rails-299e5f9c5758866ba4e580349da323fdda22c670.tar.gz rails-299e5f9c5758866ba4e580349da323fdda22c670.tar.bz2 rails-299e5f9c5758866ba4e580349da323fdda22c670.zip |
`sql_type` has been determined already when quoting defaults
No need to call `type_to_sql` again.
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb | 6 |
1 files changed, 2 insertions, 4 deletions
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 |