Skip to content

Commit 26fdf36

Browse files
Fix pr suggestions
1 parent 9ed4b70 commit 26fdf36

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

app/controllers/mixins/checked_id_mixin.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def checked_item_id(hash = params)
1010
# Common routine to find checked items on a page (checkbox ids are
1111
# "check_xxx" where xxx is the item id or index)
1212
def find_checked_items(prefix = nil)
13-
has_no_check = true
1413
nested_list_item_key = ""
1514
# Check if nested list items are tagged.
1615
if params["miq_grid_checks"].present?
@@ -20,13 +19,7 @@ def find_checked_items(prefix = nil)
2019
nested_list_item_key = "select-row-#{nested_list_item}"
2120
end
2221

23-
params.each do |var, val|
24-
if var.starts_with?("check_")
25-
has_no_check = false
26-
else
27-
next
28-
end
29-
end
22+
has_no_check = params.each_key.none? { |var| var.start_with?("check_") }
3023

3124
# If id is present use id, unless when nested list exists, example on summary pages
3225
if params[:id].present? && params[nested_list_item_key] != "on" && has_no_check

0 commit comments

Comments
 (0)