Enable Style/ZeroLengthPredicate Rubocop cop
This cop checks for numeric comparisons that can be replaced by a predicate method. It supports autocorrection, so all the offenses where automatically solved. Closes #1416
This commit is contained in:
parent
8a19c52698
commit
782937b1d9
3 changed files with 5 additions and 6 deletions
|
|
@ -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