diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 452611fe..d4d6c2d4 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -37,13 +37,10 @@ module IssuesHelper
@project.issues.tag_counts_on(:labels).map(&:name)
end
- # Returns a fake Milestone-like object that can be used in a
- # select_tag to allow filtering by issues with no assigned milestone
- def unassigned_milestone
- OpenStruct.new(id: 0, title: 'Unspecified')
- end
-
- def unassigned_issue
- OpenStruct.new(id: 0, name: 'Unassigned')
+ # Returns an OpenStruct object suitable for use by options_from_collection_for_select
+ # to allow filtering issues by an unassigned User or Milestone
+ def unassigned_filter
+ # Milestone uses :title, Issue uses :name
+ OpenStruct.new(id: 0, title: 'Unspecified', name: 'Unassigned')
end
end
diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml
index fbc2fe7d..8876d24d 100644
--- a/app/views/issues/index.html.haml
+++ b/app/views/issues/index.html.haml
@@ -49,8 +49,8 @@
.right
= form_tag project_issues_path(@project), method: :get, class: :right do
= select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
- = select_tag(:assignee_id, options_from_collection_for_select([unassigned_issue] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
- = select_tag(:milestone_id, options_from_collection_for_select([unassigned_milestone] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
+ = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
+ = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
= hidden_field_tag :f, params[:f]
.clearfix