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

View file

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