From 6570f5fc04ebf60d3b18e69c1e10034ef64755f3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 3 Nov 2025 17:22:38 +0100 Subject: [PATCH] Use etag for assignments/new --- app/controllers/cards/assignments_controller.rb | 2 ++ app/views/cards/assignments/new.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/cards/assignments_controller.rb b/app/controllers/cards/assignments_controller.rb index 9516ebc2f..80b6c8149 100644 --- a/app/controllers/cards/assignments_controller.rb +++ b/app/controllers/cards/assignments_controller.rb @@ -2,6 +2,8 @@ class Cards::AssignmentsController < ApplicationController include CardScoped def new + @users = @collection.users.active.alphabetically + fresh_when @users end def create diff --git a/app/views/cards/assignments/new.html.erb b/app/views/cards/assignments/new.html.erb index ee7f8a74c..8642e2c0a 100644 --- a/app/views/cards/assignments/new.html.erb +++ b/app/views/cards/assignments/new.html.erb @@ -7,13 +7,13 @@ navigable_list_actionable_items_value: true } do %> Assign this to… - <% if @collection.users.active.count > 1 %> + <% if @users.many? %> <%= text_field_tag :search, nil, placeholder: "Filter…", class: "input input--transparent txt-small margin-block-half", autofocus: true, type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %> <% end %>