Add post regenerations

This commit is contained in:
BrokenEagle
2020-11-22 07:08:40 +00:00
committed by evazion
parent e6f2bf1c89
commit 16d6f3bbd5
13 changed files with 234 additions and 12 deletions

View File

@@ -0,0 +1,18 @@
class PostRegenerationsController < ApplicationController
respond_to :html, :xml, :json, :js
def create
@post_regeneration = authorize PostRegeneration.new(creator: CurrentUser.user, **permitted_attributes(PostRegeneration))
@post_regeneration.execute_category_action!
@post_regeneration.save
respond_with(@post_regeneration, location: @post_regeneration.post)
end
def index
@post_regenerations = authorize PostRegeneration.paginated_search(params)
@post_regenerations = @post_regenerations.includes(:creator, :post) if request.format.html?
respond_with(@post_regenerations)
end
end