Added projects. Part 4
This commit is contained in:
@@ -119,6 +119,10 @@ class DBase
|
||||
Projects.order(:id).all
|
||||
end
|
||||
|
||||
def proj(id)
|
||||
Projects[id]
|
||||
end
|
||||
|
||||
def proj_create(proj_name, proj_descr)
|
||||
@error = nil
|
||||
data = Projects.where(projname: proj_name).first
|
||||
@@ -130,4 +134,17 @@ class DBase
|
||||
end
|
||||
@error
|
||||
end
|
||||
|
||||
def get_gits_for_projects(id)
|
||||
result = []
|
||||
git_list = ReposProjects.where(proj_id: id.to_i).all
|
||||
unless git_list.nil?
|
||||
result = git_list.map do |item|
|
||||
Repos[item[:repo_id]]
|
||||
end.reject do |item|
|
||||
item.nil?
|
||||
end
|
||||
end
|
||||
result
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user