diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-04-16 07:45:33 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-04-16 07:45:33 +0900 |
commit | 1a92ae8318c3f5720907dec671d9ebb9221c0817 (patch) | |
tree | 7441adcda3a727f2070b002e21cc045f8cbc8ced /activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | |
parent | 066e5d62d5e83830040083b5f34c9da8bed0ba4f (diff) | |
download | rails-1a92ae8318c3f5720907dec671d9ebb9221c0817.tar.gz rails-1a92ae8318c3f5720907dec671d9ebb9221c0817.tar.bz2 rails-1a92ae8318c3f5720907dec671d9ebb9221c0817.zip |
Refactor `indexes` things in connection adapters
* Use keyword arguments in `IndexDefinition` to ease to ignore unused
options and to avoid to initialize incorrect empty value.
* Place it in `SchemaStatements` for consistency.
* And tiny tweaks.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index 02a6da2f71..5b483ad4ab 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -140,8 +140,17 @@ module ActiveRecord ] end - IndexDefinition.new(table_name, index_name, unique, columns, [], orders, where, nil, using.to_sym, comment.presence) - end.compact + IndexDefinition.new( + table_name, + index_name, + unique, + columns, + orders: orders, + where: where, + using: using.to_sym, + comment: comment.presence + ) + end end def table_options(table_name) # :nodoc: |