This commit is contained in:
0x1eef 2024-04-26 16:52:18 -03:00
parent b919e97296
commit f5c299cbc8
2 changed files with 6 additions and 6 deletions

View file

@ -18,21 +18,21 @@ class Twenty::Project < Sequel::Model
##
# @return [String]
# The path to a project.
# The path to a project
def path
super&.sub(Dir.home, "~")
end
##
# @return [Boolean]
# Returns true when {#path} exists on disk.
# 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.
# Returns the number of open tasks a project has
def open_task_count
@open_task_count ||= Twenty::Task
.where(project_id: id)

View file

@ -4,13 +4,13 @@ module Twenty::Rack
module GraphQL
##
# Extends {Server::Dir Server::Dir} (a static file
# Rack application) with a /graphql endpoint.
# Rack application) with a /graphql endpoint
#
# @param [Hash] env
# Environment hash.
# Environment hash
#
# @return [Array<Integer, Hash, #each>]
# Returns a response.
# Returns a response
def call(env)
req = Rack::Request.new(env)
if req.post? &&