Skip to content

Commit

Permalink
Fix historical fact ordering within a single person
Browse files Browse the repository at this point in the history
  • Loading branch information
moveson committed Dec 2, 2024
1 parent a6a3cdd commit 0fbb9bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/helpers/badge_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def historical_fact_kind_badge(kind)
when "volunteer_multi"
title = "VMulti"
color = :success
tooltip_text = "Multiple years of volunteer work (as reported in a specific year)"
tooltip_text = "Multiple years of volunteer work (as of the year shown)"
when "qualifier_finish"
title = "Qualifier"
color = :secondary
Expand Down
1 change: 1 addition & 0 deletions app/models/historical_fact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class HistoricalFact < ApplicationRecord
end
end
scope :ordered, -> { order(:last_name, :first_name, :state_code, :year, :kind) }
scope :ordered_within_person, -> { order(:year, :kind) }
scope :reconciled, -> { where.not(person_id: nil) }
scope :unreconciled, -> { where(person_id: nil) }

Expand Down
2 changes: 1 addition & 1 deletion app/views/historical_facts/_reconcile_card.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</tr>
</thead>
<tbody>
<%= render partial: "reconcile_row", collection: presenter.relevant_historical_facts.ordered, as: :fact %>
<%= render partial: "reconcile_row", collection: presenter.relevant_historical_facts.ordered_within_person, as: :fact %>
</tbody>
</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/lotteries/_calculations_applicant.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</tr>
</thead>
<tbody>
<%= render partial: "historical_facts/calculations_row", collection: record.person.historical_facts.ordered, as: :fact %>
<%= render partial: "historical_facts/calculations_row", collection: record.person.historical_facts.ordered_within_person, as: :fact %>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 0fbb9bc

Please sign in to comment.