mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #1417 from BelieveC/EnableZeroLengthPredicate
Enable Style/ZeroLengthPredicate Rubocop cop
This commit is contained in:
commit
e2a7e396a2
3 changed files with 5 additions and 6 deletions
|
|
@ -92,6 +92,10 @@ Style/TrailingBlankLines:
|
|||
Style/TrailingWhitespace:
|
||||
Enabled: true
|
||||
|
||||
#This cop checks for numeric comparisons that can be replaced by a predicate method.
|
||||
Style/ZeroLengthPredicate:
|
||||
Enabled: true
|
||||
|
||||
#################### Metrics ###############################
|
||||
|
||||
# Avoid deep blocks nesting
|
||||
|
|
|
|||
|
|
@ -680,8 +680,3 @@ Style/UnneededInterpolation:
|
|||
Style/WordArray:
|
||||
EnforcedStyle: percent
|
||||
MinSize: 3
|
||||
|
||||
# Offense count: 1
|
||||
Style/ZeroLengthPredicate:
|
||||
Exclude:
|
||||
- 'app/models/conference.rb'
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ class Conference < ActiveRecord::Base
|
|||
result = Conference.where('start_date > ?', Time.now).
|
||||
select('id, short_title, color, start_date')
|
||||
|
||||
if result.length == 0
|
||||
if result.empty?
|
||||
result = Conference.
|
||||
select('id, short_title, color, start_date').limit(2).
|
||||
order(start_date: :desc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue