diff --git a/app/models/miq_action.rb b/app/models/miq_action.rb index 60c2bab1a49..d06fa7e1ba0 100644 --- a/app/models/miq_action.rb +++ b/app/models/miq_action.rb @@ -633,7 +633,7 @@ def action_delete_snapshots_by_age(action, rec, _inputs) end task_id = "action_#{action.id}_vm_#{rec.id}" - snaps_to_delete.sort_by(&:create_time).reverse.each do |s| # Delete newest to oldest + snaps_to_delete.sort_by(&:create_time).reverse_each do |s| # Delete newest to oldest MiqPolicy.logger.info("#{log_prefix} Deleting Snapshot: Name: [#{s.name}] Id: [#{s.id}] Create Time: [#{s.create_time}]") rec.remove_snapshot_queue(s.id, task_id) end diff --git a/spec/models/metric/ci_mixin/capture_spec.rb b/spec/models/metric/ci_mixin/capture_spec.rb index 01b60dce6d1..0164204600b 100644 --- a/spec/models/metric/ci_mixin/capture_spec.rb +++ b/spec/models/metric/ci_mixin/capture_spec.rb @@ -297,7 +297,7 @@ def verify_perf_capture_queue(last_perf_capture_on, total_queue_items) if queue_items.any? && realtime_start_time interval_start_time = vm.last_perf_capture_on interval_end_time = interval_start_time + 1.day - queue_items.reverse.each do |q_item| + queue_items.reverse_each do |q_item| verify_historical_queue_item(q_item, interval_start_time, interval_end_time) interval_start_time = interval_end_time