Add Twenty::Project#path_exist?

This commit is contained in:
0x1eef 2024-04-26 16:13:30 -03:00
parent 07787710e5
commit 671c3d92e3

View file

@ -15,6 +15,13 @@ class Twenty::Project < Sequel::Model
super&.sub(Dir.home, "~")
end
##
# @return [Boolean]
# Returns true when {#path} exists on disk.
def path_exist?
File.exist? File.expand_path(path)
end
##
# @return [Integer]
# Returns the number of open tasks a project has.