Added projects. Part 2

This commit is contained in:
alexey
2025-02-24 23:54:28 +03:00
parent e68e781759
commit b72764d347
6 changed files with 153 additions and 6 deletions

View File

@@ -118,4 +118,16 @@ class DBase
def proj_list
Projects.order(:id).all
end
def proj_create(proj_name, proj_descr)
@error = nil
data = Projects.where(projname: project_name).first
if data.nil?
id = Projects.insert(projname: project_name, descr: description, public: 1)
@last_id = id
else
@error = "Данный проект уже существует"
end
@error
end
end