Skip to content

Commit f0521e2

Browse files
authored
Merge pull request #2266 from yahonda/enable_style_map_to_hash_cop
Enable `Style/MapToHash` cop
2 parents 6ea02b0 + 41fd23a commit f0521e2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ Style/FrozenStringLiteralComment:
132132
Enabled: true
133133
EnforcedStyle: always
134134

135+
Style/MapToHash:
136+
Enabled: true
137+
135138
Style/RedundantFreeze:
136139
Enabled: true
137140

lib/active_record/connection_adapters/oracle_enhanced/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _select_one(arel, name = nil, binds = [])
101101
_oracle_downcase(col_name)
102102
end
103103
row = cursor.fetch
104-
columns.each_with_index.map { |x, i| [x, row[i]] }.to_h if row
104+
columns.each_with_index.to_h { |x, i| [x, row[i]] } if row
105105
ensure
106106
cursor.close
107107
end

0 commit comments

Comments
 (0)