Skip to content

Commit 09aaff6

Browse files
authored
Merge pull request #3446 from manyfold3d/fix-update-all
Fix "update all" button
2 parents 216a605 + c45f6ca commit 09aaff6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/controllers/models_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def bulk_update
140140
add_tags = Set.new(hash.delete(:add_tags))
141141
remove_tags = Set.new(hash.delete(:remove_tags))
142142

143-
models_to_update = if params[:commit] == t("models.bulk_edit.update_all")
143+
models_to_update = if params.key?(:update_all)
144144
# If "Update All Models" was clicked, update all models in the filtered set
145145
filtered_models(@filters)
146146
else

app/views/models/bulk_edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<%= form.hidden_field :library, value: @filters[:library] if @filters[:library] %>
5959
<%= form.hidden_field :creator, value: @filters[:creator] if @filters[:creator] %>
6060
<%= form.submit translate(".submit"), class: "btn btn-primary" %>
61-
<%= form.submit translate(".update_all", count: @models.total_count), class: "btn btn-secondary" %>
61+
<%= form.submit translate(".update_all", count: @models.total_count), class: "btn btn-secondary", name: "update_all" %>
6262

6363
</div>
6464
<% if !@filters.empty? %>

spec/requests/models_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215

216216
let(:params) do
217217
{
218-
commit: I18n.t("models.bulk_edit.update_all"),
218+
update_all: I18n.t("models.bulk_edit.update_all"),
219219
new_library_id: new_library.id,
220220
tag: [tag.name]
221221
}

0 commit comments

Comments
 (0)