mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Use !exists? instead of empty?
`exists?` issues a better SQL query than `empty?`
This commit is contained in:
parent
996395cc80
commit
11b9081064
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue