Skip to content

Commit

Permalink
Merging pull request #204 from fga-gpp-mds/issue_pullrequest_on_kanban
Browse files Browse the repository at this point in the history
  • Loading branch information
ThalissonMelo authored Dec 13, 2017
2 parents b420b47 + 09ee2e1 commit cb55b9c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/controllers/issues_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,15 @@ def convert_form_params(issue)
@form_params = { issues_infos: [] }
if issue.kind_of?(Array)
@issues.each do |issue|
assignees = assingnee_counter(issue)
@form_params[:issues_infos].push(name: issue.title, number: issue.number, body: issue.body, issue_id: issue.id, assignees: assignees)
make_form_params(issue)
end
else
assignees = assingnee_counter(issue)
@form_params[:issues_infos].push(name: issue.title, number: issue.number, body: issue.body, issue_id: issue.id, assignees: assignees)
make_form_params(issue)
end
@form_params
end

def assingnee_counter(issue)
def assignee_counter(issue)
assignees = []
if issue.assignees.count > 0
issue.assignees.each do |assignee|
Expand All @@ -143,6 +141,11 @@ def assingnee_counter(issue)
assignees
end

def make_form_params(issue)
assignees = assignee_counter(issue)
@form_params[:issues_infos].push(name: issue.title, number: issue.number, body: issue.body, issue_id: issue.id, assignees: assignees) unless issue.pull_request
end

def issue_params
params.require(:issue).permit(:name, :body, :number)
end
Expand Down

0 comments on commit cb55b9c

Please sign in to comment.