Files
danbooru/app/controllers/post_events_controller.rb
evazion 0a792fbb8a replacements: link to old and new media assets.
On the /post_events and /post_replacements pages, include links to the old and new media assets
pages so you can compare the two images.
2022-11-11 00:54:10 -06:00

17 lines
535 B
Ruby

# frozen_string_literal: true
class PostEventsController < ApplicationController
respond_to :html, :xml, :json
def index
if post_id = params[:post_id] || params.dig(:search, :post_id)
@post = Post.find(post_id)
end
@post_events = authorize PostEvent.paginated_search(params, defaults: { post_id: @post&.id }, count_pages: @post.present?)
@post_events = @post_events.includes(:creator, :post, model: [:post, :media_asset, :old_media_asset]) if request.format.html?
respond_with(@post_events)
end
end