From b99f57f51cbe8bcb91417ad3719ef2dc15ae406c Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 10 Aug 2011 15:16:54 -0700 Subject: [PATCH] [#6441] Use a string so the flow is clearer --- app/helpers/contracts_helper.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/helpers/contracts_helper.rb b/app/helpers/contracts_helper.rb index 41e2796..2231d2d 100644 --- a/app/helpers/contracts_helper.rb +++ b/app/helpers/contracts_helper.rb @@ -25,9 +25,9 @@ module ContractsHelper end def grouped_deliverable_options_for_select(project, selected_key=nil) - project.contracts.all(:include => :deliverables).inject([]) do |html, contract| + project.contracts.all(:include => :deliverables).inject("") do |html, contract| if contract.closed? && !contract.includes_deliverable_id?(selected_key) - # skip + html else options = contract.deliverables.collect do |deliverable| deliverable_option(deliverable, selected_key) @@ -35,8 +35,7 @@ module ContractsHelper html << content_tag(:optgroup, options.join("\n"), :label => h(contract.name)) end - html - end.join('\n') + end end def deliverable_option(deliverable, selected_key)