diff --git a/.rubocop.yml b/.rubocop.yml index 71ea0a5b9..f1b8c95b6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -226,6 +226,9 @@ Performance/BindCall: Performance/FlatMap: Enabled: true +Performance/MapCompact: + Enabled: true + Performance/RedundantMerge: Enabled: true diff --git a/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb b/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb index 52e796b64..45f8d4b1b 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb @@ -47,7 +47,7 @@ def synonyms(stream) def _indexes(table, stream) if (indexes = @connection.indexes(table)).any? - add_index_statements = indexes.map do |index| + add_index_statements = indexes.filter_map do |index| case index.type when nil # do nothing here. see indexes_in_create @@ -67,7 +67,7 @@ def _indexes(table, stream) statement_parts = ["# unrecognized index #{index.name.inspect} with type #{index.type.inspect}"] end " " + statement_parts.join(", ") unless statement_parts.empty? - end.compact + end return if add_index_statements.empty?