From 730fa5db21d0b47e47a26a83d0a471db2a1e7959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Mata?= Date: Sun, 12 Apr 2026 22:00:05 +0200 Subject: [PATCH] Update app/models/insight/generators/net_worth_milestone_generator.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Juan José Mata --- app/models/insight/generators/net_worth_milestone_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/insight/generators/net_worth_milestone_generator.rb b/app/models/insight/generators/net_worth_milestone_generator.rb index a8fd38e8c..43a68744b 100644 --- a/app/models/insight/generators/net_worth_milestone_generator.rb +++ b/app/models/insight/generators/net_worth_milestone_generator.rb @@ -24,7 +24,7 @@ class Insight::Generators::NetWorthMilestoneGenerator < Insight::Generator series_high = prior_values.max.to_f thirty_day_high = current_nw >= series_high && current_nw > prior_nw - crossed = ROUND_MILESTONES.find { |m| current_nw >= m && prior_nw < m } + crossed = ROUND_MILESTONES.reverse_each.find { |m| current_nw >= m && prior_nw < m } return [] unless crossed || thirty_day_high