diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-04 01:49:10 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-04 01:49:10 +0000 |
commit | 427300e08f8ab711a95ecfd66fa6bda82a970aea (patch) | |
tree | 31c85c6f334d3bc3d818dc095b5d2fb1414793dc /activerecord/lib | |
parent | f482bd50186b8cd9150eb370b0d274446aecef2b (diff) | |
download | rails-427300e08f8ab711a95ecfd66fa6bda82a970aea.tar.gz rails-427300e08f8ab711a95ecfd66fa6bda82a970aea.tar.bz2 rails-427300e08f8ab711a95ecfd66fa6bda82a970aea.zip |
Quote column names in generated SQL. Closes #2728.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2866 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index b5fe57a0c0..5be344ad06 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -156,12 +156,12 @@ module ActiveRecord class ColumnDefinition < Struct.new(:base, :name, :type, :limit, :default, :null) #:nodoc: def to_sql - column_sql = "#{name} #{type_to_sql(type.to_sym, limit)}" + column_sql = "#{base.quote_column_name(name)} #{type_to_sql(type.to_sym, limit)}" add_column_options!(column_sql, :null => null, :default => default) column_sql end alias to_s :to_sql - + private def type_to_sql(name, limit) base.type_to_sql(name, limit) rescue name |