Require Project#path to exist on create

This commit is contained in:
0x1eef 2024-04-26 16:22:05 -03:00
parent 671c3d92e3
commit 3ce9248518

View file

@ -8,6 +8,13 @@ class Twenty::Project < Sequel::Model
validates_presence_of :path validates_presence_of :path
one_to_many :tasks, class_name: "Twenty::Task" one_to_many :tasks, class_name: "Twenty::Task"
##
# @api private
def validate
super
errors.add(:path, "does not exist on disk") if new? && !path_exist?
end
## ##
# @return [String] # @return [String]
# The path to a project. # The path to a project.