Merge remote-tracking branch 'parent/main' into upstream-20241107
This commit is contained in:
commit
a003c2db89
98 changed files with 2002 additions and 590 deletions
9
app/serializers/rest/annual_report_event_serializer.rb
Normal file
9
app/serializers/rest/annual_report_event_serializer.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::AnnualReportEventSerializer < ActiveModel::Serializer
|
||||
attributes :year
|
||||
|
||||
def year
|
||||
object.year.to_s
|
||||
end
|
||||
end
|
|
@ -14,6 +14,7 @@ class REST::NotificationGroupSerializer < ActiveModel::Serializer
|
|||
belongs_to :account_relationship_severance_event, key: :event, if: :relationship_severance_event?, serializer: REST::AccountRelationshipSeveranceEventSerializer
|
||||
belongs_to :account_warning, key: :moderation_warning, if: :moderation_warning_event?, serializer: REST::AccountWarningSerializer
|
||||
has_one :list, if: :list_status_type?, serializer: REST::ListSerializer
|
||||
belongs_to :generated_annual_report, key: :annual_report, if: :annual_report_event?, serializer: REST::AnnualReportEventSerializer
|
||||
|
||||
def sample_account_ids
|
||||
object.sample_accounts.pluck(:id).map(&:to_s)
|
||||
|
@ -47,6 +48,10 @@ class REST::NotificationGroupSerializer < ActiveModel::Serializer
|
|||
object.type == :moderation_warning
|
||||
end
|
||||
|
||||
def annual_report_event?
|
||||
object.type == :annual_report
|
||||
end
|
||||
|
||||
def page_min_id
|
||||
object.pagination_data[:min_id].to_s
|
||||
end
|
||||
|
|
|
@ -50,14 +50,6 @@ class REST::V1::InstanceSerializer < ActiveModel::Serializer
|
|||
{ streaming_api: Rails.configuration.x.streaming_api_base_url }
|
||||
end
|
||||
|
||||
def usage
|
||||
{
|
||||
users: {
|
||||
active_month: instance_presenter.active_user_count(4),
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
def configuration
|
||||
{
|
||||
accounts: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue