config/default.yml in rubocop-rails-2.8.1 vs config/default.yml in rubocop-rails-2.9.0
- old
+ new
@@ -96,17 +96,30 @@
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.49'
VersionChanged: '2.5'
+Rails/ArelStar:
+ Description: 'Enforces `Arel.star` instead of `"*"` for expanded columns.'
+ Enabled: true
+ SafeAutoCorrect: false
+ VersionAdded: '2.9'
+
Rails/AssertNot:
Description: 'Use `assert_not` instead of `assert !`.'
Enabled: true
VersionAdded: '0.56'
Include:
- '**/test/**/*'
+Rails/AttributeDefaultBlockValue:
+ Description: 'Pass method call in block for attribute option `default`.'
+ Enabled: pending
+ VersionAdded: '2.9'
+ Include:
+ - 'models/**/*'
+
Rails/BelongsTo:
Description: >-
Use `optional: true` instead of `required: false` for
`belongs_to` relations.
Enabled: true
@@ -267,12 +280,19 @@
Rails/FindEach:
Description: 'Prefer all.find_each over all.find.'
StyleGuide: 'https://rails.rubystyle.guide#find-each'
Enabled: true
VersionAdded: '0.30'
+ VersionChanged: '2.9'
Include:
- app/models/**/*.rb
+ IgnoredMethods:
+ # Methods that don't work well with `find_each`.
+ - order
+ - limit
+ - select
+ - lock
Rails/HasAndBelongsToMany:
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
StyleGuide: 'https://rails.rubystyle.guide#has-many-through'
Enabled: true
@@ -385,11 +405,13 @@
Rails/NegateInclude:
Description: 'Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.'
StyleGuide: 'https://rails.rubystyle.guide#exclude'
Enabled: 'pending'
+ Safe: false
VersionAdded: '2.7'
+ VersionChanged: '2.9'
Rails/NotNullColumn:
Description: 'Do not add a NOT NULL column without a default value.'
Enabled: true
VersionAdded: '0.43'
@@ -651,10 +673,14 @@
Rails/SquishedSQLHeredocs:
Description: 'Checks SQL heredocs to use `.squish`.'
StyleGuide: 'https://rails.rubystyle.guide/#squished-heredocs'
Enabled: 'pending'
VersionAdded: '2.8'
+ VersionChanged: '2.9'
+ # Some SQL syntax (e.g. PostgreSQL comments and functions) requires newlines
+ # to be preserved in order to work, thus auto-correction is not safe.
+ SafeAutoCorrect: false
Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.'
StyleGuide: 'https://rails.rubystyle.guide#time'
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
@@ -703,10 +729,16 @@
VersionAdded: '0.9'
VersionChanged: '0.41'
Include:
- app/models/**/*.rb
+Rails/WhereEquals:
+ Description: 'Pass conditions to `where` as a hash instead of manually constructing SQL.'
+ StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions'
+ Enabled: 'pending'
+ VersionAdded: '2.9'
+
Rails/WhereExists:
Description: 'Prefer `exists?(...)` over `where(...).exists?`.'
Enabled: 'pending'
EnforcedStyle: exists
SupportedStyles:
@@ -715,10 +747,10 @@
VersionAdded: '2.7'
VersionChanged: '2.8'
Rails/WhereNot:
Description: 'Use `where.not(...)` instead of manually constructing negated SQL in `where`.'
- StyleGuide: 'https://rails.rubystyle.guide/#where-not'
+ StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions'
Enabled: 'pending'
VersionAdded: '2.8'
# Accept `redirect_to(...) and return` and similar cases.
Style/AndOr: