Address `Layout/IndentationWidth` cop offenses

This commit addresses RuboCop offenses reported at
https://buildkite.com/rails/rails/builds/107320#018f8835-b770-4068-9b97-0aec28c7ddb3

- Offenses are addressed by RuboCop auto correction as follows
```
$ bundle exec rubocop -a activerecord/test/cases/connection_adapters/type_lookup_test.rb
Inspecting 1 file
C

Offenses:

activerecord/test/cases/connection_adapters/type_lookup_test.rb:91:9: C: [Corrected] Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
           %w{decimal(2) decimal(2,0) numeric(2) numeric(2,0) number(2) number(2,0)}.each do |type|
        ^^^
activerecord/test/cases/connection_adapters/type_lookup_test.rb:92:11: C: [Corrected] Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
             cast_type = @connection.send(:type_map).lookup(type)
          ^^^
activerecord/test/cases/connection_adapters/type_lookup_test.rb:94:14: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
             assert_equal :decimal, cast_type.type
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
activerecord/test/cases/connection_adapters/type_lookup_test.rb:95:14: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
             assert_equal 2, cast_type.cast(2.1)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1 file inspected, 4 offenses detected, 4 offenses corrected
$
```

Follow up #51826
This commit is contained in:
Yasuo Honda 2024-05-18 07:49:08 +09:00
parent d0ce794e2d
commit b708a1b9dd
1 changed files with 5 additions and 5 deletions

View File

@ -88,12 +88,12 @@ module ActiveRecord
end
def test_decimal_without_scale
%w{decimal(2) decimal(2,0) numeric(2) numeric(2,0) number(2) number(2,0)}.each do |type|
cast_type = @connection.send(:type_map).lookup(type)
%w{decimal(2) decimal(2,0) numeric(2) numeric(2,0) number(2) number(2,0)}.each do |type|
cast_type = @connection.send(:type_map).lookup(type)
assert_equal :decimal, cast_type.type
assert_equal 2, cast_type.cast(2.1)
end
assert_equal :decimal, cast_type.type
assert_equal 2, cast_type.cast(2.1)
end
end
private