make sure we override index creation for mysql
This commit is contained in:
parent
5b41082aba
commit
a577f09fb0
|
@ -534,6 +534,19 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
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
|
# TODO: implement error_number method on Mysql2::Exception
|
||||||
def translate_exception(exception, message)
|
def translate_exception(exception, message)
|
||||||
return super unless exception.respond_to?(:error_number)
|
return super unless exception.respond_to?(:error_number)
|
||||||
|
|
Loading…
Reference in New Issue