0
0
Fork 0

Fix performance of percentile calculation for annual reports (#32765)

This commit is contained in:
Eugen Rochko 2024-11-04 11:11:06 +01:00 committed by GitHub
parent 823f597f00
commit 90f4ffa31d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 77 additions and 47 deletions

View file

@ -17,11 +17,21 @@ class AnnualReport
SCHEMA = 1
def self.table_name_prefix
'annual_report_'
end
def initialize(account, year)
@account = account
@year = year
end
def self.prepare(year)
SOURCES.each do |klass|
klass.prepare(year)
end
end
def generate
return if GeneratedAnnualReport.exists?(account: @account, year: @year)