refactor upload tags report
This commit is contained in:
@@ -18,4 +18,10 @@ class ReportsController < ApplicationController
|
||||
def post_versions_create
|
||||
@report = Reports::PostVersions.new(params[:tag], params[:type])
|
||||
end
|
||||
|
||||
def upload_tags
|
||||
@user = User.find(params[:user_id])
|
||||
@upload_reports = Reports::UploadTags.for_user(params[:user_id]).order("id desc").paginate(params[:page], :limit => params[:limit])
|
||||
respond_with(@upload_reports)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ class UploadTagsReport < Post
|
||||
def uploader_tags_array
|
||||
@uploader_tags ||= begin
|
||||
added_tags = []
|
||||
PostVersion.where(post_id: id, updater_id: uploader_id).each do |version|
|
||||
PostArchive.where(post_id: id, updater_id: uploader_id).each do |version|
|
||||
added_tags += version.changes[:added_tags]
|
||||
end
|
||||
added_tags.uniq.sort
|
||||
|
||||
Reference in New Issue
Block a user