Files
danbooru/app/controllers/post_regenerations_controller.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

14 lines
403 B
Ruby

# frozen_string_literal: true
class PostRegenerationsController < ApplicationController
respond_to :xml, :json, :html
def create
@post = authorize Post.find(params[:post_id]), :regenerate?
@post.regenerate_later!(params[:category], CurrentUser.user)
flash[:notice] = "Post regeneration scheduled, press Ctrl+F5 in a few seconds to refresh the image"
respond_with(@post)
end
end