Merge pull request #2212 from TracksApp/exists-instead-of-empty

Prefer !exists? over empty?
This commit is contained in:
Matt Rogers 2019-05-04 20:56:53 -05:00 committed by GitHub
commit d180acb88a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,7 +103,7 @@ class Project < ApplicationRecord
def stalled?
# Stalled projects are active projects with no active next actions
return false if self.completed? || self.hidden?
return self.todos.deferred_or_blocked.empty? && self.todos.active.empty?
return !self.todos.deferred_or_blocked.exists? && !self.todos.active.exists?
end
def shortened_name(length=40)