Fix performance of percentile calculation for annual reports (#32765)
This commit is contained in:
parent
823f597f00
commit
90f4ffa31d
7 changed files with 77 additions and 47 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue