make sure we override index creation for mysql

This commit is contained in:
Brian Lopez 2010-05-12 22:34:53 -07:00
parent 5b41082aba
commit a577f09fb0
1 changed files with 13 additions and 0 deletions

View File

@ -534,6 +534,19 @@ module ActiveRecord
end
protected
def quoted_columns_for_index(column_names, options = {})
length = options[:length] if options.is_a?(Hash)
quoted_column_names = case length
when Hash
column_names.map {|name| length[name] ? "#{quote_column_name(name)}(#{length[name]})" : quote_column_name(name) }
when Fixnum
column_names.map {|name| "#{quote_column_name(name)}(#{length})"}
else
column_names.map {|name| quote_column_name(name) }
end
end
# TODO: implement error_number method on Mysql2::Exception
def translate_exception(exception, message)
return super unless exception.respond_to?(:error_number)