Skip to content

Commit

Permalink
Merge pull request #3446 from manyfold3d/fix-update-all
Browse files Browse the repository at this point in the history
Fix "update all" button
  • Loading branch information
Floppy authored Jan 20, 2025
2 parents 216a605 + c45f6ca commit 09aaff6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/models_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def bulk_update
add_tags = Set.new(hash.delete(:add_tags))
remove_tags = Set.new(hash.delete(:remove_tags))

models_to_update = if params[:commit] == t("models.bulk_edit.update_all")
models_to_update = if params.key?(:update_all)
# If "Update All Models" was clicked, update all models in the filtered set
filtered_models(@filters)
else
Expand Down
2 changes: 1 addition & 1 deletion app/views/models/bulk_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<%= form.hidden_field :library, value: @filters[:library] if @filters[:library] %>
<%= form.hidden_field :creator, value: @filters[:creator] if @filters[:creator] %>
<%= form.submit translate(".submit"), class: "btn btn-primary" %>
<%= form.submit translate(".update_all", count: @models.total_count), class: "btn btn-secondary" %>
<%= form.submit translate(".update_all", count: @models.total_count), class: "btn btn-secondary", name: "update_all" %>

</div>
<% if !@filters.empty? %>
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/models_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@

let(:params) do
{
commit: I18n.t("models.bulk_edit.update_all"),
update_all: I18n.t("models.bulk_edit.update_all"),
new_library_id: new_library.id,
tag: [tag.name]
}
Expand Down

0 comments on commit 09aaff6

Please sign in to comment.