5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 02:31:42 +00:00

fix: asignar la remote flag #15648

This commit is contained in:
f 2024-03-18 12:55:27 -03:00
parent 9dc0ed7684
commit bcfb7a5a7f
No known key found for this signature in database
2 changed files with 12 additions and 2 deletions

View file

@ -8,7 +8,12 @@ class ActivityPubsController < ApplicationController
define_method(event) do
authorize activity_pub
activity_pub.update(remote_flag_params(activity_pub)) if event == :report
if event == :report
remote_flag_params(activity_pub).tap do |p|
activity_pub.remote_flag_id = p[:remote_flag_attributes][:id]
activity_pub.update(p)
end
end
message =
if activity_pub.public_send(:"may_#{event}?") && activity_pub.public_send(:"#{event}!")

View file

@ -15,7 +15,12 @@ class ActorModerationsController < ApplicationController
authorize actor_moderation
# Crea una RemoteFlag si se envían los parámetros adecuados
actor_moderation.update(remote_flag_params(actor_moderation)) if actor_event == :report
if actor_event == :report
remote_flag_params(actor_moderation).tap do |p|
actor_moderation.remote_flag_id = p[:remote_flag_attributes][:id]
actor_moderation.update(p)
end
end
message =
if actor_moderation.public_send(:"may_#{actor_event}?") && actor_moderation.public_send(:"#{actor_event}!")