Add annual reports for accounts (#28693)
This commit is contained in:
parent
01ce9df880
commit
5b1eb09d54
21 changed files with 480 additions and 1 deletions
16
app/lib/annual_report/source.rb
Normal file
16
app/lib/annual_report/source.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnnualReport::Source
|
||||
attr_reader :account, :year
|
||||
|
||||
def initialize(account, year)
|
||||
@account = account
|
||||
@year = year
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def year_as_snowflake_range
|
||||
(Mastodon::Snowflake.id_at(DateTime.new(year, 1, 1))..Mastodon::Snowflake.id_at(DateTime.new(year, 12, 31)))
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue