Skip to content

Commit

Permalink
Fix sponsors_count calculation logic in account model
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Nov 28, 2024
1 parent 0f8d605 commit af081f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def to_param
end

def set_sponsors_count
self.sponsors_count = total_sponsors == 0 ? sponsorships_as_maintainer.count : total_sponsors
self.sponsors_count = (total_sponsors == 0 || sponsorships_as_maintainer.count > total_sponsors) ? sponsorships_as_maintainer.count : total_sponsors
self.sponsorships_count = sponsorships_as_funder.count
self.active_sponsorships_count = sponsorships_as_funder.active.count
self.active_sponsors_count = (current_sponsors == 0 || sponsorships_as_maintainer.active.count > current_sponsors) ? sponsorships_as_maintainer.active.count : current_sponsors
Expand Down

0 comments on commit af081f8

Please sign in to comment.