aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2015-05-04 08:18:31 +0900
committerRyuta Kamizono <kamipo@gmail.com>2015-05-04 08:22:44 +0900
commitf380c2913458bf84af67fdd95a364215615e3a27 (patch)
tree3e1d153b0ada4a9a7c35e9488dacd4156bfd56b1 /activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
parentc8816b4d51844dcfb92dd58cf786b195538b90a7 (diff)
downloadrails-f380c2913458bf84af67fdd95a364215615e3a27.tar.gz
rails-f380c2913458bf84af67fdd95a364215615e3a27.tar.bz2
rails-f380c2913458bf84af67fdd95a364215615e3a27.zip
More exercise the create index sql tests
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb4
1 files changed, 2 insertions, 2 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 654ed0250e..9004d86b04 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -934,13 +934,13 @@ module ActiveRecord
def add_index_options(table_name, column_name, options = {}) #:nodoc:
column_names = Array(column_name)
- index_name = index_name(table_name, column: column_names)
options.assert_valid_keys(:unique, :order, :name, :where, :length, :internal, :using, :algorithm, :type)
- index_type = options[:unique] ? "UNIQUE" : ""
index_type = options[:type].to_s if options.key?(:type)
+ index_type ||= options[:unique] ? "UNIQUE" : ""
index_name = options[:name].to_s if options.key?(:name)
+ index_name ||= index_name(table_name, column: column_names)
max_index_length = options.fetch(:internal, false) ? index_name_length : allowed_index_name_length
if options.key?(:algorithm)