Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
ventura-ghr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
ventura-ghr
Commits
23ed285d
Commit
23ed285d
authored
Nov 25, 2016
by
Bui Minh Duc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
completed db modeling
parent
6e467428
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
app/controllers/main_controller.rb
+4
-0
app/models/repository.rb
+2
-0
lib/tasks/github.rake
+8
-4
No files found.
app/controllers/main_controller.rb
View file @
23ed285d
...
@@ -11,6 +11,10 @@ class MainController < ApplicationController
...
@@ -11,6 +11,10 @@ class MainController < ApplicationController
@selected_repos_obj
.
append
(
repo_obj
)
@selected_repos_obj
.
append
(
repo_obj
)
end
end
@labels
=
@label
||
Label
.
all
@labels
=
@label
||
Label
.
all
@cols
=
[
"discussion"
,
"todo"
,
"inprogress"
,
"vnreview"
,
"jpreview"
,
"ready"
,
"done"
,
"releasefailed"
,
"pending"
]
end
end
def
update_repo_selected
def
update_repo_selected
...
...
app/models/repository.rb
View file @
23ed285d
class
Repository
<
ApplicationRecord
class
Repository
<
ApplicationRecord
has_many
:issues
has_many
:labels
end
end
lib/tasks/github.rake
View file @
23ed285d
...
@@ -7,9 +7,9 @@ namespace :github do
...
@@ -7,9 +7,9 @@ namespace :github do
insert_users
(
$client
)
insert_users
(
$client
)
db_repos
=
Repository
.
all
db_repos
=
Repository
.
all
#
db_repos.each do |db_repo|
db_repos
.
each
do
|
db_repo
|
#
insert_labels(db_repo, $client)
insert_labels
(
db_repo
,
$client
)
#
end
end
db_repos
.
each
do
|
db_repo
|
db_repos
.
each
do
|
db_repo
|
insert_issues
(
db_repo
,
$client
)
insert_issues
(
db_repo
,
$client
)
...
@@ -153,7 +153,11 @@ namespace :github do
...
@@ -153,7 +153,11 @@ namespace :github do
db_issue
.
labels
.
append
(
db_label
)
db_issue
.
labels
.
append
(
db_label
)
end
end
# TODO implement assignees relation
issue
.
assignees
.
each
do
|
assignee
|
db_assignee
=
User
.
where
(
id:
assignee
.
id
).
first
db_issue
.
users
.
append
(
db_assignee
)
end
if
db_issue
.
save
if
db_issue
.
save
if
new_flag
if
new_flag
puts
"Insert issue success: "
+
issue
.
title
puts
"Insert issue success: "
+
issue
.
title
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment