diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 277ce4a69..e3da35eae 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -193,7 +193,9 @@ def show @default_orgs = Org.default_orgs @all_ggs_grouped_by_org.each do |org, ggs| # @default_orgs and already selected guidance groups are important. - @important_ggs << [org, ggs] if (@default_orgs.include?(org) || !(ggs & @selected_guidance_groups).empty?) && !@important_ggs.include?([org, ggs]) + if (@default_orgs.include?(org) || (ggs & @selected_guidance_groups).any?) && !@important_ggs.include?([org, ggs]) + @important_ggs << [org, ggs] + end end # Sort the rest by org name for the accordion