Add AnnualReport::Source#report_statuses
method for subclasses to use (#31753)
This commit is contained in:
parent
559958f8c5
commit
4678473e54
10 changed files with 22 additions and 25 deletions
|
@ -17,7 +17,7 @@ class AnnualReport::TimeSeries < AnnualReport::Source
|
|||
private
|
||||
|
||||
def statuses_per_month
|
||||
@statuses_per_month ||= @account.statuses.reorder(nil).where(id: year_as_snowflake_range).group(:period).pluck(Arel.sql("date_part('month', created_at)::int AS period, count(*)")).to_h
|
||||
@statuses_per_month ||= report_statuses.group(:period).pluck(Arel.sql("date_part('month', created_at)::int AS period, count(*)")).to_h
|
||||
end
|
||||
|
||||
def following_per_month
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue