diff options
author | Matthew Draper <matthew@trebex.net> | 2016-12-06 11:04:36 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-06 11:04:36 +1030 |
commit | 5ff0d828f1f39b894a4b6752bddc5b3b96a61ec1 (patch) | |
tree | 35a31da4668089d81c3051209a7de856d9e52f2a /activerecord/lib | |
parent | d19528c0b6740b857bf10f9e8ca58de940b279ad (diff) | |
parent | 30b498036fe35ff9acb698dbc7364e289161113d (diff) | |
download | rails-5ff0d828f1f39b894a4b6752bddc5b3b96a61ec1.tar.gz rails-5ff0d828f1f39b894a4b6752bddc5b3b96a61ec1.tar.bz2 rails-5ff0d828f1f39b894a4b6752bddc5b3b96a61ec1.zip |
Merge pull request #26687 from kamipo/fix_add_index_to_normalize_options
Fix `add_index` to normalize column names and options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 1 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 25e8c51115..5623257fe8 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -1175,6 +1175,7 @@ module ActiveRecord if order = options[:order] case order when Hash + order = order.symbolize_keys quoted_columns.each { |name, column| column << " #{order[name].upcase}" if order[name].present? } when String quoted_columns.each { |name, column| column << " #{order.upcase}" if order.present? } diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 971b274265..b600fa5785 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -717,6 +717,7 @@ module ActiveRecord if length = options[:length] case length when Hash + length = length.symbolize_keys quoted_columns.each { |name, column| column << "(#{length[name]})" if length[name].present? } when Integer quoted_columns.each { |name, column| column << "(#{length})" } |