Added project spec seting

This commit is contained in:
alexey
2025-03-08 23:57:56 +03:00
parent e0d169e679
commit aee02beb03
7 changed files with 363 additions and 189 deletions

View File

@@ -21,6 +21,9 @@ end
class ProjectsReposSpec < Sequel::Model(:projects_repos_spec)
end
class ProjectsProjects < Sequel::Model(:projects_projects)
end
class DBase
attr :error, :last_id
@@ -166,4 +169,23 @@ class DBase
def get_project_repo_spec(prj_id, git_id)
ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).first
end
def save_project_repo_spec(prj_id, git_id, spec)
rep = ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).first
if rep.nil?
id = ProjectsReposSpec.insert(proj_id: prj_id.to_i, repo_id: git_id.to_i, spec_name: spec)
@last_id = id
else
ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).update(spec_name: spec)
@last_id = nil
end
end
def delete_project_repo_spec(prj_id, git_id)
ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).delete
end
def get_projects_links(prj_id)
ProjectsProjects.where(proj_id: prj_id.to_i).all
end
end