mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 19:46:23 +00:00
21 lines
632 B
Ruby
21 lines
632 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Gestiona la cola de moderación de actores
|
||
|
class ActorModerationsController < ApplicationController
|
||
|
ActorModeration.aasm.events.map(&:name).each do |actor_event|
|
||
|
define_method(actor_event) do
|
||
|
authorize actor_moderation
|
||
|
|
||
|
actor_moderation.public_send(:"#{actor_event}!") if actor_moderation.public_send(:"may_#{actor_event}?")
|
||
|
|
||
|
redirect_back fallback_location: site_moderation_queue_path(**(session[:moderation_queue_filters] || {}))
|
||
|
end
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def actor_moderation
|
||
|
@actor_moderation ||= site.actor_moderations.find(params[:actor_moderation_id])
|
||
|
end
|
||
|
end
|