Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 2866

Show
Ignore:
Timestamp:
11/04/05 01:49:10 (3 years ago)
Author:
bitsweat
Message:

Quote column names in generated SQL. Closes #2728.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r2864 r2866  
    11*SVN* 
     2 
     3* Quote column names in generated SQL.  #2728 [rtomayko@gmail.com] 
    24 
    35* Correct the pure-Ruby MySQL 4.1.1 shim's version test.  #2718 [Jeremy Kemper] 
  • trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

    r2817 r2866  
    157157    class ColumnDefinition < Struct.new(:base, :name, :type, :limit, :default, :null) #:nodoc: 
    158158      def to_sql 
    159         column_sql = "#{name} #{type_to_sql(type.to_sym, limit)}" 
     159        column_sql = "#{base.quote_column_name(name)} #{type_to_sql(type.to_sym, limit)}" 
    160160        add_column_options!(column_sql, :null => null, :default => default) 
    161161        column_sql 
    162162      end 
    163163      alias to_s :to_sql 
    164        
     164 
    165165      private 
    166166        def type_to_sql(name, limit)