Merge pull request #3435 from evazion/fix-3324

Fix #3324: Incorporate replacement comment info in the replacement history
This commit is contained in:
Albert Yi
2017-12-19 15:02:06 -08:00
committed by GitHub
8 changed files with 133 additions and 6 deletions

View File

@@ -14,6 +14,13 @@ class PostReplacementsController < ApplicationController
respond_with(@post_replacement, location: @post)
end
def update
@post_replacement = PostReplacement.find(params[:id])
@post_replacement.update(update_params)
respond_with(@post_replacement)
end
def index
params[:search][:post_id] = params.delete(:post_id) if params.has_key?(:post_id)
@post_replacements = PostReplacement.search(params[:search]).paginate(params[:page], limit: params[:limit])
@@ -25,4 +32,12 @@ private
def create_params
params.require(:post_replacement).permit(:replacement_url, :replacement_file, :final_source, :tags)
end
def update_params
params.require(:post_replacement).permit(
:file_ext_was, :file_size_was, :image_width_was, :image_height_was, :md5_was,
:file_ext, :file_size, :image_width, :image_height, :md5,
:original_url, :replacement_url
)
end
end