mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 07:05:20 +00:00
Fix IDs not being serialized as strings in annual reports API (#32710)
This commit is contained in:
parent
01e25af2e3
commit
c2b498a2b0
|
@ -7,7 +7,7 @@ class AnnualReport::CommonlyInteractedWithAccounts < AnnualReport::Source
|
||||||
{
|
{
|
||||||
commonly_interacted_with_accounts: commonly_interacted_with_accounts.map do |(account_id, count)|
|
commonly_interacted_with_accounts: commonly_interacted_with_accounts.map do |(account_id, count)|
|
||||||
{
|
{
|
||||||
account_id: account_id,
|
account_id: account_id.to_s,
|
||||||
count: count,
|
count: count,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -7,7 +7,7 @@ class AnnualReport::MostRebloggedAccounts < AnnualReport::Source
|
||||||
{
|
{
|
||||||
most_reblogged_accounts: most_reblogged_accounts.map do |(account_id, count)|
|
most_reblogged_accounts: most_reblogged_accounts.map do |(account_id, count)|
|
||||||
{
|
{
|
||||||
account_id: account_id,
|
account_id: account_id.to_s,
|
||||||
count: count,
|
count: count,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -8,9 +8,9 @@ class AnnualReport::TopStatuses < AnnualReport::Source
|
||||||
|
|
||||||
{
|
{
|
||||||
top_statuses: {
|
top_statuses: {
|
||||||
by_reblogs: top_reblogs,
|
by_reblogs: top_reblogs&.to_s,
|
||||||
by_favourites: top_favourites,
|
by_favourites: top_favourites&.to_s,
|
||||||
by_replies: top_replies,
|
by_replies: top_replies&.to_s,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,7 +32,7 @@ RSpec.describe AnnualReport::CommonlyInteractedWithAccounts do
|
||||||
expect(subject.generate)
|
expect(subject.generate)
|
||||||
.to include(
|
.to include(
|
||||||
commonly_interacted_with_accounts: contain_exactly(
|
commonly_interacted_with_accounts: contain_exactly(
|
||||||
include(account_id: other_account.id, count: 2)
|
include(account_id: other_account.id.to_s, count: 2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,7 +32,7 @@ RSpec.describe AnnualReport::MostRebloggedAccounts do
|
||||||
expect(subject.generate)
|
expect(subject.generate)
|
||||||
.to include(
|
.to include(
|
||||||
most_reblogged_accounts: contain_exactly(
|
most_reblogged_accounts: contain_exactly(
|
||||||
include(account_id: other_account.id, count: 2)
|
include(account_id: other_account.id.to_s, count: 2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,9 +39,9 @@ RSpec.describe AnnualReport::TopStatuses do
|
||||||
expect(subject.generate)
|
expect(subject.generate)
|
||||||
.to include(
|
.to include(
|
||||||
top_statuses: include(
|
top_statuses: include(
|
||||||
by_reblogs: reblogged_status.id,
|
by_reblogs: reblogged_status.id.to_s,
|
||||||
by_favourites: favourited_status.id,
|
by_favourites: favourited_status.id.to_s,
|
||||||
by_replies: replied_status.id
|
by_replies: replied_status.id.to_s
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue