Update app/models/insight/generators/net_worth_milestone_generator.rb

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Juan José Mata <jjmata@jjmata.com>
This commit is contained in:
Juan José Mata
2026-04-12 22:00:05 +02:00
committed by GitHub
parent d25bb6e2a3
commit 730fa5db21

View File

@@ -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