Require Project#path to exist on create
This commit is contained in:
parent
671c3d92e3
commit
3ce9248518
1 changed files with 7 additions and 0 deletions
|
@ -8,6 +8,13 @@ class Twenty::Project < Sequel::Model
|
|||
validates_presence_of :path
|
||||
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]
|
||||
# The path to a project.
|
||||
|
|
Loading…
Reference in a new issue