mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-19 08:26:20 +00:00
feat: volver a pausar un objeto aprobado cuando se lo actualiza
This commit is contained in:
parent
8ff556c9ed
commit
9a479a157b
2 changed files with 7 additions and 1 deletions
|
@ -40,5 +40,11 @@ class ActivityPub < ApplicationRecord
|
|||
object.update(object: {})
|
||||
end
|
||||
end
|
||||
|
||||
# Si un objeto previamente aprobado fue actualizado, volvemos a
|
||||
# pausarlo.
|
||||
event :pause do
|
||||
transitions from: :approved, to: :paused
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,6 +4,6 @@ class ActivityPub::Activity::Update < ActivityPub::Activity
|
|||
# Si estamos actualizando el objeto, tenemos que devolverlo a estado
|
||||
# de moderación
|
||||
def update_activity_pub_state!
|
||||
activity_pub.paused!
|
||||
activity_pub.pause! if activity_pub.approved?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue