Skip to content

Commit

Permalink
Refactor: Extract method from Kanban#get_active and #get_testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
edavis10 committed Apr 1, 2010
1 parent b5c3e48 commit 990a48d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions app/models/kanban.rb
Expand Up @@ -95,19 +95,11 @@ def get_users
end

def get_active
active = {}
@users.each do |user|
active[user] = KanbanIssue.find_active(user.id)
end unless @users.blank?
active
issues_from_kanban_issue(:active)
end

def get_testing
testing = {}
@users.each do |user|
testing[user] = KanbanIssue.find_testing(user.id)
end unless @users.blank?
testing
issues_from_kanban_issue(:testing)
end

def quick_issue_ids
Expand Down Expand Up @@ -223,4 +215,15 @@ def get_issues_for_pane(pane)

return issues.group_by(&:assigned_to)
end

def issues_from_kanban_issue(pane)
return {} unless [:active, :testing].include?(pane)

issues = {}
@users.each do |user|
issues[user] = KanbanIssue.send('find_' + pane.to_s, user.id)
end unless @users.blank?
issues

end
end

0 comments on commit 990a48d

Please sign in to comment.