diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-12-03 07:08:30 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-12-03 07:08:30 +0900 |
commit | 33a3f7123bc4cc49b99b01a40bbfd463b2e73f76 (patch) | |
tree | 254c6b0f4b0a5e17831763c9b77176e1c7753ceb /activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | |
parent | 3040446cece8e7a6d9e29219e636e13f180a1e03 (diff) | |
download | rails-33a3f7123bc4cc49b99b01a40bbfd463b2e73f76.tar.gz rails-33a3f7123bc4cc49b99b01a40bbfd463b2e73f76.tar.bz2 rails-33a3f7123bc4cc49b99b01a40bbfd463b2e73f76.zip |
Extract duplicated index column options normalization as `options_for_index_columns`
And placed `add_options_for_index_columns` in `schema_statements.rb`
consistently to ease to find related code.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 19 |
1 files changed, 0 insertions, 19 deletions
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 41c628302d..479131caad 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -605,25 +605,6 @@ module ActiveRecord end end - def add_index_length(quoted_columns, **options) - if length = options[:length] - case length - when Hash - length = length.symbolize_keys - quoted_columns.each { |name, column| column << "(#{length[name]})" if length[name].present? } - else - quoted_columns.each { |name, column| column << "(#{length})" } - end - end - - quoted_columns - end - - def add_options_for_index_columns(quoted_columns, **options) - quoted_columns = add_index_length(quoted_columns, options) - super - end - # See https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html ER_DUP_ENTRY = 1062 ER_NOT_NULL_VIOLATION = 1048 |